Product Description

Upgrade your MFC interface

DLGSTRETCHV21 Library

Version 2.1

The DLGSTRETCHV21 library is a library that enables you to dynamically modify the size of Dialog Boxes and FormViews in an application written in C++ with the Microsoft MFC library.

DLGSTRETCHV21 library comes with full documentation and a sample program to explain each functionality.

The DLGSTRETCHV21 library is available for all WIN32 applications (Windows 95, 98, NT, 2000, Me, XP).

The DLGSTRETCHV21 library can be integrated into your application as a dynamic (DLL) or a static (LIB) library in Windows or UNICODE based applications.


Key Features

  • Automatic control resize and position

DLGSTRETCHV21 automatically resizes and moves every registered control according to its behavior. There are 22 main control behaviors and more than 30 slave control behaviors available, which covers all stretch needs.

  • Restore last window size and position

DLGSTRETCHV21 automatically registers the position and size of a window in the Registry database. Then, when Dialog boxes, FormViews, PropertySheets or Wizards are loaded, DLGSTRETCHV21 sets the last size and position used.

  • Automatic restore best size

DLGSTRETCHV21 allows you to reset a Dialog box back to its default size (as designed in resource file) or a View to its best size (the size without scrollbars nor stretching) by programming or through a virtual key. By default the F9 virtual key sets the default size window. The current virtual key can be changed and stay active for all of the application's windows.

  • Automatic restore center position

DLGSTRETCHV21 allows you to center a Dialog box to its parent window or a View to its MainFrame using a virtual key (you can continue using the CenterWindow() method to center it by program). By default the F8 virtual key centers the window. The current virtual key can be changed and stay active for all of the application's windows.

  • Automatic full size for PropertyPages

DLGSTRETCHV21 automatically stretches each PropertyPage to the maximize size allowed by the PropertySheet. Automatic align allows you to save time and obtain better results.

· FormViews management :

DLGSTRETCHV21 allows you to stretch FormViews.

FormView smaller than original size (as in resource file) are scrollable (default behaviour), FormViews bigger than original size are stretches as dialog boxes.

  • Multiple window management

If a window is often loaded several times (e.g. Modeless dialog boxes) DLGSTRETCHV21 remembers each position and restores each one at the right size and position.

  • Dynamic control management

DLGSTRETCHV21 allows you to dynamically create, move and resize controls at the right position even if the window has already been stretched. Total control of stretch variables is possible while stretching occurs.


Product Presentation

The DLGSTRETCHV21 library can be integrated into your application as a dynamic (DLL) or a static (LIB) library in 32 bits Windows or UNICODE based applications.

Library Naming conventions

The base name is DLGSTRETCHV21 and all library names are suffixed with the letters "U" for UNICODE, "S" for static libraries, "S2" for static libraries linked to MFC static libraries and "D" for debug versions as follows:

Application | Dynamic Library | Static Library (S) | Static MFC Library (2S) | Release Version | Debug Version (D)
Windows Based | DLGSTRETCHV21 |  |  | DLGSTRETCHV21 | DLGSTRETCHV21D
 |  | DLGSTRETCHV21S |  | DLGSTRETCHV21S | DLGSTRETCHV21SD
 |  |  | DLGSTRETCHV21S2 | DLGSTRETCHV21S2 | DLGSTRETCHV21S2D
UNICODE (U) | DLGSTRETCHV21U |  |  | DLGSTRETCHV21U | DLGSTRETCHV21UD
 |  | DLGSTRETCHV21US |  | DLGSTRETCHV21US | DLGSTRETCHV21USD
 |  |  | DLGSTRETCHV2US2 | DLGSTRETCHV21US2 | DLGSTRETCHV21US2D

The DLGSTRETCHV21 library is composed of a set of 8 General Functions, a Stretch Engine CStretch and 6 MFC derived classes.

General functions :

· BOOL RemoveStretchRegistry( );

· void SetRegistrySubKey(CString & sKey);

· void GetRegistrySubKey(CString & sKey);

· unsigned short SetDefaultSizeVirtualKey(unsigned short DefaultSizeVirtualKey);

· unsigned short GetDefaultSizeVirtualKey( );

· unsigned short SetCenterWindowVirtualKey(unsigned short CenterWindowVirtualKey);

· unsigned short GetCenterWindowVirtualKey( );

MFC classes :

  • CDialogStretch : public CDialog
  • CPropertySheetStretch : public CPropertySheet
  • CPropertyPageStretch : public CPropertyPage
  • CFrameWndStretch : public CFrameWnd
  • CMDIChildWndStretch : public CMDIChildWnd
  • CFormViewStretch : public CFormView

The Stretch Engine is embedded in each one of those MFC classes.

The libraries released have been compiled and linked with MFC42 library version.


Product Organization

The setup program configures the product organization as follows:

DLGSTRETCH base directory

Include files : dlgstretchv21.h, dlgstretchv21.rc and stretch.h

Resource files : stretch.bmp

Binary files : *.DLL and *.PDB

Library files : *.LIB

Documentation in CHM format

Source files *.cpp and *.h

Dynamic link library (DLGSTRETCHV21D.DLL) linked with MFC42D.DLL debug version

Dynamic link library (DLGSTRETCHV21.DLL) linked with MFC42.DLL release version

UNICODE dynamic link library (DLGSTRETCHV21UD.DLL) linked with MFC42UD.DLL debug version

UNICODE dynamic link library (DLGSTRETCHV21U.DLL) linked with MFC42U.DLL release version

Static link library (DLGSTRETCHV21SD.LIB) linked with MFC42D.DLL debug version

Static link library (DLGSTRETCHV21S.LIB) linked with MFC42.DLL release version

UNICODE static link library (DLGSTRETCHV21USD.LIB) linked with MFC42UD.DLL debug version

UNICODE static link library (DLGSTRETCHV21US.LIB) linked with MFC42U.DLL release version

Static link library (DLGSTRETCHV21S2D.LIB) linked statically with NAFXCWD.LIB debug version

Static link library (DLGSTRETCHV21S2.LIB) linked statically with NAFXCW.LIB release version

UNICODE static link library (DLGSTRETCHV21US2D.LIB) linked statically with UAFXCWD.LIB debug

UNICODE static link library (DLGSTRETCHV21US2.LIB) linked statically with UAFXCW.LIB release

Sample program source files

Sample program resources files

Sample program linked with DLGSTRETCHV21D.DLL and MFC42D.DLL debug version

Sample program linked with DLGSTRETCHV21D.DLL and MFC42.DLL release version

UNICODE sample program linked with DLGSTRETCHV21UD.DLL and MFC42UD.DLL debug version

UNICODE sample program linked with DLGSTRETCHV21U.DLL and MFC42U.DLL release version

Sample program linked with DLGSTRETCHV21SD.LIB and MFC42D.DLL debug version

Sample program linked with DLGSTRETCHV21S.LIB and MFC42.DLL release version

UNICODE sample program linked with DLGSTRETCHV21USD.LIB and MFC42UD.DLL debug version

UNICODE sample program linked with DLGSTRETCHV21SD.LIB and MFC42U.DLL release version

Sample program linked with DLGSTRETCHV21S2D.LIB and NAFXCWD.LIB debug version

Sample program linked with DLGSTRETCHV21S2.LIB and NAFXCW.LIB release version

UNICODE sample program linked with DLGSTRETCHV21US2D.LIB and UAFXCWD.LIB debug version

UNICODE sample program linked with DLGSTRETCHV21US2.LIB and UAFXCW.LIB release version

