C# 클래스 SIL.FieldWorks.SharpViews.RootBox

상속: DivBox, IDisposable
파일 보기 프로젝트 열기: sillsdev/FieldWorks 1 사용 예제들

Private Properties

프로퍼티 타입 설명
CanApplyStyle bool
Dispose void
ExtendSelection void
ExtendSelection void
GetBuilder ViewBuilder
RaiseLazyExpanded void
RaiseSizeChanged void
Relayout bool
ResumePaint void
SuspendPaint void

공개 메소드들

메소드 설명
CanCopy ( ) : bool
CanCut ( ) : bool
CanDelete ( ) : bool

Checks whether the Selection can be deleted

CanPaste ( ) : bool
ChildTransformFromRootTransform ( PaintTransform rootTransform ) : PaintTransform

Since this IS the root, by definition the root transform is its transform.

Dispose ( ) : void
FlashInsertionPoint ( ) : void

Call this ever half second or so to make the insertion point (if any) flash.

Layout ( LayoutInfo transform ) : void
OnApplyStyle ( string style ) : void

Changes the style of the Selection to the chosen style

OnDelete ( ) : void

If the Selection is an Insertion Point the character following the Selection will be removed If the Selection is a Ranged Selection the entire Selection will be removed

OnDoubleClick ( EventArgs e ) : void
OnDragDrop ( DragEventArgs drgevent, Point location, IVwGraphics vg, PaintTransform ptrans ) : void

Implement dragging to this view.

OnDragEnter ( DragEventArgs drgevent, Point location, IVwGraphics vg, PaintTransform ptrans ) : void

Returns information about possible drops with these arguments.

OnDragLeave ( ) : void

Called when drag leaves this control.

OnEditCopy ( ) : void
OnEditCut ( ) : void
OnEditPaste ( ) : void
OnMouseClick ( MouseEventArgs e, Keys keys, IVwGraphics vg, PaintTransform ptrans ) : void

Places an insertion point within a ranged selection, only if the mouse down occured within the selection. OnMouseDown takes care of all other situations.

OnMouseDown ( MouseEventArgs e, Keys keys, IVwGraphics vg, PaintTransform ptrans ) : void

Places an insertion point unless it would be placed within a ranged selection. Also determines sets whether the mouse down occured within a ranged selection, so that OnMouseMove can know if it can drag and so that OnMouseClick can know if can place an insertion point within the ranged selection.

OnMouseMove ( MouseEventArgs e, Keys keys, IVwGraphics vg, PaintTransform ptrans ) : void

Allows for text to be selected and dragged. This method starts the drag instead of OnMouseDown because once the drag is started, OnMouseClick/DoubleClick is overridden. OnMouseDown would start the drag too early.

OnQueryContinueDrag ( System.Windows.Forms.QueryContinueDragEventArgs e ) : void

Despite the method name (chosen to match the method of Control which it implements), our main reason for implementing this is to be notified when the drop takes place and, if it is a move, delete the original.

Paint ( IVwGraphics vg, PaintTransform ptrans ) : void

The root box handles the overall paint.

RootBox ( AssembledStyles styles ) : System
ScrollToShowSelection ( IVwGraphics vg, PaintTransform ptrans, Rectangle targetRect, int &dx, int &dy ) : void

