C# Класс SIL.FieldWorks.SharpViews.RootBox

Наследование: DivBox, IDisposable
Показать файл Открыть проект Примеры использования класса

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