To use the library, the next steps must be accomplished:

  1. Add the include path ..\DLGSTRETCHV21\INC into the MSVC Include files list,

  2. Add the library path ..\DLGSTRETCHV21\LIB into the MSVC Library files list and

  3. Add the binary path ..\DLGSTRETCH\BIN into the Path environment variable


Compile Flags

DLGSTRETCHV21 automatically links to an application when the dlgstretchv21.h file is included in header files.

To dynamically link with DLGSTRETCHV21 or customize the link procedure, the next 5 compile flags are available:

Flag | Remarks
_STRETCHDLL | Used for dynamic link with DLGSTRETCHV21
_STRETCHNOAUTOLIB | Disable automatic link (static and dynamic)
_STRETCH_CUSTOMAUTOLINK | Disable default automatic link
_STRETCHLIBNAME | Define the name of a custom library
_STRETCHNOMSG | Disable the automatic link message at compile time

If you wish to link dynamically, the compile flag _STRETCHDLL must be declared. To link statically, no flags are required.

Defining the flag _STRETCHNOAUTOLIB when compiling, disables the automatic link (static and dynamic) with DLGSTRETCHV21. An application that declares that flag would explicitly declare a library at link time.

If you implement your own custom automatic link, declare the flag _STRETCH_CUSTOMAUTOLINK and define the _STRETCHLIBNAME directive with the name of that library.


The Class Architecture

The DLGSTRETCHV21 Default Class Architecture

The default class architecture allows you to directly derive your classes from the DLGSTRETCHV21 classes available.

The full sources are delivered so you can create your own class architecture. To do that you can copy the DLGSTRETCHV21 derived classes and modify the base class name to generate a custom static library.

If you modify the source code you must create a static library, dynamic libraries should not be modified.

The Custom Class Architecture


Customize DLGSTRETCHV21

Classes Derivation

The file dlgstretchv21.h must be included in each Dialog box or FormView derived from DLGSTRETCHV21 library. The stretch.h is only necessary for custom derivation of the 6 stretch classes.

If you modify the source code you must create a static library, dynamic libraries should not be modified.


8 steps to upgrade your interface

To allow your windows to benefit from the DLGSTRETCHV21 library, just follow the next 8 steps :

  1. Add the dlgstretchv21.H file to your header files

  2. If you link statically, add the dlgstretchv21.rc file to your RC file

  3. Derive your classes from DLGSTRETCHV21 objects.

  4. If the object is a Dialog box, add the dialog resize style.

  5. Add the ability to access run-time class name information. In order to do so, insert the macro DECLARE_DYNAMIC(CCustomClass) in the header file CustomClass.h and insert the macro IMPLEMENT_DYNAMIC(CCustomClass, CStretchBaseClass) in the implementation file CustomClass.cpp. DLGSTRETCHV21 ‘s debug version will assert if it has not been done.

6. Declare each control behavior. Overloading the OnInitDialog( ) or the OnInitialUpdate( ) methods depend on whether the object is a Dialog box, PropertySheet, Wizard or a FormView. Then declare each control with a particular behavior. Each control can only be registered once. You can combine four independent (horizontal, vertical, resize and move) behaviors. Any control which does not move nor resize does not need to be declared.

BOOL CDlgListLanguage::OnInitDialog()

 {

  CDlgStretch::OnInitDialog();

    // Declare control's behavior here

AddCtlBehavior(IDC_BTN,SBMOVEX);// Add control behavior

  ...

  LoadLayoutFromRegistry();       // Reload Dialog size

  LoadPositionFromRegistry();     // Reload Dialog position

  return TRUE;  // return TRUE unless you set the focus to a control

                // EXCEPTION: OCX Property Pages should return FALSE

 }

  7. Reload the last size and position. For CDialogStretch and CPropertySheetStretch derived classes, after the control behavior declarations, reload the window's last size and position. Loading the last position is optional.

BOOL CDlgListLanguage::OnInitDialog()

 {

 CDlgStretch::OnInitDialog();

  // Declare some control's behavior here

AddCtlBehavior(IDC_BTN,SBMOVEX);// Add control behavior

  ...

LoadLayoutFromRegistry();       // Reload Dialog layout

LoadPositionFromRegistry();     // Optional reload Dialog position

  return TRUE; // return TRUE unless you set the focus to a control

               // EXCEPTION: OCX Property Pages should return FALSE

}

Assign FormView's default or best size. For CFormViewStretch derived classes, after the control behavior declarations, call the SetOriginalSize( ) method to set the view to its best size (that is the size without scrollbars nor stretching), or the SetDefaultSize() method to correctly set the view to its default size.


Linking with DLGSTRETCHV21

Dynamic link

To link dynamically with DLGSTRETCHV21 declares the special compile flag _STRETCHDLL and DLGSTRETCHV21 will automatically link to the appropriate library.

See also : Compile Flags.

Static link

To link statically, no flags are required. DLGSTRETCHV21 automatically links to the appropriate library.

The dlgstretchv2.rc file must be included in the application's RC file.

That file adds the gripper bitmap "stretch.bmp" located in the DLGSTRETCH\INC\RES directory into your resources.

See also : Compile Flags.


The DLGSTRETCHV21 library is composed of a set 6 MFC derived classes.

  • CDialogStretch : public CDialog
  • CPropertySheetStretch : public CPropertySheet
  • CPropertyPageStretch : public CPropertyPage
  • CFrameWndStretch : public CFrameWnd
  • CMDIChildWndStretch : public CMDIChildWnd
  • CFormViewStretch : public CFormView


CDialogStretch : CDialog Class

Remarks

The CDialogStretch class must have the resizing style to support stretching.

The Members

void LoadPositionFromRegistry( );

Loads last Dialog position from Registry database

void LoadLayoutFromRegistry( );

Loads last Dialog size from Registry database

Void AddCtlBehavior(int Ctl,WORD BehaviorStyle,int CtlMaster=0);

Adds a control behavior to the Dialog Stretch Engine

BOOL RemoveCtl(int Ctl);

Removes the control from the Dialog Stretch Engine. This method does not remove the window control.

HWND GetOriginalWindowRectCtl(int Ctl, LPRECT prcWin);

Gets original control rectangle as it was loaded from the resource file.

void MoveCtl(const int Ctl,CSize & szSize);

Offsets the original control position and updates its position according to its behavior

void ResizeCtl(const int Ctl,CSize & szSize);

Offsets the original control size and updates its size according to its behavior

void GetOriginalWindowRect(LPRECT prcSize);

Gets original dialog rectangle as it was loaded from the resource file

void SetOriginalSize(BOOL UpdateWindow = FALSE);

Sets the Dialog to its original size as it was loaded from the resource file

void GetDeltaSize(CSize & Delta);

Gets the size difference between original and current dialog size.

void ShowGripper(BOOL bShowGripper);

Shows or hides the gripper

BOOL GetShowGripper( );

Gets gripper visibility


CPropertySheetStretch : CPropertySheet Class

Remarks

The CPropertySheetStretch class have controls stretch capabilities. All members of this class refer to that class it-self. the resizing window style is added dynamically.

Wizards have the same members and capabilities than PropertySheets.

In non wizard mode, the CPropertySheetStretch declares the AFX_IDC_TAB_CONTROL CTabCtrl control and the IDOK, IDCANCEL, ID_APPLY_NOW and IDHELP standard buttons. Those buttons are created by the MFC base class and are hidden for modeless PropertySheet dialogs.