Determine how far we need to scroll to make the current selection visible within the target rectangle (typically the clientRect of the view). Currently the goal is - if the selection is entirely within the rectangle return 0,0 (don't move) - otherwise if possible move the smallest distance that will put the selection at least 10 pixels inside the rectangle on both sides - if that is not possible move the smallest distance that will put the selection entirely inside the rectangle - if that is not possible move so that the primary rectangle of the IP at the DragEnd of the selection is inside the rectangle, at the top if it is the start and at the bottom if it is at the end. - if it is not possible to display even the primary rectangle of one IP, move so that equal amounts of it are above and below the rectangle. Eventually when we do horizontal scrolling the two directions will be independent. For example, even if we must move vertically, don't move horizontally to get the 10 pixel margin unless we must to see it at all.

비공개 메소드들

메소드 설명
CanApplyStyle ( string style ) : bool

Checks whether a Selection's style can be changed

Dispose ( bool beforeDestructor ) : void
ExtendSelection ( MouseEventArgs e, bool makeRange, IVwGraphics vg, PaintTransform ptrans ) : void

This is basically the common logic of MouseDown and MouseMove, when the left mouse button is pressed. If makeRange is true, as for shift-click or mouse move, we try to move the drag end of a range; otherwise, we make the selection where it is.

ExtendSelection ( Selection sel, bool makeRange ) : void
GetBuilder ( GroupBox destination ) : ViewBuilder

Answer a viewbuilder for adding stuff to the specified box. Subclasses may wish to return a subclass of ViewBuilder.

RaiseLazyExpanded ( LazyExpandedEventArgs args ) : void
RaiseSizeChanged ( ) : void
Relayout ( LayoutInfo transform, Rectangle>.Dictionary fixupMap, LayoutCallbacks lcb ) : bool

Overriden since, if our old Height is zero, the base method will assume the box is new and does not need invalidate, since it's container will figure its new area. But the root has no container, so we handle this special case here.

ResumePaint ( ) : void
SuspendPaint ( LayoutCallbacks layoutCallbacks ) : void

메소드 상세

CanCopy() 공개 메소드

public CanCopy ( ) : bool
리턴 bool

CanCut() 공개 메소드

public CanCut ( ) : bool
리턴 bool

CanDelete() 공개 메소드

Checks whether the Selection can be deleted
public CanDelete ( ) : bool
리턴 bool

CanPaste() 공개 메소드

public CanPaste ( ) : bool
리턴 bool

ChildTransformFromRootTransform() 공개 메소드

Since this IS the root, by definition the root transform is its transform.
public ChildTransformFromRootTransform ( PaintTransform rootTransform ) : PaintTransform
rootTransform PaintTransform
리턴 PaintTransform

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

FlashInsertionPoint() 공개 메소드

Call this ever half second or so to make the insertion point (if any) flash.
public FlashInsertionPoint ( ) : void
리턴 void

Layout() 공개 메소드

public Layout ( LayoutInfo transform ) : void
transform LayoutInfo
리턴 void

OnApplyStyle() 공개 메소드

Changes the style of the Selection to the chosen style
public OnApplyStyle ( string style ) : void
style string
리턴 void

OnDelete() 공개 메소드

If the Selection is an Insertion Point the character following the Selection will be removed If the Selection is a Ranged Selection the entire Selection will be removed
public OnDelete ( ) : void
리턴 void

OnDoubleClick() 공개 메소드

public OnDoubleClick ( EventArgs e ) : void
e System.EventArgs
리턴 void

OnDragDrop() 공개 메소드

Implement dragging to this view.
public OnDragDrop ( DragEventArgs drgevent, Point location, IVwGraphics vg, PaintTransform ptrans ) : void
drgevent System.Windows.Forms.DragEventArgs
location Point
vg IVwGraphics
ptrans PaintTransform
리턴 void

OnDragEnter() 공개 메소드

Returns information about possible drops with these arguments.
public OnDragEnter ( DragEventArgs drgevent, Point location, IVwGraphics vg, PaintTransform ptrans ) : void
drgevent System.Windows.Forms.DragEventArgs
location Point
vg IVwGraphics
ptrans PaintTransform
리턴 void

OnDragLeave() 공개 메소드

Called when drag leaves this control.
public OnDragLeave ( ) : void
리턴 void

OnEditCopy() 공개 메소드

public OnEditCopy ( ) : void
리턴 void

OnEditCut() 공개 메소드

public OnEditCut ( ) : void
리턴 void

OnEditPaste() 공개 메소드

public OnEditPaste ( ) : void
리턴 void

OnMouseClick() 공개 메소드

Places an insertion point within a ranged selection, only if the mouse down occured within the selection. OnMouseDown takes care of all other situations.
public OnMouseClick ( MouseEventArgs e, Keys keys, IVwGraphics vg, PaintTransform ptrans ) : void
e MouseEventArgs
keys Keys
vg IVwGraphics
ptrans PaintTransform
리턴 void

OnMouseDown() 공개 메소드

Places an insertion point unless it would be placed within a ranged selection. Also determines sets whether the mouse down occured within a ranged selection, so that OnMouseMove can know if it can drag and so that OnMouseClick can know if can place an insertion point within the ranged selection.
public OnMouseDown ( MouseEventArgs e, Keys keys, IVwGraphics vg, PaintTransform ptrans ) : void
e MouseEventArgs
keys Keys
vg IVwGraphics
ptrans PaintTransform
리턴 void

OnMouseMove() 공개 메소드

Allows for text to be selected and dragged. This method starts the drag instead of OnMouseDown because once the drag is started, OnMouseClick/DoubleClick is overridden. OnMouseDown would start the drag too early.
public OnMouseMove ( MouseEventArgs e, Keys keys, IVwGraphics vg, PaintTransform ptrans ) : void
e MouseEventArgs
keys Keys
vg IVwGraphics
ptrans PaintTransform
리턴 void

OnQueryContinueDrag() 공개 메소드

Despite the method name (chosen to match the method of Control which it implements), our main reason for implementing this is to be notified when the drop takes place and, if it is a move, delete the original.
public OnQueryContinueDrag ( System.Windows.Forms.QueryContinueDragEventArgs e ) : void
e System.Windows.Forms.QueryContinueDragEventArgs
리턴 void

Paint() 공개 메소드

The root box handles the overall paint.
public Paint ( IVwGraphics vg, PaintTransform ptrans ) : void
vg IVwGraphics
ptrans PaintTransform
리턴 void

RootBox() 공개 메소드

public RootBox ( AssembledStyles styles ) : System
styles AssembledStyles
리턴 System

ScrollToShowSelection() 공개 메소드

Determine how far we need to scroll to make the current selection visible within the target rectangle (typically the clientRect of the view). Currently the goal is - if the selection is entirely within the rectangle return 0,0 (don't move) - otherwise if possible move the smallest distance that will put the selection at least 10 pixels inside the rectangle on both sides - if that is not possible move the smallest distance that will put the selection entirely inside the rectangle - if that is not possible move so that the primary rectangle of the IP at the DragEnd of the selection is inside the rectangle, at the top if it is the start and at the bottom if it is at the end. - if it is not possible to display even the primary rectangle of one IP, move so that equal amounts of it are above and below the rectangle. Eventually when we do horizontal scrolling the two directions will be independent. For example, even if we must move vertically, don't move horizontally to get the 10 pixel margin unless we must to see it at all.
public ScrollToShowSelection ( IVwGraphics vg, PaintTransform ptrans, Rectangle targetRect, int &dx, int &dy ) : void
vg IVwGraphics
ptrans PaintTransform
targetRect System.Drawing.Rectangle
dx int
dy int
리턴 void