mCtrl/mditab.h File Reference

MDI tab control (MC_WC_MDITAB). More...

#include <mCtrl/defs.h>

Go to the source code of this file.

Data Structures

struct  mc_MT_ITEMW
struct  mc_MT_ITEMA
struct  mc_MT_HITTESTINFO
 Structure for MC_MT_HITTEST message. More...
struct  mc_MT_TABWIDTH
 Structure for messages MC_MTM_SETWIDTH and MC_MTM_GETWIDTH. More...
struct  mc_NM_MT_SELCHANGE
 Structure for MC_MTN_SELCHANGE notification. More...
struct  mc_NM_MT_DELETEITEM
 Structure for MC_MTN_DELETEITEM notification. More...
struct  mc_NM_MT_CLOSEITEM
 Structure for MC_MTN_CLOSEITEM notification. More...

Defines

#define mc_MT_ITEM   mc_MT_ITEMW
#define MC_MTM_GETITEMCOUNT   (WM_USER + 100)
#define MC_MTM_GETIMAGELIST   (WM_USER + 101)
#define MC_MTM_SETIMAGELIST   (WM_USER + 102)
#define MC_MTM_DELETEALLITEMS   (WM_USER + 103)
#define MC_MTM_INSERTITEMW   (WM_USER + 105)
#define MC_MTM_INSERTITEMA   (WM_USER + 106)
#define MC_MTM_INSERTITEM   MC_MTM_INSERTITEMW
#define MC_MTM_SETITEMW   (WM_USER + 107)
#define MC_MTM_SETITEMA   (WM_USER + 108)
#define MC_MTM_SETITEM   MC_MTM_SETITEMW
#define MC_MTM_GETITEMW   (WM_USER + 109)
#define MC_MTM_GETITEMA   (WM_USER + 110)
#define MC_MTM_GETITEM   MC_MTM_GETITEMW
#define MC_MTM_DELETEITEM   (WM_USER + 111)
#define MC_MTM_HITTEST   (WM_USER + 112)
#define MC_MTM_SETCURSEL   (WM_USER + 113)
#define MC_MTM_GETCURSEL   (WM_USER + 114)
#define MC_MTM_CLOSEITEM   (WM_USER + 115)
#define MC_MTM_SETTABWIDTH   (WM_USER + 116)
#define MC_MTM_GETTABWIDTH   (WM_USER + 117)
#define MC_MTN_SELCHANGE   (0xfffffddb)
#define MC_MTN_DELETEITEM   (0xfffffdd0)
#define MC_MTN_DELETEALLITEMS   (0xfffffdcf)
#define MC_MTN_CLOSEITEM   (0xfffffdce)
Window class
#define MC_WC_MDITABW   L"mCtrl.mditab"
#define MC_WC_MDITABA   "mCtrl.mditab"
#define MC_WC_MDITAB   MC_WC_MDITABW
mc_MT_ITEM::dwMask bits
These specifies which members of mc_MT_ITEM structure are valid.

#define MC_MTIF_TEXT   (1 << 0)
#define MC_MTIF_IMAGE   (1 << 1)
#define MC_MTIF_PARAM   (1 << 2)
mc_MT_HITTESTINFO::flags bits
#define MC_MTHT_NOWHERE   (1 << 0)
#define MC_MTHT_ONITEMICON   (1 << 1)
#define MC_MTHT_ONITEMLABEL   (1 << 2)
#define MC_MTHT_ONITEMCLOSEBUTTON   (1 << 3)
#define MC_MTHT_ONITEM   (MC_MTHT_ONITEMICON | MC_MTHT_ONITEMLABEL | MC_MTHT_ONITEMCLOSEBUTTON)
Style constants
#define MC_MTS_CBONTOOLBAR   (0x00000000L)
 Show close button on right side of the control. This is default.
#define MC_MTS_CBONEACHTAB   (0x00000001L)
 Not supported, reserved for future use.
#define MC_MTS_CBONACTIVETAB   (0x00000002L)
 Not supported, reserved for future use.
#define MC_MTS_CBNONE   (0x00000003L)
 Don't show close button.
#define MC_MTS_CBMASK   (0x00000003L)
 This is not valid style, its bitmask of MC_MTS_CBxxx styles.
