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

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Properties | Private Attributes | List of all members
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:
[legend]

## 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()

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

  positionedWindow | Window to be positioned. Can be null.
  masterWindow | Master 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

  positionedWindow | Window to be positioned. Can be null.
  masterWindow | Master 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

Referenced by IG.Gr3d.Graph3dManipulator.PositionInitializeEventHandler().

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.

References IG.Num.vec2.x, and IG.Num.vec2.y.

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.

Referenced by IG.Gr3d.Graph3dManipulator.InitPositioner().

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.

Referenced by IG.Gr3d.Graph3dManipulator.InitPositioner().

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

bool IG.Forms.WindowPositioner._positionWindowExecuted = false
| protected

DateTime IG.Forms.WindowPositioner._lastMoved = DateTime.Now
| protected

double IG.Forms.WindowPositioner.MinimalMovementPauseSeconds = 0.001
| static

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

double IG.Forms.WindowPositioner._movementPauseSeconds = 0.01
| protected

bool IG.Forms.WindowPositioner._isStickedToMaster = false
| protected

bool IG.Forms.WindowPositioner._isRememberPosition = false
| protected

vec2 IG.Forms.WindowPositioner._shiftAbsolute = new vec2(0, 0)
| protected

double IG.Forms.WindowPositioner._masterWeight = 1.0
| protected

System.Windows.Forms.Form IG.Forms.WindowPositioner._window
| protected

Alignment IG.Forms.WindowPositioner._windowAlignment = new Alignment(AlignmentHorizontal.Left, AlignmentVertical.Top)
| protected

vec2 IG.Forms.WindowPositioner._windowShiftRelative = new vec2(0, 0)
| protected

System.Windows.Forms.Form IG.Forms.WindowPositioner._masterWindow
| protected

Alignment IG.Forms.WindowPositioner._masterWindowAlignment = new Alignment(AlignmentHorizontal.Left, AlignmentVertical.Top)
| protected

vec2 IG.Forms.WindowPositioner._masterWindowShiftRelative = new vec2(0, 0)
| protected

bool IG.Forms.WindowPositioner._isScreenDataInitialized = false
| protected

Rectangle IG.Forms.WindowPositioner._screenBounds
| protected

Alignment IG.Forms.WindowPositioner._screenAlignment = new Alignment(AlignmentHorizontal.Left, AlignmentVertical.Top)
| protected

vec2 IG.Forms.WindowPositioner._screenShiftRelative = new vec2(0, 0)
| 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.

Referenced by IG.Gr3d.Graph3dManipulator.InitPositioner().

virtual double IG.Forms.WindowPositioner.MasterWeight
| get set

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

Referenced by IG.Gr3d.Graph3dManipulator.InitPositioner().

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.

Referenced by IG.Gr3d.Graph3dManipulator.InitPositioner().

virtual Alignment IG.Forms.WindowPositioner.WindowAlignment
| get set

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

Referenced by IG.Gr3d.Graph3dManipulator.InitPositioner().

virtual vec2 IG.Forms.WindowPositioner.WindowShiftRelative
| get set

Additional shift of positioned window relative to Window size.

Referenced by IG.Gr3d.Graph3dManipulator.InitPositioner().

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.

Referenced by IG.Gr3d.Graph3dManipulator.InitPositioner().

virtual Alignment IG.Forms.WindowPositioner.MasterWindowAlignment
| get set

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

Referenced by IG.Gr3d.Graph3dManipulator.InitPositioner().

vec2 IG.Forms.WindowPositioner.MasterWindowShiftRelative
| get set

Additional shift of positioned window relative to Window size.

Referenced by IG.Gr3d.Graph3dManipulator.InitPositioner().

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:

- igforms/Utilities/WindowPositioner/WindowPositioner.cs