In wizard mode, the CPropertySheetStretch object declares the ID_WIZNEXT, ID_WIZFINISH, ID_WIZBACK and IDCANCEL standard buttons.

Both declarations are valid for modal and non modal modes.

If you delete a declared control, you must call the RemoveCtl(int Ctl) method. If you add a control as the IDHELP button for wizard help, then register that control with the AddCtlBehavior(IDHELP,SBMOVEXY) method.

Modal PropertySheetStretch

To create a modal CPropertySheetStretch just follow the next 2 steps:

1. Load the last dialog size

Call the LoadLayoutFromRegistry( ) method at the end of the OnInitDialog( ) to reload dialog layout.

2. Load the last dialog position

Call the LoadPositionFromRegistry( ) method at the end of the OnInitDialog( ) to reload the last position (optional).

Modeless PropertySheetStretch

To create a modeless CPropertySheetStretch follow the next steps:

1. Change the original size of the CPropertySheet object

Call the method ChangeOriginalSize(rcWnd,TRUE) at the begin of the OnInitDialog( ) to increase the original size of the sheet to free some space for buttons

if ( IsModeless( ) )

{

CRect rcWnd; // Resize to place buttons

GetWindowRect(rcWnd);

rcWnd.bottom = rcWnd.bottom + 2*BUTTON_SPACE + BUTTON_HEIGHT;

ChangeOriginalSize(rcWnd,TRUE); //Resize the sheet to make place for the bottom buttons

…

2. Load the last dialog size

Call the LoadLayoutFromRegistry( ) method at the end of the OnInitDialog( ) to reload dialog layout.

3. Load the last dialog position

Call the LoadPositionFromRegistry( ) method at the end of the OnInitDialog( ) to reload the last position (optional).

The Members

void LoadPositionFromRegistry( );

Loads last PropertySheet position from Registry database

void LoadLayoutFromRegistry( );

Loads last PropertySheet size from Registry database

Void AddCtlBehavior(int Ctl,WORD BehaviorStyle,int CtlMaster=0);

Adds a control behavior to the PropertySheet Stretch Engine

void MoveCtl(const int Ctl,CSize & szSize);

Removes the control from the PropertySheet Stretch Engine. This method does not remove the window control.

HWND GetOriginalWindowRectCtl(int Ctl, LPRECT prcWin);

Gets original control rectangle as loaded from the resource file.

void MoveCtl(const int Ctl,CSize & szSize);

Offsets the original control position and updates its position according to its behavior

void ResizeCtl(const int Ctl,CSize & szSize);

Offsets the original control size and updates its size according to its behavior

void GetOriginalWindowRect(LPRECT prcSize);

Gets original PropertySheet rectangle as it was loaded from the resource file

void SetOriginalSize(BOOL UpdateWindow = FALSE);

Sets the PropertySheet to its original size as it was loaded from the resource file

void GetDeltaSize(CSize & Delta);

Gets the size difference between original and current PropertySheet size.

void ShowGripper(BOOL bShowGripper);

Shows or hides the Gripper

BOOL GetShowGripper( );

Gets gripper visibility

void GetPageSize(CSize & szPage,CPropertyPage * pPropertyPage);

Calculates Sheet or Wizard active page size

void ChangeOriginalSize(CRect & rcNewSize,BOOL bUpdateWindow=FALSE);

Resizes and assign new original PropertySheet size.


CPropertyPageStretch : CPropertyPage Class

Remarks

The CPropertyPageStretch class members refers only to the controls inside that class it-self. No resize style must be added to the window class in the resource file.

The CPropertyPageStretch class does not register size nor position in the Registry database, only the CPropertySheetStretch owner saves the layout.

The CPropertyPageStretch class does not load the last registered size nor position, the CPropertySheetStretch owner does it for all pages.

The CPropertyPageStretch class does not have any gripper to show stretch capabilities. The gripper is only showed by the owner PropertySheetStretch.

The Members

Void AddCtlBehavior(int Ctl,WORD BehaviorStyle,int CtlMaster=0);

Adds a control behavior to the PropertyPage Stretch Engine

BOOL RemoveCtl(int Ctl);

Removes the control from the PropertyPage Stretch Engine. This method does not remove the window control.

HWND GetOriginalWindowRectCtl(int Ctl, LPRECT prcWin);

Gets original control rectangle as loaded from the resource file.

void MoveCtl(const int Ctl,CSize & szSize);

Offsets the original control position and updates its position according to its behavior

void ResizeCtl(const int Ctl,CSize & szSize);

Offset the original control size and updates its size according to its behavior


CFrameWndStretch : CFrameWndStretch Class

Remarks

The CFrameWndStretch class refers to the frame that contains a FormView in a SDI application. That class does not have stretch capabilities for own controls. The members implemented refers directly to the owned FormView.

The resize and center virtual key does not work in a SDI model.

The Members

void GetOriginalWindowRect(LPRECT prcSize);

Gets original FormView rectangle as it was loaded from the resource file

void GetDeltaSize(CSize & Delta);

Gets the size difference between original and current FormView size.


CMDIChildWndStretch : CMDIChildWnd Class

Remarks

The CMDIChildWndStretch class refers to the Frame that contains a FormView in a MDI application. That Frame does not have stretch capabilities for its own controls. The members implemented refers directly to the owned FormView.

The Members

void GetOriginalWindowRect(LPRECT prcSize);

Gets original FormView rectangle as it was loaded from the resource file

void SetOriginalSize(BOOL UpdateWindow = FALSE);

Sets the FormView to its original size as it was loaded from the resource file and adjusts the owner Frame according to the FormView size. The original FormView size is also the best size that is without scrollbars nor stretching

void GetDeltaSize(CSize & Delta);

Get the size difference between original and current FormView size.


CFormViewStretch : CFormView Class

Remarks

The CFormViewStretch supports all functionalities as the CDialogStretch class. The CFormViewStretch combine the standard CFormView behavior with the DLGSTRETCHV21 capabilities. If the original FormView size, as loaded from resource file, is smaller than the current frame, then scrollbars appears. If the original FormView size is higher than the current frame, then DLGSTRETCHV21 stretches and moves controls inside.

The FormView isn't automatically center nor resized when it's loaded. The user must, at the end of the OnInitialUpdate() function, either call the SetOriginalSize( ) method to set the view to its best size (that is the size without scrollbars nor stretching), or the SetDefaultSize() method to correctly set the view to its default size.

Neither the old layout nor the old position can be loaded for a CFormView class.

In a MDI model the resize and center virtual keys work as for all windows while in a SDI model the resize and center virtual key does not work.

The resize virtual key (by default the F9 virtual key) and the SetOriginalSize( ) method can be used set the view to the best size, that is the size without scrollbars nor stretching.

The Members

Void AddCtlBehavior(int Ctl,WORD BehaviorStyle,int CtlMaster=0);

Adds a control behavior to the FormView Stretch Engine

BOOL RemoveCtl(int Ctl);

Removes the control from the FormView Stretch Engine. This method does not remove the window control.

HWND GetOriginalWindowRectCtl(int Ctl, LPRECT prcWin);

Gets original control rectangle as loaded from the resource file.

void MoveCtl(const int Ctl,CSize & szSize);

Offsets the original control position and updates its position according to its behavior

void ResizeCtl(const int Ctl,CSize & szSize);

Offsets the original control size and updates its size according to its behavior

void GetOriginalWindowRect(LPRECT prcSize);

Gets original FormView rectangle as it was loaded from the resource file

void GetDeltaSize(CSize & Delta);

Gets the size difference between original and current FormView size.

Void SetOriginalSize( )

Set the optimal view size. Must be called at the end of OnInitialUpdate()

void SetDefaultSize();

Set the default view size. Must be called at the end of OnInitialUpdate()


Methods

The methods of all 6 MFC derived classes are listed below. Each method reference notifies the classes to which it applies.

void LoadPositionFromRegistry( );

Loads last Dialog position from Registry database

void LoadLayoutFromRegistry( );

Loads last Dialog size from Registry database

Void AddCtlBehavior(int Ctl,WORD BehaviorStyle,int CtlMaster=0);

Adds a control behavior to the Dialog Stretch Engine

BOOL RemoveCtl(int Ctl);

Removes the control from the Dialog Stretch Engine. This method does not remove the window control.

CWnd * GetOriginalWindowRectCtl(int Ctl, LPRECT prcWin);

Gets original control rectangle as it was loaded from the resource file.

void MoveCtl(const int Ctl,CSize & szSize);

Offsets the original control position and updates its position according to its behavior

void ResizeCtl(const int Ctl,CSize & szSize);

Offsets the original control size and updates its size according to its behavior

void GetOriginalWindowRect(LPRECT prcSize);

Gets original dialog rectangle as it was loaded from the resource file

void SetOriginalSize(BOOL UpdateWindow = FALSE);

Sets the Dialog to its original size as it was loaded from the resource file

void GetDeltaSize(CSize & Delta);

Gets the size difference between original and current dialog size.

void ShowGripper(BOOL bShowGripper);

Shows or hides the gripper

BOOL GetShowGripper();

Gets gripper visibility
int GetCountBehavior();

Gets the number of control behavior that has been added


LoadPositionFromRegistry

void LoadPositionFromRegistry( );

Remarks

Loads the last window position from the Registry database. If no register is found, the window is loaded back to its default position.

The use of this function is optional.

Applies to: CDialogStretch and CPropertySheetStretch


LoadLayoutFromRegistry

void LoadLayoutFromRegistry();

Remarks

Loads the last window size from Registry database. If no register is found, the window is loaded back to its default size.

Applies to: CDialogStretch and CPropertySheetStretch


ShowGripper

void ShowGripper(BOOL bShowGripper);

Parameters

bShowGripper

New visibility state for the gripper. Specifies whether the gripper should be visible. If this parameter is TRUE, the gripper will be showed. If this parameter is FALSE, the gripper will be hidden.

Remarks

Shows or hides the gripper placed on the dialog's bottom-right corner.

DLGSTRETCHV21 allows users to stretch dialog boxes from any border or from a gripper placed on the bottom-right corner of the dialog. If you link to a DLGSTRETCHV21 static version, add the dlgstretchv21.rc file into your resource file. That file add the gripper bitmap "stretch.bmp" located in the DLGSTRETCH\INC\RES directory into your resources.

See also : GetShowGripper

Applies to: CDialogStretch and CPropertySheetStretch


GetShowGripper

BOOL GetShowGripper();

Return Value

Nonzero if the gripper is visible. Otherwise 0.

Remarks

Gets the current visibility state of the gripper.

See also : ShowGripper

Applies to: CDialogStretch and CPropertySheetStretch


AddCtlBehavior

void AddCtlBehavior(int Ctl,WORD BehaviorStyle,int CtlMaster=0);

Parameters

Ctl

Specifies the ID control to be register.

BehaviorStyle

Specifies the behavior of the control as a combination of the next values :

Elementary style | Description
SBMOVEX | Horizontal move.
SBMOVEY | Vertical move.
SBSIZEX | Horizontal resize.
SBSIZEY | Vertical resize.
SBSLAVE | Move attached to a master control which has one of the next behaviors : SBMOVEX_SIZEX, SBMOVEXY_SIZEX, SBMOVEX_SIZEXBIS, SBMOVEXY_SIZEXBIS, SBMOVEX_SIZEXY, SBMOVEX_SIZEXYBIS , SBMOVEY_SIZEY, SBMOVEXY_SIZEY, SBMOVEY_SIZEYBIS, SBMOVEXY_SIZEYBIS, SBMOVEY_SIZEXY , SBMOVEY_SIZEXYBIS, SBMOVEXY_SIZEXY and SBMOVEXY_SIZEXYBIS
SBBIS | Twice operator of SBMOVEX_SIZEX, SBMOVEX_SIZEXY, SBMOVEY_SIZEY, SBMOVEY_SIZEXY and SBMOVEXY_SIZEXY behaviors.
SBDLGMOVEX | Modify a slave behavior (used only with SBSLAVE). The control moves horizontally along the dialog box not according to the master control.
SBDLGMOVEY | Modify a slave behavior (used only with SBSLAVE). The control moves vertically along the dialog box not according to the master control.
SBDLGSIZEX | Modify a slave behavior (used only with SBSLAVE). The control resizes horizontally along the dialog box not according to the master control.
SBDLGSIZEY | Modify a slave behavior (used only with SBSLAVE). The control resizes vertically along the dialog box not according to the master control.

Elementary behaviors

There is a set of 18 behaviors available :

 | Extended style | Composition | Description
1 | SBMOVEX |  | Horizontal move.
2 | SBMOVEY |  | Vertical move.
3 | SBSIZEX |  | Horizontal resize.
4 | SBSIZEY |  | Vertical resize.
5 | SBMOVEXY | SBMOVEX | SBMOVEY | Vertical and horizontal move.
6 | SBSIZEXY | SBSIZEX | SBSIZEY | Vertical and horizontal resize.
7 | SBMOVEX_SIZEX | SBMOVEX | SBSIZEX | Horizontal move AND horizontal proportional resize.
8 | SBMOVEX_SIZEXBIS | SBMOVEX_SIZEX | SBBIS | Same as SBMOVEX_SIZEX but in another group. Horizontal move AND horizontal proportional resize (second group).
9 | SBMOVEX_SIZEY | SBMOVEX | SBSIZEY | Horizontal move AND vertical resize.
10 | SBMOVEX_SIZEXY | SBMOVEX | SBSIZEXY | Horizontal move AND horizontal and vertical proportional resize.
11 | SBMOVEX_SIZEXYBIS | SBMOVEX_SIZEXY | SBBIS | Same as SBMOVEX_SIZEXY but in another group. Horizontal move AND horizontal and vertical proportional resize (second group).
12 | SBMOVEY_SIZEX | SBMOVEY | SBSIZEX | Vertical move AND horizontal resize.
13 | SBMOVEY_SIZEY | SBMOVEY | SBSIZEY | Vertical move AND vertical proportional resize.
14 | SBMOVEY_SIZEYBIS | SBMOVEY_SIZEY | SBBIS | Same as SBMOVEY_SIZEY but in another group. Vertical move AND vertical proportional resize (second group).
15 | SBMOVEY_SIZEXY | SBMOVEY | SBSIZEXY | Vertical move AND vertical and horizontal proportional resize.
16 | SBMOVEY_SIZEXYBIS | SBMOVEY_SIZEXY | SBBIS | Same as SBMOVEY_SIZEXYbut in another group. Vertical move AND vertical and horizontal proportional resize (second group).
17 | SBMOVEXY_SIZEX | SBMOVEY | SBMOVEX | SBSIZEX | Vertical and horizontal move AND horizontal proportional resize.
18 | SBMOVEXY_SIZEY | SBMOVEX | SBMOVEY | SBSIZEY | Vertical and horizontal move AND vertical proportional resize.
19 | SBMOVEXY_SIZEXY | SBMOVEXY | SBSIZEXY | Vertical and horizontal move AND vertical and horizontal proportional resize.
20 | SBMOVEXY_SIZEXBIS | SBMOVEY | SBMOVEX | SBSIZEX | SBBIS | Same as SBMOVEXY_SIZEX but in another group. Vertical and horizontal move AND horizontal proportional resize. (second group).
21 | SBMOVEXY_SIZEYBIS | SBMOVEX | SBMOVEY | SBSIZEY | SBBIS | Same as SBMOVEXY_SIZEY but in another group. Vertical and horizontal move AND vertical proportional resize. (second group).
22 | SBMOVEXY_SIZEXYBIS | SBMOVEXY_SIZEXY | SBBIS | Same as SBMOVEXY_SIZEXY but in another group. Vertical and horizontal move AND vertical and horizontal proportional resize (second group).

The 22 available behaviors

 | Extended style | Composition | Description
1 | SBSLAVEX | SBSLAVE | SBMOVEX | Horizontal move following a master control.
2 | SBSLAVEY | SBSLAVE | SBMOVEY | Vertical move following a master control.
3 | SBSLAVEXY | SBSLAVE | SBMOVEXY | Horizontal and vertical move following a master control.
4 | SBSLAVEX_SIZEX | SBSLAVE | SBMOVEX | SBSIZEX | Horizontal resize and horizontal move following a master control.
5 | SBSLAVEX_SIZEY | SBSLAVE | SBMOVEX | SBSIZEY | Vertical resize and horizontal move following a master control.
6 | SBSLAVEX_SIZEXY | SBSLAVE | SBMOVEX | SBSIZEXY | Vertical and horizontal resize and horizontal move following a master control.
7 | SBSLAVEY_SIZEX | SBSLAVE | SBMOVEY | SBSIZEX | Horizontal resize and vertical move following a master control.
8 | SBSLAVEY_SIZEY | SBSLAVE | SBMOVEY | SBSIZEY | Vertical resize and vertical move following a master control.
9 | SBSLAVEY_SIZEXY | SBSLAVE | SBMOVEY | SBSIZEXY | Vertical and horizontal resize and vertical move following a master control.
10 | SBSLAVEXY_SIZEXY | SBSLAVE | SBMOVEXY | SBSIZEXY | Horizontal and vertical resize and vertical and horizontal move following a master control.
11 | SBSLAVEDLGXY | SBSLAVE | SBMOVEY | SBDLGMOVEX | Horizontal move according to the owner window and vertical move according to a Master control
12 | SBSLAVEXDLGY | SBSLAVE | SBMOVEX | SBDLGMOVEY | Horizontal move according to a Master control and vertical move according to the owner window
13 | SBSLAVEDLGX_SIZEX | SBSLAVE | SBSIZEX | SBDLGMOVEX | Horizontal move according to the owner window and horizontal resize according to a Master control
14 | SBSLAVEDLGX_SIZEY | SBSLAVE | SBSIZEY | SBDLGMOVEX | Horizontal move according to the owner window and vertical resize according to a Master control
15 | SBSLAVEDLGX_SIZEXY | SBSLAVE | SBSIZEXY | SBDLGMOVEX | Horizontal move according to the owner window and vertical and horizontal resize according to a Master control
16 | SBSLAVEDLGY_SIZEX | SBSLAVE | SBSIZEX | SBDLGMOVEY | Vertical move according to the owner window and horizontal resize according to a Master control
17 | SBSLAVEDLGY_SIZEY | SBSLAVE | SBSIZEY | SBDLGMOVEY | Vertical move according to the owner window and vertical resize according to a Master control
18 | SBSLAVEDLGY_SIZEXY | SBSLAVE | SBSIZEXY | SBDLGMOVEY | Vertical move according to the owner window and vertical and horizontal resize according to a Master control
19 | SBSLAVEDLGXY_SIZEXY | SBSLAVE | SBMOVEY | SBSIZEXY | SBDLGMOVEX | Horizontal move according to the owner window, vertical move and horizontal and vertical resize according to a Master control
20 | SBSLAVEXDLGY_SIZEXY | SBSLAVE | SBMOVEX | SBSIZEXY | SBDLGMOVEY | Vertical move according to the owner window, horizontal move and horizontal and vertical resize according to a Master control
21 | SBSLAVEX_SIZEDLGX | SBSLAVE | SBMOVEX | SBDLGSIZEX | Horizontal move according to a Master control and horizontal resize according to the owner window
22 | SBSLAVEX_SIZEDLGY | SBSLAVE | SBMOVEX | SBDLGSIZEY | Horizontal move according to a Master control and vertical resize according to the owner window
23 | SBSLAVEX_SIZEDLGXY | SBSLAVE | SBMOVEX | SBSIZEY | SBDLGSIZEX | Horizontal move and vertical resize according to a Master control and horizontal resize according to the owner window
24 | SBSLAVEX_SIZEXDLGY | SBSLAVE | SBMOVEX | SBSIZEX | SBDLGSIZEY | Horizontal move and resize according to a Master control and vertical resize according to the owner window
25 | SBSLAVEY_SIZEDLGX | SBSLAVE | SBMOVEY | SBDLGSIZEX | Vertical move according to a Master control and horizontal resize according to the owner window
26 | SBSLAVEY_SIZEDLGY | SBSLAVE | SBMOVEY | SBDLGSIZEY | Vertical move according to a Master control and vertical resize according to the owner window
27 | SBSLAVEY_SIZEDLGXY | SBSLAVE | SBMOVEY | SBSIZEY | SBDLGSIZEX | Vertical move and resize according to a Master control and horizontal resize according to the owner window
28 | SBSLAVEY_SIZEXDLGY | SBSLAVE | SBMOVEY | SBSIZEX | SBDLGSIZEY | Vertical move and horizontal resize according to a Master control and vertical resize according to the owner window
29 | SBSLAVEXY_SIZEDLGXY | SBSLAVE | SBMOVEXY | SBSIZEY | SBDLGSIZEX | Vertical resize and Horizontal and vertical move according to a Master control with horizontal resize according to the owner window
30 | SBSLAVEXY_SIZEXDLGY | SBSLAVE | SBMOVEXY | SBSIZEX | SBDLGSIZEY | Horizontal resize and Horizontal and vertical move according to a Master control with horizontal resize according to the owner window

The 30 Predefined control slave behaviors

CtlMaster

Specifies the ID master control if the SBSLAVE behavior is set.

Remarks

Adds a control behavior to the Stretch Engine.

Each control can only be registered once with one of the 18 main behaviors or with any combination of slave behaviors. Each possibility combines all full independent (horizontal, vertical, resize and move) behaviors.

If a master control does not have the moving request (for example is if it does not move in X axis and the slave is attached to its X displacement) the behavior attached to is ignored.

See also : The Behavior Types

Applies to: CDialogStretch, CPropertySheetStretch, CPropertyPageStretch and CFormViewStretch


RemoveCtl

void RemoveCtl(int Ctl);

Ctl

Specifies the ID control to be remove.

Remarks

Removes the control from the Stretch Engine. This method does not remove the window control.

Applies to: CDialogStretch, CPropertySheetStretch, CPropertyPageStretch and CFormViewStretch


GetOriginalWindowRectCtl

HWND GetOriginalWindowRectCtl(int Ctl, LPRECT prcWin);

Return Value

A HWND handle of the control. This method return NULL if the control is unknown by the Stretch Engine.

Ctl

Specifies the ID control to be removed.

prcWin

Points to a RECT structure or a CRect object to receive the original control rectangle.

Remarks

Retrieves the original window rectangle as it was loaded from the resource file.

Applies to : CDialogStretch, CPropertySheetStretch, CPropertyPageStretch and CFormViewStretch


MoveCtl

void MoveCtl(const int Ctl,CSize & szSize);

Ctl

Specifies the ID control to be move.

szSize

References a CSize object specifying both dimensions by which to move.

Remarks

Move the control to the right and to the bottom. The control will move to its original coordinates as it was loaded from the resource file.

Applies to : CDialogStretch, CPropertySheetStretch, CPropertyPageStretch and CFormViewStretch


ResizeCtl

void ResizeCtl(const int Ctl,CSize & szSize);

Ctl

Specifies the ID control to be move.

szSize

References a CSize object specifying both dimensions by which to resize.

Remarks

Resizes the control to the right and to the bottom. The control will be resized according to its original coordinates as it was loaded from resource file.

Applies to : CDialogStretch, CPropertySheetStretch, CPropertyPageStretch and CFormViewStretch


GetOriginalWindowRect

Void GetOriginalWindowRect(LPRECT prcWin);

prcWin

Points to a RECT structure or a CRect object to receive the original window (Dialog or View) rectangle.

Remarks

Retrieves the original window rectangle as it was loaded from the resource file.

Applies to : CDialogStretch, CPropertySheetStretch, CFrameWndStretch, and CMDIChildWndStretch


SetOriginalSize

Void SetOriginalSize(BOOL UpdateWindow = FALSE);

bUpdateWindow

Specifies whether the window must to be updated. If TRUE the function UpdateWindow( ) is invoked.

Remarks

Sets the window to his original size as it was loaded from the resource file. The window will not move.

A FormView isn't automatically center nor resized when it's loaded. The user must, at the end of the OnInitialUpdate() function, either call the SetOriginalSize() method to set the view to its best size (that is the size without scrollbars nor stretching), or call the SetDefaultSize() method to correctly set the view to its default size.

Applies to : CDialogStretch, CPropertySheetStretch, CMDIChildWndStretch and CFormViewStretch


SetDefaultSize

void SetDefaultSize();

Remarks

Sets the window to his default size as it was loaded from the framework.

A FormView isn't automatically center nor resized when it's loaded. The user must, at the end of the OnInitialUpdate() function, either call the SetOriginalSize( ) method to set the view to its best size (that is the size without scrollbars nor stretching), or call the SetDefaultSize() method to correctly set the view to its default size.

Applies to : CFormViewStretch


GetDeltaSize

Void GetDeltaSize(CSize & Delta);

Delta

A CSize to receive the size difference between original and current dialog size.

Remarks

Gets the size difference between original and current dialog size.

Applies to: CDialogStretch, CPropertySheetStretch, CFrameWndStretch, CMDIChildWndStretch and CFormViewStretch


GetPageSize

void GetPageSize(CSize & szPage,CPropertyPage * pPropertyPage);

szPage

Reference to a Size object to recover the page size.

pPropertyPage

A pointer to the active page.

Remarks

Gets Sheet or Wizard active page size

Applies to : CPropertySheetStretch


ChangeOriginalSize

void ChangeOriginalSize(CRect & rcNewSize,BOOL bUpdateWindow=FALSE);

rcNewSize

Reference to a Size object to recover the page size.

bUpdateWindow

If TRUE the function change the window's size.

Remarks

Changes the original PropertySheet size as if it were loaded from the resource file. This function is useful to add buttons in a modeless PropertySheet dialog box.

Applies to: CPropertySheetStretch


GetShowGripper

GetCountBehavior

int GetCountBehavior();

Return Value

The number of control behavior that has been added.

Remarks

Gets the number of control behavior that has been added.

See also : AddCtlBehavior function.

Applies to: CDialogStretch and CPropertySheetStretch


General Functions

The general functions are "c" functions and aren't attached to any object.

BOOL RemoveStretchRegistry();

Delete all Registry database entries storing dialog's layout setting for this application

void SetRegistrySubKey(CString & sKey);

Modifies the default subkey Registry database

void GetRegistrySubKey(CString & sKey);

Retrieves the Registry database subkey used to save the dialog layout

unsigned short SetDefaultSizeVirtualKey(unsigned short DefaultSizeVirtualKey);

Assigns new virtual-key for default size window

unsigned short GetDefaultSizeVirtualKey();

Loads last FormView position from Registry database and adjusts the owner Frame according to the FormView position.

unsigned short SetCenterWindowVirtualKey(unsigned short CenterWindowVirtualKey);

Assigns new virtual-key for center window

unsigned short GetCenterWindowVirtualKey();

Retrieves current virtual-key for center window


RemoveStretchRegistry

BOOL RemoveStretchRegistry();

Return Value

Non zero if succeeds.

Remarks

Deletes all Registry database entries storing dialog's layout setting for this application.

See also : LoadPositionFromRegistry and LoadLayoutFromRegistry functions.


SetRegistrySubKey

void SetRegistrySubKey(CString & sKey);

Parameters

sKey

Registry database subkey used to save the window layout.

Remarks

Modifies the default subkey Registry database.

The current size and position of windows are saved into the Registry database and retrieved in next sessions.

The window layout is saved into the Registry database that describes the user profile for the user who is currently logged to the local computer : HKEY_CURRENT_USER.

The subkey by default is "Settings\Stretch". So the window layout data is stored in :

Software\AfxGetApp()->m_pszRegistryKey\AfxGetApp()->m_pszProfileName\Settings\Stretch\DialogClassName

The window width, height and position are saved into the value names : Width, Height, PosX and PosY.

The use of this function is optional.

See also : G etRegistrySubKey function.


GetRegistrySubKey

void GetRegistrySubKey(CString & sKey);

Parameters

sKey

Registry database subkey used to save the window layout.

Remarks

Retrieves the Registry database subkey used to save the dialog layout.

See also : SetRegistrySubKey function.


SetDefaultSizeVirtualKey

unsigned short SetDefaultSizeVirtualKey(unsigned short DefaultSizeVirtualKey);

Return Value

Old virtual-key for default size.

Parameters

DefaultSizeVirtualKey

New virtual-key for default size.

Remarks

Assigns new virtual-key for default size window.

It's possible to reset a window to its default size (as designed in resource file) by program or using a virtual key. By default the F9 virtual key sets the default size window. The current virtual key is active for all windows per application.

See also : G etDefaultSizeVirtualKey function.


GetDefaultSizeVirtualKey

unsigned short GetDefaultSizeVirtualKey();

Return Value

Current virtual-key for default size window.

Remarks

Retrieves current virtual-key for default size

See also : SetDefaultSizeVirtualKey function.


SetCenterWindowVirtualKey

unsigned short SetCenterWindowVirtualKey(unsigned short CenterWindowVirtualKey);

Return Value

Old virtual-key for center window.

Parameters

CenterWindowVirtualKey

New virtual-key for center window.

Remarks

Assigns new virtual-key for center window.

It's possible to center a window to its parent using a virtual key. By default the F8 virtual key center a window. The current virtual key is active for all windows per application.

See also : GetCenterWindowVirtualKey function.


GetCenterWindowVirtualKey

unsigned short GetCenterWindowVirtualKey();

Return Value

Virtual-key for center window.

Remarks

Retrieves current virtual-key for center window

See also : SetCenterWindowVirtualKey function.


The Behavior Types

Each control can only be registered with one of 32 behaviors (22 main and 10 slave). The 32 possibilities combine all four independent (horizontal, vertical, resize and move) behaviors.

A control which does not move nor resize doesn't need to be registered.

 | Extended style | Composition | Description
1 | SBMOVEX |  | Horizontal move.
2 | SBMOVEY |  | Vertical move.
3 | SBSIZEX |  | Horizontal resize.
4 | SBSIZEY |  | Vertical resize.
5 | SBMOVEXY | SBMOVEX | SBMOVEY | Vertical and horizontal move.
6 | SBSIZEXY | SBSIZEX | SBSIZEY | Vertical and horizontal resize.
7 | SBMOVEX_SIZEX | SBMOVEX | SBSIZEX | Horizontal move AND horizontal proportional resize.
8 | SBMOVEX_SIZEXBIS | SBMOVEX_SIZEX | SBBIS | Same as SBMOVEX_SIZEX but in another group. Horizontal move AND horizontal proportional resize (second group).
9 | SBMOVEX_SIZEY | SBMOVEX | SBSIZEY | Horizontal move AND vertical resize.
10 | SBMOVEX_SIZEXY | SBMOVEX | SBSIZEXY | Horizontal move AND horizontal and vertical proportional resize.
11 | SBMOVEX_SIZEXYBIS | SBMOVEX_SIZEXY | SBBIS | Same as SBMOVEX_SIZEXY but in another group. Horizontal move AND horizontal and vertical proportional resize (second group).
12 | SBMOVEY_SIZEX | SBMOVEY | SBSIZEX | Vertical move AND horizontal resize.
13 | SBMOVEY_SIZEY | SBMOVEY | SBSIZEY | Vertical move AND vertical proportional resize.
14 | SBMOVEY_SIZEYBIS | SBMOVEY_SIZEY | SBBIS | Same as SBMOVEY_SIZEY but in another group. Vertical move AND vertical proportional resize (second group).
15 | SBMOVEY_SIZEXY | SBMOVEY | SBSIZEXY | Vertical move AND vertical and horizontal proportional resize.
16 | SBMOVEY_SIZEXYBIS | SBMOVEY_SIZEXY | SBBIS | Same as SBMOVEY_SIZEXYbut in another group. Vertical move AND vertical and horizontal proportional resize (second group).
17 | SBMOVEXY_SIZEX | SBMOVEY | SBMOVEX | SBSIZEX | Vertical and horizontal move AND horizontal proportional resize.
18 | SBMOVEXY_SIZEY | SBMOVEX | SBMOVEY | SBSIZEY | Vertical and horizontal move AND vertical proportional resize.
19 | SBMOVEXY_SIZEXY | SBMOVEXY | SBSIZEXY | Vertical and horizontal move AND vertical and horizontal proportional resize.
20 | SBMOVEXY_SIZEXBIS | SBMOVEY | SBMOVEX | SBSIZEX | SBBIS | Same as SBMOVEXY_SIZEX but in another group. Vertical and horizontal move AND horizontal proportional resize. (second group).
21 | SBMOVEXY_SIZEYBIS | SBMOVEX | SBMOVEY | SBSIZEY | SBBIS | Same as SBMOVEXY_SIZEY but in another group. Vertical and horizontal move AND vertical proportional resize. (second group).
22 | SBMOVEXY_SIZEXYBIS | SBMOVEXY_SIZEXY | SBBIS | Same as SBMOVEXY_SIZEXY but in another group. Vertical and horizontal move AND vertical and horizontal proportional resize (second group).

The Main behaviors

 | Extended style | Composition | Description
1 | SBSLAVEX | SBSLAVE | SBMOVEX | Horizontal move following a master control.
2 | SBSLAVEY | SBSLAVE | SBMOVEY | Vertical move following a master control.
3 | SBSLAVEXY | SBSLAVE | SBMOVEXY | Horizontal and vertical move following a master control.
4 | SBSLAVEX_SIZEX | SBSLAVE | SBMOVEX | SBSIZEX | Horizontal resize and horizontal move following a master control.
5 | SBSLAVEX_SIZEY | SBSLAVE | SBMOVEX | SBSIZEY | Vertical resize and horizontal move following a master control.
6 | SBSLAVEX_SIZEXY | SBSLAVE | SBMOVEX | SBSIZEXY | Vertical and horizontal resize and horizontal move following a master control.
7 | SBSLAVEY_SIZEX | SBSLAVE | SBMOVEY | SBSIZEX | Horizontal resize and vertical move following a master control.
8 | SBSLAVEY_SIZEY | SBSLAVE | SBMOVEY | SBSIZEY | Vertical resize and vertical move following a master control.
9 | SBSLAVEY_SIZEXY | SBSLAVE | SBMOVEY | SBSIZEXY | Vertical and horizontal resize and vertical move following a master control.
10 | SBSLAVEXY_SIZEXY | SBSLAVE | SBMOVEXY | SBSIZEXY | Horizontal and vertical resize and vertical and horizontal move following a master control.

The slave behaviors

See also : AddCtlBehavior function.


Behavior : SBMOVEX

Remarks

The control will keep the same distance from the dialog's right hand side.

Example:

Before

After

See also : AddCtlBehavior function.


Behavior : SBMOVEY

Remarks

The control will keep the same distance from the dialog's bottom border.

Example:

Before

After

See also : AddCtlBehavior function.


Behavior : SBSIZEX

Remarks

The control will be resized horizontally according to the window.

Example:

Before

After

See also : AddCtlBehavior function.


Behavior : SBSIZEY

Remarks

The control will be resized vertically according to the window.

Example:

Before

After

See also : AddCtlBehavior function.


Behavior : SBMOVEXY

Remarks

The control will keep the same distance from the dialog’s bottom-right hand borders.

Example:

Before

After

See also : AddCtlBehavior function.


Behavior : SBSIZEXY

Remarks

The control will be resized according to the window.

Example:

Before

After

See also : AddCtlBehavior function.


Behavior : SBMOVEXY_SIZEX

Remarks

The control will be moved vertically and horizontally and resized only horizontally to share the horizontal "stretching space".

Controls with this behavior can't be embedded. If an embedded control must have this same behavior, use the SBMOVEXY_SIZEXBIS behavior for the embedded control.

Example:

Before

After

See also : AddCtlBehavior function.


Behavior : SBMOVEXY_SIZEY

Remarks

The control will be moved vertically and horizontally and resized only vertically to share the vertical "stretching space".

Controls with this behavior can't be embedded. If an embedded control must have this same behavior, use the SBMOVEXY_SIZEYBIS behavior for the embedded control.

Example:

Before

After

See also : AddCtlBehavior function.


Behavior : SBMOVEXY_SIZEXBIS

Remarks

The control will be moved vertically and horizontally and resized only horizontally to share the horizontal "stretching space".

Same as SBMOVEXY_SIZEX behavior but controls with this behavior share another "stretching space". Use this behavior if you embed a control into another control with the same SBMOVEXY_SIZEX behavior.

Example:

Before

After

See also : AddCtlBehavior function.


Behavior : SBMOVEXY_SIZEYBIS

Remarks

The control will be moved vertically and horizontally and resized only vertically to share the vertical "stretching space".

Same as SBMOVEXY_SIZEY behavior but controls with this behavior share another "stretching space". Use this behavior if you embed a control into another control with the same SBMOVEXY_SIZEY behavior.

Example:

Before

After

See also : AddCtlBehavior function.


Behavior : SBMOVEX_SIZEX

Remarks

The control will be moved and resized horizontally to share the horizontal "stretching space".

All controls will be resized proportionally of “DeltaHorizontal / NumberOfControls”.

Controls are sought from the left to the right. The far left control does not move; the second control will move to the right of “DeltaHorizontal / NumberOfControls” units; the third control will move of ”2*(DeltaHorizontal / NumberOfControls)” units and so forth.

Controls with this behavior can't be embedded. If an embedded control must have this same behavior, use the SBMOVEX_SIZEXBIS behavior for the embedded control.

Example:

Before

After

See also : AddCtlBehavior function.


Behavior : SBMOVEX_SIZEXBIS

Remarks

Same as SBMOVEX_SIZEX behavior but controls with this behavior share another "stretching space". Use this behavior if you embed a control into another control with the same SBMOVEX_SIZEX behavior.

Example:

Before

After

See also : AddCtlBehavior function.


Behavior : SBMOVEX_SIZEY

Remarks

The control will keep the same distance from the dialog’s right hand side and will be resized vertically according to the window height.

Sample:

Before

After

See also : AddCtlBehavior function.


Behavior : SBMOVEX_SIZEXY

Remarks

The control will be moved and resized horizontally to share the horizontal "stretching space". The control will be also resized vertically to keep the same distance from the window’s bottom border.

All controls with this behavior are resized according to “DeltaHorizontal/ NumberOfControls”.

Controls are sought from the left to the right. The far left control does not move; the second control from the left will move to the right of “DeltaHorizontal / NumberOfControls” units; the third control will move of “2*(DeltaHorizontal / NumberOfControls)” units and so forth.

Controls with this behavior can't be embedded. If an embedded control must have this same behavior, use the SBMOVEX_SIZEXYBIS behavior for the embedded control.

Example:

Before

After

See also : AddCtlBehavior function.


Behavior : SBMOVEX_SIZEXYBIS

Remarks

Same as SBMOVEY_SIZEXY behavior but controls with this behavior share another "stretching space". Use this behavior if you embed a control into another control with the same SBMOVEY_SIZEXY behavior.

Example:

Before

After

See also : AddCtlBehavior function.


Behavior : SBMOVEY_SIZEX

Remarks

The control will keep the same distance from the dialog's bottom border and will be resized horizontally according to the window width.

Example:

Before

After

See also : AddCtlBehavior function.


Behavior : SBMOVEY_SIZEY

Remarks

The control will be moved and resized vertically to share the horizontal "stretching space".

All controls will be resized according to DeltaVertical / NumberOfControls”.

Controls are sought from the top to the bottom. The upper control does not move; the second control from the top will move towards the bottom of “DeltaVertical / NumberOfControls” units; the third control will move of ”2*(DeltaVertical / NumberOfControls)” units and so forth.

Controls with this behavior can't be embedded. If an embedded control must have this same behavior, use the SBMOVEY_SIZEYBIS behavior for the embedded control.

Example:

Before

After

See also : AddCtlBehavior function.


Behavior : SBMOVEY_SIZEYBIS

Remarks

Same as SBMOVEY_SIZEY behavior but controls with this behavior share another "stretching space". Use this behavior if you embed a control into another control with the same SBMOVEY_SIZEY behavior.

Example:

Before

After

See also : AddCtlBehavior function.


Behavior : SBMOVEY_SIZEXY

Remarks

The control will be moved and resized vertically to share the vertical "stretching space". The control will be also resized horizontally to keep the same distance from the dialog’s right hand side.

All controls with this behavior resized according to “DeltaVertical/ NumberOfControls”.

Controls are sought from the top to the bottom. The upper control does not move; the second control from the top will move towards the bottom of “DeltaVertical/ NumberOfControls” units; the third control will move of ”2*(DeltaVertical/ NumberOfControls)” units and so forth.

Controls with this behavior can't be embedded. If an embedded control must have this same behavior, use the SBMOVEY_SIZEXYBIS behavior for the embedded control.

Example:

Before

After

See also : AddCtlBehavior function.


Behavior : SBMOVEY_SIZEXYBIS

Remarks

Same as SBMOVEY_SIZEXY behavior but controls with this behavior share another "stretching space". Use this behavior if you embed a control into another control with the same SBMOVEY_SIZEXY behavior.

Example:

Before

After

See also : AddCtlBehavior function.


Behavior : SBMOVEXY_SIZEXY

Remarks

The control will be moved and resized vertically and horizontally to share the horizontal and vertical "stretching space" (behavior rarely used).

All controls will be resized according to “DeltaHorizontal / NumberOfControls” and “DeltaVertical / NumberOfControls”.

Controls are sought from the top-left to the bottom-right sides. The most top-left control does not move; the second control will move to the bottom of “DeltaVertical / NumberOfControls” units and to the right of “DeltaHorizontal / NumberOfControls” units; the third control will move of ”2*(DeltaVertical / NumberOfControls)” and ”2*(DeltaHorizontal / NumberOfControls)” units and so forth.

Controls with this behavior can't be embedded. If an embedded control must have this same behavior, use the SBMOVEXY_SIZEXYBIS behavior for the embedded control.

Example:

Before

After

See also : AddCtlBehavior function.


Behavior : SBMOVEXY_SIZEXYBIS

Remarks

Same as SBMOVEXY_SIZEXY behavior but controls with this behavior share another "stretching space". Use this behavior if you embed a control into another control with the same SBMOVEXY_SIZEXY behavior. (behavior rarely used).

Example:

Before

After

See also : AddCtlBehavior function.


Slave Behaviors

Remarks

A slave behavior is useful to move or resize controls according to other controls that move and stretch sharing the space available. Slave controls does not share that space.

A slave behavior always has the SBSLAVE style and can be build with any combination of the next elementary style :

Elementary style

SBMOVEX

SBMOVEY

SBSIZEX

SBSIZEY

SBSLAVE

SBBIS

SBDLGMOVEX

SBDLGMOVEY

SBDLGSIZEX

SBDLGSIZEY

The debug version of DLGSTRETCHV21 asserts if a behavior combines two flags over the same axis.

That is the next behavior are exclusive:

SBMOVEX and SBDLGMOVEX

SBSIZEY and SBDLGMOVEY

SBSIZEX and SBDLGSIZEX

SBSIZEY and SBDLGSIZEY

A slave control moves and resizes according to the master control and/or to the owner window along the X, Y axis or in both directions. The master control must have a behavior of the 14 following type :

SBMOVEX_SIZEX, SBMOVEX_SIZEXBIS, SBMOVEX_SIZEXY, SBMOVEX_SIZEXYBIS, SBMOVEY_SIZEY, SBMOVEY_SIZEYBIS, SBMOVEY_SIZEXY, SBMOVEY_SIZEXYBIS, SBMOVEXY_SIZEX, SBMOVEXY_SIZEXBIS, SBMOVEXY_SIZEY, SBMOVEXY_SIZEYBIS, SBMOVEXY_SIZEXY or SBMOVEXY_SIZEXYBIS.

The debug version of DLGSTRETCHV21 assert if a control is attached to incompatible master.

If a master control does not have the required slave behavior, the behavior attached to is ignored.

A slave control is always placed to the left or at the top of the master control.

Example:

Before

After

See also : AddCtlBehavior function.