IGLib
1.5
The IGLib base library for development of numerical, technical and business applications.
|
Takes care of windows positioning, relative of absolute to the screen and/or other windows. More...
Public Member Functions | |
WindowPositioner () | |
Constructs a new window positioner where the positioned and the master window are not yet defined. More... | |
WindowPositioner (Form positionedWindow) | |
Constructs a new window positioner with the specified window to be positioned and unspecified More... | |
WindowPositioner (Form positionedWindow, Form masterWindow) | |
Constructs a new window positioner with the specified window to be positioned and the specified master window. More... | |
void | PositionWindow () |
Positions the positioned window according to the CalculatedPosition More... | |
void | SetToCurrentPosition () |
Shanges the shift of window position such that it corresponds to actual current position of the window. More... | |
void | StickToMaster () |
Sticks the positioned window to master window, if possible. More... | |
void | UnStickFromMaster () |
Stichs the positioned window to master window (), if possible. More... | |
void | RememberPosition () |
Starts remembering potitions relative to the master window when the position is changed and this is not due to sticking to the master window. More... | |
void | StopRememberPosition () |
Stops remembering potitions relative to the master window when the position is changed and this is not due to sticking to the master window. More... | |
virtual void | InitScreenData () |
Obtains the screen resolution etc. (if data hasen't been obtained yet), and sets the IsScreenDataInitialized property to true. More... | |
virtual void | InitScreenDataForced () |
Obtains the screen resolution etc., and sets the IsScreenDataInitialized property to true. More... | |
Static Public Attributes | |
static double | MinimalMovementPauseSeconds = 0.001 |
Minimal acceptable value for the pause between consecutive movement events that are processed in implementation of sticking window and remembering relative position. More... | |
Protected Member Functions | |
void | StickEventHandler (object Sender, EventArgs args) |
This event handler is added to the master window so that its position and size changes can be tracked. More... | |
void | RememberPositionEventHandler (object Sender, EventArgs args) |
This event handler is added to the positioned window so that its position and size changes can be remembered when not caused by sticking to the master. More... | |
Protected Attributes | |
bool | _positionWindowExecuted = false |
DateTime | _lastMoved = DateTime.Now |
double | _movementPauseSeconds = 0.01 |
bool | _isStickedToMaster = false |
bool | _isRememberPosition = false |
vec2 | _shiftAbsolute = new vec2(0, 0) |
double | _masterWeight = 1.0 |
System.Windows.Forms.Form | _window |
Alignment | _windowAlignment = new Alignment(AlignmentHorizontal.Left, AlignmentVertical.Top) |
vec2 | _windowShiftRelative = new vec2(0, 0) |
System.Windows.Forms.Form | _masterWindow |
Alignment | _masterWindowAlignment = new Alignment(AlignmentHorizontal.Left, AlignmentVertical.Top) |
vec2 | _masterWindowShiftRelative = new vec2(0, 0) |
bool | _isScreenDataInitialized = false |
Rectangle | _screenBounds |
Alignment | _screenAlignment = new Alignment(AlignmentHorizontal.Left, AlignmentVertical.Top) |
vec2 | _screenShiftRelative = new vec2(0, 0) |
Properties | |
object | Lock [get] |
double | MovementPauseSeconds [get, set] |
Minimal pause, in seconds, between two successive movements of the window due to sticking. More... | |
bool | IsStickedToMaster [get, set] |
Whether or not the position window is sticked to the master window such that it follows its movement. More... | |
bool | IsRememberPosition [get, set] |
Whether or not relative position with respect to master is remembered when movement is not caused by sticking to the master window. More... | |
virtual vec2 | ShiftAbsolute [get, set] |
Additional shift of positioned window in pixels. More... | |
virtual double | MasterWeight [get, set] |
Relative weight (importance) of positioning relative to master window. More... | |
virtual double | ScreenWeight [get, set] |
Relative weight (importance) of positioning relative to screen window. More... | |
virtual vec2 | CalculatedPosition [get] |
Calculated position of the top-left corner of the positioned window. More... | |
virtual System.Windows.Forms.Form | Window [get, set] |
Window to be positioned. More... | |
virtual Alignment | WindowAlignment [get, set] |
Alignment of the positioned window with respect to point of positioning. More... | |
virtual vec2 | WindowShiftRelative [get, set] |
Additional shift of positioned window relative to Window size. More... | |
virtual Rectangle | WindowBounds [get] |
Bounds of the window to be positioned. More... | |
virtual vec2 | WindowShift [get] |
calculated additional shift of the positioned window that depends on that window. More... | |
virtual System.Windows.Forms.Form | MasterWindow [get, set] |
Master window relative to which positioning is calculated. More... | |
virtual Alignment | MasterWindowAlignment [get, set] |
Alignment of the positioned window with respect to point of positioning. More... | |
vec2 | MasterWindowShiftRelative [get, set] |
Additional shift of positioned window relative to Window size. More... | |
virtual Rectangle | MasterWindowBounds [get] |
Bounds of the window to be positioned. More... | |
virtual vec2 | MasterWindowShift [get] |
calculated additional shift of the positioned window that depends on that window. More... | |
virtual bool | IsScreenDataInitialized [get, set] |
Whwtheer screen data has been obtained or not. More... | |
Rectangle | ScreenBounds [get] |
Gets screen bounds. More... | |
Alignment | ScreenAlignment [get, set] |
vec2 | ScreenShiftRelative [get, set] |
Additional shift of positioned window relative to screen size. More... | |
vec2 | ScreenShift [get] |
calculated additional shift of the position window that is bound to screen. More... | |
Private Attributes | |
object | _lock = new object() |
Takes care of windows positioning, relative of absolute to the screen and/or other windows.
$A Igor xx;
|
inline |
Constructs a new window positioner where the positioned and the master window are not yet defined.
|
inline |
Constructs a new window positioner with the specified window to be positioned and unspecified
master window.
positionedWindow | Window to be positioned. Can be null. |
masterWindow | Master window with respect to which the window is also positioned. Can be null. |
|
inline |
Constructs a new window positioner with the specified window to be positioned and the specified master window.
positionedWindow | Window to be positioned. Can be null. |
masterWindow | Master window with respect to which the window is also positioned. Can be null. |
|
inline |
Positions the positioned window according to the CalculatedPosition
Referenced by IG.Gr3d.Graph3dManipulator.PositionInitializeEventHandler().
|
inline |
Shanges the shift of window position such that it corresponds to actual current position of the window.
This is usually used when user is allowed to adjust relative positinon to the master of a sticking window.
References IG.Num.vec2.x, and IG.Num.vec2.y.
|
inlineprotected |
This event handler is added to the master window so that its position and size changes can be tracked.
|
inlineprotected |
This event handler is added to the positioned window so that its position and size changes can be remembered when not caused by sticking to the master.
|
inline |
Sticks the positioned window to master window, if possible.
Referenced by IG.Gr3d.Graph3dManipulator.InitPositioner().
|
inline |
Stichs the positioned window to master window (), if possible.
|
inline |
Starts remembering potitions relative to the master window when the position is changed and this is not due to sticking to the master window.
Referenced by IG.Gr3d.Graph3dManipulator.InitPositioner().
|
inline |
Stops remembering potitions relative to the master window when the position is changed and this is not due to sticking to the master window.
|
inlinevirtual |
Obtains the screen resolution etc. (if data hasen't been obtained yet), and sets the IsScreenDataInitialized property to true.
|
inlinevirtual |
Obtains the screen resolution etc., and sets the IsScreenDataInitialized property to true.
|
private |
|
protected |
|
protected |
|
static |
Minimal acceptable value for the pause between consecutive movement events that are processed in implementation of sticking window and remembering relative position.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
get |
|
getset |
Minimal pause, in seconds, between two successive movements of the window due to sticking.
|
getset |
Whether or not the position window is sticked to the master window such that it follows its movement.
|
getset |
Whether or not relative position with respect to master is remembered when movement is not caused by sticking to the master window.
Positions are only remembered if sticking to master is also performed.
|
getset |
Additional shift of positioned window in pixels.
{0,0} means no shift, otherwise shift is in pixels and menas difference to otherwise calculated position.
Referenced by IG.Gr3d.Graph3dManipulator.InitPositioner().
|
getset |
Relative weight (importance) of positioning relative to master window.
Referenced by IG.Gr3d.Graph3dManipulator.InitPositioner().
|
getset |
Relative weight (importance) of positioning relative to screen window.
|
get |
Calculated position of the top-left corner of the positioned window.
|
getset |
Window to be positioned.
Referenced by IG.Gr3d.Graph3dManipulator.InitPositioner().
|
getset |
Alignment of the positioned window with respect to point of positioning.
Referenced by IG.Gr3d.Graph3dManipulator.InitPositioner().
|
getset |
Additional shift of positioned window relative to Window size.
Referenced by IG.Gr3d.Graph3dManipulator.InitPositioner().
|
get |
Bounds of the window to be positioned.
|
get |
calculated additional shift of the positioned window that depends on that window.
|
getset |
Master window relative to which positioning is calculated.
Referenced by IG.Gr3d.Graph3dManipulator.InitPositioner().
|
getset |
Alignment of the positioned window with respect to point of positioning.
Referenced by IG.Gr3d.Graph3dManipulator.InitPositioner().
|
getset |
Additional shift of positioned window relative to Window size.
Referenced by IG.Gr3d.Graph3dManipulator.InitPositioner().
|
get |
Bounds of the window to be positioned.
|
get |
calculated additional shift of the positioned window that depends on that window.
|
getsetprotected |
Whwtheer screen data has been obtained or not.
|
get |
Gets screen bounds.
|
getset |
|
getset |
Additional shift of positioned window relative to screen size.
|
get |
calculated additional shift of the position window that is bound to screen.