IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.

IG::Forms::WindowPositioner Class Reference

Takes care of windows positioning, relative of absolute to the screen and/or other windows. More...

Collaboration diagram for IG::Forms::WindowPositioner:

List of all members.

Public Member Functions

 WindowPositioner ()
 Constructs a new window positioner where the positioned and the master window are not yet defined.
 WindowPositioner (Form positionedWindow)
 Constructs a new window positioner with the specified window to be positioned and unspecified.
 WindowPositioner (Form positionedWindow, Form masterWindow)
 Constructs a new window positioner with the specified window to be positioned and the specified master window.
void PositionWindow ()
 Positions the positioned window according to the CalculatedPosition
void SetToCurrentPosition ()
 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.
void StickToMaster ()
 Sticks the positioned window to master window, if possible.
void UnStickFromMaster ()
 Stichs the positioned window to master window (), if possible.
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.
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.
virtual void InitScreenData ()
 Obtains the screen resolution etc. (if data hasen't been obtained yet), and sets the IsScreenDataInitialized property to true.
virtual void InitScreenDataForced ()
 Obtains the screen resolution etc., and sets the IsScreenDataInitialized property to true.

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.

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.
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.

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.
bool IsStickedToMaster [get, set]
 Whether or not the position window is sticked to the master window such that it follows its movement.
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. Positions are only remembered if sticking to master is also performed.
virtual vec2 ShiftAbsolute [get, set]
 Additional shift of positioned window in pixels. {0,0} means no shift, otherwise shift is in pixels and menas difference to otherwise calculated position.
virtual double MasterWeight [get, set]
 Relative weight (importance) of positioning relative to master window.
virtual double ScreenWeight [get, set]
 Relative weight (importance) of positioning relative to screen window.
virtual vec2 CalculatedPosition [get]
 Calculated position of the top-left corner of the positioned window.
virtual System.Windows.Forms.Form Window [get, set]
 Window to be positioned.
virtual Alignment WindowAlignment [get, set]
 Alignment of the positioned window with respect to point of positioning.
virtual vec2 WindowShiftRelative [get, set]
 Additional shift of positioned window relative to Window size.
virtual Rectangle WindowBounds [get]
 Bounds of the window to be positioned.
virtual vec2 WindowShift [get]
 calculated additional shift of the positioned window that depends on that window.
virtual System.Windows.Forms.Form MasterWindow [get, set]
 Master window relative to which positioning is calculated.
virtual Alignment MasterWindowAlignment [get, set]
 Alignment of the positioned window with respect to point of positioning.
vec2 MasterWindowShiftRelative [get, set]
 Additional shift of positioned window relative to Window size.
virtual Rectangle MasterWindowBounds [get]
 Bounds of the window to be positioned.
virtual vec2 MasterWindowShift [get]
 calculated additional shift of the positioned window that depends on that window.
virtual bool IsScreenDataInitialized [get, set]
 Whwtheer screen data has been obtained or not.
Rectangle ScreenBounds [get]
 Gets screen bounds.
Alignment ScreenAlignment [get, set]
vec2 ScreenShiftRelative [get, set]
 Additional shift of positioned window relative to screen size.
vec2 ScreenShift [get]
 calculated additional shift of the position window that is bound to screen.

Private Attributes

object _lock = new object()

Detailed Description

Takes care of windows positioning, relative of absolute to the screen and/or other windows.

$A Igor xx;


Constructor & Destructor Documentation

IG::Forms::WindowPositioner::WindowPositioner ( ) [inline]

Constructs a new window positioner where the positioned and the master window are not yet defined.

IG::Forms::WindowPositioner::WindowPositioner ( Form  positionedWindow) [inline]

Constructs a new window positioner with the specified window to be positioned and unspecified.

master window.

Parameters:
positionedWindowWindow to be positioned. Can be null.
masterWindowMaster window with respect to which the window is also positioned. Can be null.
IG::Forms::WindowPositioner::WindowPositioner ( Form  positionedWindow,
Form  masterWindow 
) [inline]

Constructs a new window positioner with the specified window to be positioned and the specified master window.

Parameters:
positionedWindowWindow to be positioned. Can be null.
masterWindowMaster window with respect to which the window is also positioned. Can be null.

Member Function Documentation

void IG::Forms::WindowPositioner::PositionWindow ( ) [inline]

Positions the positioned window according to the CalculatedPosition

void IG::Forms::WindowPositioner::SetToCurrentPosition ( ) [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.

void IG::Forms::WindowPositioner::StickEventHandler ( object  Sender,
EventArgs  args 
) [inline, protected]

This event handler is added to the master window so that its position and size changes can be tracked.

void IG::Forms::WindowPositioner::RememberPositionEventHandler ( object  Sender,
EventArgs  args 
) [inline, protected]

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.

void IG::Forms::WindowPositioner::StickToMaster ( ) [inline]

Sticks the positioned window to master window, if possible.

void IG::Forms::WindowPositioner::UnStickFromMaster ( ) [inline]

Stichs the positioned window to master window (), if possible.

void IG::Forms::WindowPositioner::RememberPosition ( ) [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.

void IG::Forms::WindowPositioner::StopRememberPosition ( ) [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.

virtual void IG::Forms::WindowPositioner::InitScreenData ( ) [inline, virtual]

Obtains the screen resolution etc. (if data hasen't been obtained yet), and sets the IsScreenDataInitialized property to true.

virtual void IG::Forms::WindowPositioner::InitScreenDataForced ( ) [inline, virtual]

Obtains the screen resolution etc., and sets the IsScreenDataInitialized property to true.


Member Data Documentation

object IG::Forms::WindowPositioner::_lock = new object() [private]
DateTime IG::Forms::WindowPositioner::_lastMoved = DateTime.Now [protected]

Minimal acceptable value for the pause between consecutive movement events that are processed in implementation of sticking window and remembering relative position.

System.Windows.Forms.Form IG::Forms::WindowPositioner::_window [protected]
Alignment IG::Forms::WindowPositioner::_windowAlignment = new Alignment(AlignmentHorizontal.Left, AlignmentVertical.Top) [protected]
System.Windows.Forms.Form IG::Forms::WindowPositioner::_masterWindow [protected]
Alignment IG::Forms::WindowPositioner::_masterWindowAlignment = new Alignment(AlignmentHorizontal.Left, AlignmentVertical.Top) [protected]
Alignment IG::Forms::WindowPositioner::_screenAlignment = new Alignment(AlignmentHorizontal.Left, AlignmentVertical.Top) [protected]

Property Documentation

object IG::Forms::WindowPositioner::Lock [get]
double IG::Forms::WindowPositioner::MovementPauseSeconds [get, set]

Minimal pause, in seconds, between two successive movements of the window due to sticking.

bool IG::Forms::WindowPositioner::IsStickedToMaster [get, set]

Whether or not the position window is sticked to the master window such that it follows its movement.

bool IG::Forms::WindowPositioner::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. Positions are only remembered if sticking to master is also performed.

virtual vec2 IG::Forms::WindowPositioner::ShiftAbsolute [get, set]

Additional shift of positioned window in pixels. {0,0} means no shift, otherwise shift is in pixels and menas difference to otherwise calculated position.

virtual double IG::Forms::WindowPositioner::MasterWeight [get, set]

Relative weight (importance) of positioning relative to master window.

virtual double IG::Forms::WindowPositioner::ScreenWeight [get, set]

Relative weight (importance) of positioning relative to screen window.

virtual vec2 IG::Forms::WindowPositioner::CalculatedPosition [get]

Calculated position of the top-left corner of the positioned window.

virtual System.Windows.Forms.Form IG::Forms::WindowPositioner::Window [get, set]

Window to be positioned.

virtual Alignment IG::Forms::WindowPositioner::WindowAlignment [get, set]

Alignment of the positioned window with respect to point of positioning.

virtual vec2 IG::Forms::WindowPositioner::WindowShiftRelative [get, set]

Additional shift of positioned window relative to Window size.

virtual Rectangle IG::Forms::WindowPositioner::WindowBounds [get]

Bounds of the window to be positioned.

virtual vec2 IG::Forms::WindowPositioner::WindowShift [get]

calculated additional shift of the positioned window that depends on that window.

virtual System.Windows.Forms.Form IG::Forms::WindowPositioner::MasterWindow [get, set]

Master window relative to which positioning is calculated.

virtual Alignment IG::Forms::WindowPositioner::MasterWindowAlignment [get, set]

Alignment of the positioned window with respect to point of positioning.

vec2 IG::Forms::WindowPositioner::MasterWindowShiftRelative [get, set]

Additional shift of positioned window relative to Window size.

virtual Rectangle IG::Forms::WindowPositioner::MasterWindowBounds [get]

Bounds of the window to be positioned.

virtual vec2 IG::Forms::WindowPositioner::MasterWindowShift [get]

calculated additional shift of the positioned window that depends on that window.

virtual bool IG::Forms::WindowPositioner::IsScreenDataInitialized [get, set, protected]

Whwtheer screen data has been obtained or not.

Rectangle IG::Forms::WindowPositioner::ScreenBounds [get]

Gets screen bounds.

Alignment IG::Forms::WindowPositioner::ScreenAlignment [get, set]
vec2 IG::Forms::WindowPositioner::ScreenShiftRelative [get, set]

Additional shift of positioned window relative to screen size.

vec2 IG::Forms::WindowPositioner::ScreenShift [get]

calculated additional shift of the position window that is bound to screen.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties Events