C# 클래스 SIL.FieldWorks.Common.RootSites.VerticalOrientationManager

A base class for orientation managers that do vertical alignment.
상속: OrientationManager
파일 보기 프로젝트 열기: sillsdev/FieldWorks

Private Properties

프로퍼티 타입 설명
ConvertKeyValue int
GetCoordRects void
RotatePointDstToPaint Point
RotatePointPaintToDst Point
RotateRectDstToPaint System.Drawing.Rectangle

공개 메소드들

메소드 설명
DrawTheRoot ( IVwDrawRootBuffered vdrb, IVwRootBox rootb, IntPtr hdc, SIL drawRect, uint backColor, bool drawSel, Rectangle clipRect ) : void

The core of the Draw() method, where the rectangle actually gets painted. Vertical views use a rotated drawing routine.

GetAvailWidth ( ) : int

The width available for laying out a line of text, before subtracting margins. Normally this is the width of the pane, but for vertical alignment it is the height.

VerticalOrientationManager ( SimpleRootSite site ) : System

Constructor

비공개 메소드들

메소드 설명
ConvertKeyValue ( int keyValue ) : int

Convert arrow key codes so as to handle rotation (and line inversion). Enhance JohnT: possibly up/down inversion should be handled by the VwVerticalRootBox class, in which case, Up and Down results should be swapped here?

GetCoordRects ( Rectangle &rcSrcRoot, Rectangle &rcDstRoot ) : void

Construct coord transformation rectangles. Height and width are dots per inch (swapped for rotation); src origin is 0, dest origin is controlled by scrolling. A change in the y value of rcDstRoot origin will move the view left or right. A zero position of the scroll bar puts the 'bottom' at the right of the window. We want instead to put the 'top' at the left of the window for offset zero, and move it to the left as the offset increases. Passing an actual offset of 0 puts the bottom of the view at the right of the window. Adding the rootbox height puts the top just out of sight beyond the right edge; subtracting the client rectangle puts it in the proper zero-offset position with the top just at the left of the window. Further subtracting the scroll offset moves it further right, or 'up'.

RotatePointDstToPaint ( Point pt ) : Point

The specified point is in 'destination' coordinates. In a vertical view it requires rotation in the same way that the drawing code rotates the actual pixels drawn. This basically means that pt.Y is measured from the right of the window and pt.X is measured from the top. The result needs to be the same point in normal coordinates.

RotatePointPaintToDst ( Point pt ) : Point

The specified point is in 'paint' coordinates. In a vertical view it requires rotation reversing way that the drawing code rotates the actual pixels drawn to get 'destination' coordinates that the root box will interpret correctly. This basically converts a normal point to one where X is measured from the top of the client rectangle and Y from the right.

RotateRectDstToPaint ( Rectangle rect ) : Rectangle

The specified rectangle is in 'destination' coordinates. In a vertical view it requires rotation in the same way that the drawing code rotates the actual pixels drawn. This basically means that the input is a rectangle whose top and bottom are distances from the right of the window and whose left and right are measured from the top of the window. We need to convert it to one measured from the top left.

메소드 상세

DrawTheRoot() 공개 메소드

The core of the Draw() method, where the rectangle actually gets painted. Vertical views use a rotated drawing routine.
public DrawTheRoot ( IVwDrawRootBuffered vdrb, IVwRootBox rootb, IntPtr hdc, SIL drawRect, uint backColor, bool drawSel, Rectangle clipRect ) : void
vdrb IVwDrawRootBuffered
rootb IVwRootBox
hdc System.IntPtr
drawRect SIL
backColor uint
drawSel bool
clipRect System.Drawing.Rectangle
리턴 void

GetAvailWidth() 공개 메소드

The width available for laying out a line of text, before subtracting margins. Normally this is the width of the pane, but for vertical alignment it is the height.
public GetAvailWidth ( ) : int
리턴 int

VerticalOrientationManager() 공개 메소드

Constructor
public VerticalOrientationManager ( SimpleRootSite site ) : System
site SimpleRootSite
리턴 System