#define MC_MTS_TLBALWAYS   (0x00000000L)
 Popup tab list button is shown always. This is default.
#define MC_MTS_TLBONSCROLL   (0x00000004L)
 Popup tab list button is shown if scrolling is triggered on.
#define MC_MTS_TLBNEVER   (0x00000008L)
 Popup tab list button is never displayed.
#define MC_MTS_TLBMASK   (0x0000000CL)
 This is not valid style, but bitmask of MC_NTS_TLBxxx styles.
#define MC_MTS_SCROLLALWAYS   (0x00000010L)
 Always shows scrolling buttons.
#define MC_MTS_CLOSEONMCLICK   (0x00000020L)
 Middle click closes a tab.
#define MC_MTS_FOCUSONBUTTONDOWN   (0x00000040L)
 Mouse button down gains focus.
#define MC_MTS_FOCUSNEVER   (0x00000080L)
 Never gains focus.
#define MC_MTS_FOCUSMASK   (0x000000C0L)
 This is not valid style, but bitmask of MC_NTS_FOCUSxxx styles.

Functions

BOOL MCTRL_API mcMditab_Initialize (void)
void MCTRL_API mcMditab_Terminate (void)


Detailed Description

MDI tab control (MC_WC_MDITAB).

This control is a replacement for standard multiple document interface (MDI), as that interface seems to be outdated, and does not reflect modern GUI requirements.

Instead this control provides user experience similar to the web browsers with tabbing support.

The control is very similar to the standard tab control from COMCTL32.DLL, both visually and from developer's point of view. There two main differences:

Styles, messages and notifications the control supports mostly correspond to subset of messages and styles of the standard tab control. The counterparts have generally also the same names (differing only in prefix of the identifiers). If you are familiar with the standard tab control, you should be able to adopt MC_WC_MDITAB very quickly. However please note that the messages and styles are not interchangeable: The constants of styles and messages generally differ in their values.

Altough the purpose of the control is to provide a replacement for the MDI, the programmatic interfaces veru differs. If you want to replace MDI with this control in an existing application, expect it will take some time.

These standard messages are handled by MC_WC_MDITAB control:


Define Documentation

#define MC_WC_MDITABW   L"mCtrl.mditab"

Unicode window class name

#define MC_WC_MDITABA   "mCtrl.mditab"

ANSI window class name

#define MC_WC_MDITAB   MC_WC_MDITABW

Unicode-resolution alias

#define MC_MTIF_TEXT   (1 << 0)

mc_MT_ITEM::pszText is valid.

#define MC_MTIF_IMAGE   (1 << 1)

mc_MT_ITEM::iImage is valid.

#define MC_MTIF_PARAM   (1 << 2)

mc_MT_ITEM::lParam is valid.

#define mc_MT_ITEM   mc_MT_ITEMW

Structure for manipulating with tab item.

See also:
mc_MT_INSERTITEM mc_MT_DELETEITEM mc_MT_SETITEM mc_MT_GETITEM

#define MC_MTHT_NOWHERE   (1 << 0)

The hit test coordinates are outside of any tabs.

#define MC_MTHT_ONITEMICON   (1 << 1)

The coordinates hit the tab on its icon.

#define MC_MTHT_ONITEMLABEL   (1 << 2)

The coordinates hit the tab, but not its icon, neither its close button.

#define MC_MTHT_ONITEMCLOSEBUTTON   (1 << 3)

The coordinates hit the tab on its close button.

#define MC_MTHT_ONITEM   (MC_MTHT_ONITEMICON | MC_MTHT_ONITEMLABEL | MC_MTHT_ONITEMCLOSEBUTTON)

The coordinates hit the tab anywhere in its rectangle.

#define MC_MTM_GETITEMCOUNT   (WM_USER + 100)

Gets count of tabs.

Parameters:
wParam Reserved, set to zero.
lParam Reserved, set to zero.
Returns:
(int) Count of tabs.

#define MC_MTM_GETIMAGELIST   (WM_USER + 101)

Gets imagelist.

Parameters:
wParam Reserved, set to zero.
lParam Reserved, set to zero.
Returns:
(HIMAGELIST) The image list, or NULL.
See also:
MC_MTM_SETIMAGELIST

#define MC_MTM_SETIMAGELIST   (WM_USER + 102)

Sets imagelist. The tab items can refer to the images in the list with MC_MT_ITEM::iImage.

Parameters:
wParam Reserved, set to zero.
[in] lParam (HIMAGELIST) The imagelist.
Returns:
(HIMAGELIST) Old image list, or NULL.
See also:
MC_MTM_GETIMAGELIST

#define MC_MTM_DELETEALLITEMS   (WM_USER + 103)

Delete all tab items. Sends MC_MTN_DELETEALLITEMS notification and (unless MC_MTN_DELETEALLITEMS prevents that) MC_MTN_DELETEITEM for each tab.

Parameters:
wParam Reserved, set to zero.
lParam Reserved, set to zero.
Returns:
(BOOL) TRUE on success, FALSE otherwise.
See also:
MC_MTM_DELETEITEM

#define MC_MTM_INSERTITEMW   (WM_USER + 105)

Inserts new tab into the tab control (unicode version). Note that the new item is not automatically selected.

Parameters:
[in] wParam (int) Index of the new item.
[in] lParam (mc_MT_ITEMW*) Pointer to detailed data of the new tab.
Returns:
(int) index of the new tab, or -1 on failure.

#define MC_MTM_INSERTITEMA   (WM_USER + 106)

Inserts new tab into the tab control (ANSI version). Note that the new item is not automatically selected.

Parameters:
[in] wParam (int) Index of the new control.
[in] lParam (mc_MT_ITEMA*) Pointer to detailed data of the new tab.
Returns:
(int) index of the new tab, or -1 on failure.

#define MC_MTM_INSERTITEM   MC_MTM_INSERTITEMW

Inserts new tab into the tab control.

Parameters:
[in] wParam (int) Index of the new item.
[in] lParam (mc_MT_ITEM*) Pointer to detailed data of the new tab.
Returns:
(int) index of the new tab, or -1 on failure.

#define MC_MTM_SETITEMW   (WM_USER + 107)

Sets tab in the tab control (unicode version).

Parameters:
[in] wParam (int) Index of the item.
[in] lParam (mc_MT_ITEMW*) Pointer to detailed data of the tab.
Returns:
TRUE on success, FALSE otherwise.

#define MC_MTM_SETITEMA   (WM_USER + 108)

Sets tab in the tab control (ANSI version).

Parameters:
[in] wParam (int) Index of the item.
[in] lParam (mc_MT_ITEMA*) Pointer to detailed data of the tab.
Returns:
TRUE on success, FALSE otherwise.

#define MC_MTM_SETITEM   MC_MTM_SETITEMW

Sets tab in the tab control.

Parameters:
[in] wParam (int) Index of the item.
[in] lParam (mc_MT_ITEM*) Pointer to detailed data of the tab.
Returns:
TRUE on success, FALSE otherwise.

#define MC_MTM_GETITEMW   (WM_USER + 109)

Gets tab data from the tab control (unicode version).

Parameters:
[in] wParam (int) Index of the item.
[in,out] lParam (mc_MT_ITEMW*) Pointer to detailed data of the tab, receiving the data according to mc_MT_ITEM::dwMask.
Returns:
TRUE on success, FALSE otherwise.

#define MC_MTM_GETITEMA   (WM_USER + 110)

Gets tab data from the tab control (ANSI version).

Parameters:
[in] wParam (int) Index of the item.
[in,out] lParam (mc_MT_ITEMA*) Pointer to detailed data of the tab, receiving the data according to mc_MT_ITEM::dwMask.
Returns:
TRUE on success, FALSE otherwise.

#define MC_MTM_GETITEM   MC_MTM_GETITEMW

Gets tab data from the tab control.

Parameters:
[in] wParam (int) Index of the item.
[in,out] lParam (mc_MT_ITEM*) Pointer to detailed data of the tab, receiving the data according to mc_MT_ITEM::dwMask.
Returns:
TRUE on success, FALSE otherwise.

#define MC_MTM_DELETEITEM   (WM_USER + 111)

Deletes the item. Sends MC_MTN_DELETEITEM notification to parent window.

Parameters:
[in] wParam (int) Index of tab to be deleted.
lParam Reserved, set to zero.
Returns:
TRUE on success, FALSE otherwise.

#define MC_MTM_HITTEST   (WM_USER + 112)

Tests which tab (and its part) is placed on specified position.

Parameters:
wParam Reserved, set to zero.
[in,out] lParam (mc_MT_HITTESTINFO*) Pointer to a hit test structure. Set mc_MT_HITTESTINFO::pt on input.
Returns:
(int) Index of the hit tab, or -1.

#define MC_MTM_SETCURSEL   (WM_USER + 113)

Selects a tab.

Parameters:
[in] wParam (int) Index of the tab to select.
lParam Reserved, set to zero.
Returns:
(int) Index of previously selected tab, or -1.

#define MC_MTM_GETCURSEL   (WM_USER + 114)

Gets indes of selected tab.

Parameters:
wParam Reserved, set to zero.
lParam Reserved, set to zero.
Returns:
(int) Index of selected tab, or -1.

#define MC_MTM_CLOSEITEM   (WM_USER + 115)

Asks to close item. It causes to send MC_MTN_CLOSEITEM notification and depening on its return value it then can cause deleteing the item.

Parameters:
[in] wParam (int) Index of the item to be closed.
lParam Reserved, set to zero.
Returns:
TRUE on success, FALSE otherwise.

#define MC_MTM_SETTABWIDTH   (WM_USER + 116)

Sets default and minimal width for each tab. If there is enough space, all tabs have the default width. When there are too many widths, they are made narrower so more tabs fit into the visible space area, but never narrower then the minimal width.

Parameters:
wParam 
[in] lParam (mc_MT_TABWIDTH*) Pointer to a structure specifying the default and minimal widths. When NULL is passed, the values are reset to built-in defaults.
Returns:
TRUE on success, FALSE otherwise.
See also:
MC_MTM_GETTABWIDTH

#define MC_MTM_GETTABWIDTH   (WM_USER + 117)

Gets default and minimal width for each tab.

Parameters:
wParam 
[out] lParam (mc_MT_TABWIDTH*) Pointer to a structure where the current widths will be set.
Returns:
TRUE on success, FALSE otherwise.
See also:
MC_MTM_SETTABWIDTH

#define MC_MTN_SELCHANGE   (0xfffffddb)

Controls sends this notification when other tab has been selected.

Parameters:
[in] wParam (int) Id of the control sending the notification.
[in] lParam (mc_NM_MT_SELCHANGE*) Pointer to a structure specifying details about the selection change.
Returns:
You should return zero , if you process the message.

#define MC_MTN_DELETEITEM   (0xfffffdd0)

Control sends this notification when a tab is being deleted. When called the item still exists.

Parameters:
[in] wParam (int) Id of the control sending the notification.
[in] lParam (mc_NM_MT_DELETEITEM*) Pointer to a structure specifying details about the item being deleted.
Returns:
You should return zero if you process the notification.

#define MC_MTN_DELETEALLITEMS   (0xfffffdcf)

Control sends this notification when it processes MC_MTM_DELETEALLITEMS message or when it is being destroyed. Depending on the value returned from the notification, calling MC_MTN_DELETEITEM notifications for all the items can be supressed.

Parameters:
[in] wParam (int) Id of the control sending the notification.
[in] lParam (NMHDR*)
Returns:
You should return FALSE to receive subsequent MC_MTN_DELETEITEM for each item; or TRUE to supress sending them.

#define MC_MTN_CLOSEITEM   (0xfffffdce)

Control sends this notification when user requets closing a tab item.

Parameters:
[in] wParam (int) Id of the control sending the notification.
[in] lParam (mc_NM_MT_CLOSEITEM*) Pointer to a structure specifying details about the item being closed.
Returns:
You should return FALSE to remove the tab (the tab is then deleted and MC_MTN_DELETEITEM notification is sent); or TRUE to cancel the tab closure.


Function Documentation

BOOL MCTRL_API mcMditab_Initialize ( void   ) 

Registers the MDI tab control class.

Returns:
TRUE on success, FALSE on failure.
See also:
sec_initialization

void MCTRL_API mcMditab_Terminate ( void   ) 

Unregisters the MDI tab control class.

See also:
sec_initialization


Generated on Wed Nov 4 00:45:25 2009 for mCtrl by  1.5.9