control.h
资源名称:GPRS_work.rar [点击查看]
上传用户:sdaoma
上传日期:2013-08-07
资源大小:3838k
文件大小:161k
源码类别:
GPS编程
开发平台:
C/C++
- /**
- * file control.h
- * author Wei Yongming <ymwei@minigui.org>
- * date 2001/12/29
- *
- * This file includes interfaces of standard controls of MiniGUI.
- *
- verbatim
- Copyright (C) 1998-2002 Wei Yongming.
- Copyright (C) 2002-2004 Feynman Software.
- This file is part of MiniGUI, a compact cross-platform Graphics
- User Interface (GUI) support system for real-time embedded systems.
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- endverbatim
- */
- /*
- * $Id: control.h,v 1.165 2004/10/20 02:06:00 weiym Exp $
- *
- * MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks version 1.6.x
- * Copyright (C) 1999-2002 Wei Yongming.
- * Copyright (C) 2002-2004 Feynman Software.
- */
- #ifndef _MGUI_CONTROL_H
- #define _MGUI_CONTROL_H
- #ifdef __cplusplus
- extern "C" {
- #endif /* __cplusplus */
- /************************** Common definitions *******************************/
- /************************** Control Helpers **********************************/
- /**
- * addtogroup fns Functions
- * @{
- */
- /**
- * addtogroup global_fns Global/general functions
- * @{
- */
- /**
- * addtogroup misc_fns Miscellaneous functions
- * @{
- */
- int EditOnEraseBackground (HWND hWnd, HDC hdc, const RECT* pClipRect);
- /**
- * fn void GUIAPI DrawBoxFromBitmap (HDC hdc, const RECT* box, const BITMAP* bmp, BOOL h_v, BOOL do_clip)
- * brief Draws a box from bitmap.
- *
- * param hdc The handle to drawing context.
- * param box The rectangle of the box.
- * param bmp The pointer to the BITMAP object.
- * param h_v Draw the box along horizental or vertical.
- * param do_clip Does clip the drawing in the box?
- */
- void GUIAPI DrawBoxFromBitmap (HDC hdc, const RECT* box, const BITMAP* bmp, BOOL h_v, BOOL do_clip);
- #define DF_3DBOX_NORMAL 0x0000
- #define DF_3DBOX_PRESSED 0x0001
- #define DF_3DBOX_STATEMASK 0x000F
- #define DF_3DBOX_NOTFILL 0x0000
- #define DF_3DBOX_FILL 0x0010
- /**
- * fn void GUIAPI Draw3DControlFrameEx (HDC hdc, HWND hwnd, int x0, int y0, int x1, int y1, DWORD flags, gal_pixel fillc)
- * brief Draws a 3D style frame control.
- *
- * param hdc The handle to drawing context.
- * param hwnd Tell the function to draw with the color definitions of this window.
- * param x0 Specify the x-coordinate of the upper-left corner.
- * param y0 Specify the y-coordinate of the upper-left corner.
- * param x1 Specify the x-coordinate of the lower-right corner.
- * param y1 Specify the y-coordinate of the lower-right corner.
- * param flags Specify the drawing flag, can be or'ed with the following flags:
- * - DF_3DBOX_NORMALn The box is displayed with normal status.
- * - DF_3DBOX_PRESSEDn The box is pressed.
- * - DF_3DBOX_NOTFILLn Do not fill the box.
- * - DF_3DBOX_FILLn Fill the box and the a fillc defined the color.
- * param fillc Specify the pixel value to fill the box when DF_3DBOX_FILL specified.
- *
- * sa DrawFlatControlFrameEx
- */
- void GUIAPI Draw3DControlFrameEx (HDC hdc, HWND hwnd, int x0, int y0, int x1, int y1,
- DWORD flags, gal_pixel fillc);
- /* back compatibility definitions */
- #define Draw3DControlFrame(hdc, l, t, r, b, fillc, updown)
- Draw3DControlFrameEx(hdc, HWND_DESKTOP, l, t, r, b,
- (updown?DF_3DBOX_NORMAL:DF_3DBOX_PRESSED) | ((fillc)?DF_3DBOX_FILL:0), fillc)
- /**
- * fn void GUIAPI DrawFlatControlFrameEx(HDC hdc, HWND hwnd, int x0, int y0, int x1, int y1, int corner, DWORD flags, gal_pixel fillc)
- * brief Draws a flat frame control with triangle corner.
- *
- * param hdc The handle to drawing context.
- * param hwnd Tell the function to draw with the color definitions of this window.
- * param x0 Specifies the x-coordinate of the upper-left corner.
- * param y0 Specifies the y-coordinate of the upper-left corner.
- * param x1 Specifies the x-coordinate of the lower-right corner.
- * param y1 Specifies the y-coordinate of the lower-right corner.
- * param corner Specifies the length of the edge of the triangle corner.
- * param flags Specify the drawing flag, can be or'ed with the following flags:
- * - DF_3DBOX_NORMALn The box is displayed with normal status.
- * - DF_3DBOX_PRESSEDn The box is pressed.
- * - DF_3DBOX_NOTFILLn Do not fill the box.
- * - DF_3DBOX_FILLn Fill the box and the a fillc defined the color.
- * param fillc Specify the pixel value to fill the box when DF_3DBOX_FILL specified.
- *
- * sa Draw3DControlFrameEx
- */
- void GUIAPI DrawFlatControlFrameEx (HDC hdc, HWND hwnd, int x0, int y0, int x1, int y1,
- int corner, DWORD flags, gal_pixel fillc);
- #define DrawFlatControlFrame(hdc, x0, y0, x1, y1, fillc, updown)
- DrawFlatControlFrameEx(hdc, HWND_DESKTOP, x0, y0, x1, y1, 3,
- (updown?DF_3DBOX_NORMAL:DF_3DBOX_PRESSED) | ((fillc)?DF_3DBOX_FILL:0), fillc)
- /**
- * fn void GUIAPI Draw3DThickFrameEx (HDC hdc, HWND hwnd, int l, int t, int r, int b, DWORD flags, gal_pixel fillc)
- * brief Draws a thick 3D frame.
- *
- * This function draws a thin 3D frame (the border is 2-pixel wide),
- * and fills the frame if a fill flag is specified.
- *
- * param hdc The device context.
- * param hwnd Tell the function to draw with the color definitions of this window.
- * param l The x-coordinate of upper-left corner of the frame.
- * param t The y-coordinate of upper-left corner of the frame.
- * param r The x-coordinate of lower-right corner of the frame.
- * param b The y-coordinate of lower-right corner of the frame.
- * param flags Specify the drawing flag, can be or'ed with the following flags:
- * - DF_3DBOX_NORMALn The box is displayed with normal status.
- * - DF_3DBOX_PRESSEDn The box is pressed.
- * - DF_3DBOX_NOTFILLn Do not fill the box.
- * - DF_3DBOX_FILLn Fill the box and the a fillc defined the color.
- * param fillc Specify the pixel value to fill the box when DF_3DBOX_FILL specified.
- *
- * sa Draw3DControlFrameEx, DrawFlatControlFrameEx
- */
- void GUIAPI Draw3DThickFrameEx (HDC hdc, HWND hwnd,
- int l, int t, int r, int b, DWORD flags, gal_pixel fillc);
- /* back compatibility definitions */
- #define Draw3DUpThickFrame(hdc, l, t, r, b, fillc)
- Draw3DThickFrameEx(hdc, HWND_DESKTOP, l, t, r, b, DF_3DBOX_NORMAL | ((fillc)?DF_3DBOX_FILL:0), fillc)
- #define Draw3DDownThickFrame(hdc, l, t, r, b, fillc)
- Draw3DThickFrameEx(hdc, HWND_DESKTOP, l, t, r, b, DF_3DBOX_PRESSED | ((fillc)?DF_3DBOX_FILL:0), fillc)
- #define Draw3DUpFrame Draw3DUpThickFrame
- #define Draw3DDownFrame Draw3DDownThickFrame
- /**
- * fn void GUIAPI Draw3DThinFrameEx (HDC hdc, HWND hwnd, int l, int t, int r, int b, DWORD flags, gal_pixel fillc)
- * brief Draws a thin 3D frame.
- *
- * This function draws a thin 3D frame (the border is 1-pixel wide),
- * and fills the frame if a fill flag is specified.
- *
- * param hdc The device context.
- * param hwnd Tell the function to draw with the color definitions of this window.
- * param l The x-coordinate of upper-left corner of the frame.
- * param t The y-coordinate of upper-left corner of the frame.
- * param r The x-coordinate of lower-right corner of the frame.
- * param b The y-coordinate of lower-right corner of the frame.
- * param flags Specify the drawing flag, can be or'ed with the following flags:
- * - DF_3DBOX_NORMALn The box is displayed with normal status.
- * - DF_3DBOX_PRESSEDn The box is pressed.
- * - DF_3DBOX_NOTFILLn Do not fill the box.
- * - DF_3DBOX_FILLn Fill the box and the a fillc defined the color.
- * param fillc Specify the pixel value to fill the box when DF_3DBOX_FILL specified.
- *
- * sa Draw3DControlFrameEx, DrawFlatControlFrameEx
- */
- void GUIAPI Draw3DThinFrameEx (HDC hdc, HWND hwnd,
- int l, int t, int r, int b, DWORD flags, gal_pixel fillc);
- /* back compatibility definitions */
- #define Draw3DUpThinFrame(hdc, l, t, r, b, fillc)
- Draw3DThinFrameEx(hdc, HWND_DESKTOP, l, t, r, b, DF_3DBOX_NORMAL | ((fillc)?DF_3DBOX_FILL:0), fillc)
- #define Draw3DDownThinFrame(hdc, l, t, r, b, fillc)
- Draw3DThinFrameEx(hdc, HWND_DESKTOP, l, t, r, b, DF_3DBOX_PRESSED | ((fillc)?DF_3DBOX_FILL:0), fillc)
- /**
- * fn void GUIAPI Draw3DBorderEx (HDC hdc, HWND hwnd, int l, int t, int r, int b)
- * brief Draws a 3D rectangle border.
- *
- * This function draws a 3D retangle border which is 2-pixel wide.
- *
- * param hdc The device context.
- * param hwnd Tell the function to draw with the color definitions of this window.
- * param l The x-coordinate of upper-left corner of the rectangle.
- * param t The y-coordinate of upper-left corner of the rectangle.
- * param r The x-coordinate of lower-right corner of the rectangle.
- * param b The y-coordinate of lower-right corner of the rectangle.
- *
- * sa Draw3DThinFrameEx, Draw3DThickFrameEx
- */
- void GUIAPI Draw3DBorderEx (HDC hdc, HWND hwnd, int l, int t, int r, int b);
- /* back compatibility definitions */
- #define Draw3DBorder(hdc, l, t, r, b)
- Draw3DBorderEx(hdc, HWND_DESKTOP, l, t, r, b)
- /**
- * fn void GUIAPI DisabledTextOutEx (HDC hdc, HWND hwnd, int x, int y, const char* szText)
- * brief Outputs disabled (grayed) text.
- *
- * This function outputs a grayed text at the specified position.
- *
- * param hdc The device context.
- * param hwnd Tell the function to draw with the color definitions of this window.
- * param x The x-coordinate of start point.
- * param y The y-coordinate of start point.
- * param szText The null-terminated text to be outputted.
- *
- * sa TextOut, DrawText
- */
- void GUIAPI DisabledTextOutEx (HDC hdc, HWND hwnd, int x, int y, const char* szText);
- /**
- * fn void GUIAPI NotifyParentEx (HWND hwnd, int id, int code, DWORD add_data)
- * brief Sends a notification message to the parent.
- *
- * By default, the notification from a control will be sent to its parent
- * window within a MSG_COMMAND messsage.
- *
- * Since version 1.2.6, MiniGUI defines the Nofication Callback Procedure
- * for control. You can specify a callback function for a control by calling
- * a SetNotificationCallback to receive and handle the notification from
- * the control.
- *
- * If you have defined the Notificaton Callback Procedure for the control,
- * calling NotifyParentEx will call the notification callback procedure,
- * not send the notification message to the parent.
- *
- * param hwnd The handle to current control window.
- * param id The identifier of current control.
- * param code The notification code.
- * param add_data The additional data of the notification.
- *
- * sa SetNotificationCallback
- */
- void GUIAPI NotifyParentEx (HWND hwnd, int id, int code, DWORD add_data);
- /**
- * def NotifyParent(hwnd, id, code)
- * brief Sends a notification message to the parent,
- * but without additional data.
- *
- * param hwnd The handle to current control window.
- * param id The identifier of current control.
- * param code The notification code.
- *
- * note This function is actually a macro of NotifyParentEx with
- * a dwAddData being zero.
- *
- * sa NotifiyParentEx
- */
- #define NotifyParent(hwnd, id, code)
- NotifyParentEx(hwnd, id, code, 0)
- /**
- * var typedef int (*STRCMP) (const char* s1, const char* s2, size_t n)
- * brief Type of general strncmp function.
- *
- * The function compares the two strings a s1 and a s2. It returns
- * an integer less than, equal to, or greater than zero if a s1 is found,
- * respectively, to be less than, to match, or be greater than a s2.
- *
- * Note that it only compares the first (at most) a n characters of s1 and s2.
- */
- typedef int (*STRCMP) (const char* s1, const char* s2, size_t n);
- /** @} end of misc_fns */
- /** @} end of global_fns */
- /** @} end of fns */
- /**
- * defgroup controls Standard controls
- * @{
- */
- /****** control messages *****************************************************/
- /* NOTE: control messages start from 0xF000 to 0xFFFF */
- #define MSG_FIRSTCTRLMSG 0xF000
- #define MSG_LASTCTRLMSG 0xFFFF
- /****** Static Control ******************************************************/
- #ifdef _CTRL_STATIC
- /**
- * defgroup ctrl_static Static control
- * @{
- */
- /**
- * def CTRL_STATIC
- * brief The class name of static control.
- */
- #define CTRL_STATIC ("static")
- /**
- * defgroup ctrl_static_styles Styles of static control
- * @{
- */
- /**
- * def SS_LEFT
- * brief Displays the given text flush-left.
- */
- #define SS_LEFT 0x00000000L
- /**
- * def SS_CENTER
- * brief Displays the given text centered in the rectangle.
- */
- #define SS_CENTER 0x00000001L
- /**
- * def SS_RIGHT
- * brief Displays the given text flush-right.
- */
- #define SS_RIGHT 0x00000002L
- /**
- * def SS_ICON
- * brief Designates an icon displayed in the static control.
- */
- #define SS_ICON 0x00000003L
- /**
- * def SS_BLACKRECT
- * brief Specifies a rectangle filled with the black color.
- */
- #define SS_BLACKRECT 0x00000004L
- /**
- * def SS_GRAYRECT
- * brief Specifies a rectangle filled with the light gray color.
- */
- #define SS_GRAYRECT 0x00000005L
- /**
- * def SS_WHITERECT
- * brief Specifies a rectangle filled with the light white color.
- */
- #define SS_WHITERECT 0x00000006L
- /**
- * def SS_BLACKFRAME
- * brief Specifies a box with a frame drawn with the black color.
- */
- #define SS_BLACKFRAME 0x00000007L
- /**
- * def SS_GRAYFRAME
- * brief Specifies a box with a frame drawn with the light gray color.
- */
- #define SS_GRAYFRAME 0x00000008L
- /**
- * def SS_WHITEFRAME
- * brief Specifies a box with a frame drawn with the light gray color.
- */
- #define SS_WHITEFRAME 0x00000009L
- /**
- * def SS_GROUPBOX
- * brief Creates a rectangle in which other controls can be grouped.
- */
- #define SS_GROUPBOX 0x0000000AL
- /**
- * def SS_SIMPLE
- * brief Designates a simple rectangle and displays a single line
- * of text flush-left in the rectangle.
- */
- #define SS_SIMPLE 0x0000000BL
- /**
- * def SS_LEFTNOWORDWRAP
- * brief Designates a simple rectangle and displays the given text
- * flush-left in the rectangle.
- *
- * Tabs are expanded, but words are not wrapped.
- * Text that extends past the end of a line is clipped.
- */
- #define SS_LEFTNOWORDWRAP 0x0000000CL
- #define SS_OWNERDRAW 0x0000000DL
- /**
- * def SS_BITMAP
- * brief Specifies that a bitmap will be displayed in the static control.
- */
- #define SS_BITMAP 0x0000000EL
- #define SS_ENHMETAFILE 0x0000000FL
- #define SS_TYPEMASK 0x0000000FL
- /**
- * def SS_NOPREFIX
- * brief Prevents interpretation of any ampersand (&) characters in
- * the control's text as accelerator prefix characters.
- *
- * note Not implemented so far.
- */
- #define SS_NOPREFIX 0x00000080L
- /**
- * def SS_NOTIFY
- * brief Sends the parent window notification messages when the user
- * clicks or double-clicks the control.
- */
- #define SS_NOTIFY 0x00000100L
- /**
- * def SS_CENTERIMAGE
- * brief Puts the image in the center of the static control.
- * Default is top-left aligned.
- */
- #define SS_CENTERIMAGE 0x00000200L
- /**
- * def SS_REALSIZEIMAGE
- * brief Does not scale the image.
- */
- #define SS_REALSIZEIMAGE 0x00000800L
- /** @} end of ctrl_static_styles */
- /**
- * defgroup ctrl_static_msgs Messages of static control
- * @{
- */
- #define STM_SETICON 0xF170
- #define STM_GETICON 0xF171
- /**
- * def STM_SETIMAGE
- * brief Associates a new image (icon or bitmap) with a static control.
- *
- * An application sends an STM_SETIMAGE message to
- * associate a new image (icon or bitmap) with a static control.
- *
- * code
- * STM_SETIMAGE
- * HICON image;
- * or
- * BITMAP* image;
- *
- * wParam = (WPARAM)image;
- * lParam = 0;
- * endcode
- *
- * param image The handle to an icon if the type of static control type
- * is SS_ICON, or the pointer to a BITMAP object if the type is SS_BITMAP.
- *
- * return The old image (handle or pointer).
- */
- #define STM_SETIMAGE 0xF172
- /**
- * def STM_GETIMAGE
- * brief Retrieves a handle to the image.
- *
- * An application sends an STM_GETIMAGE message to retrieve a handle
- * to the image associated with a static control.
- *
- * code
- * STM_GETIMAGE
- * wParam = 0;
- * lParam = 0;
- * endcode
- *
- * return The handle to the icon if the type of static control type is SS_ICON,
- * or the pointer to the BITMAP object if the type is SS_BITMAP.
- */
- #define STM_GETIMAGE 0xF173
- #define STM_MSGMAX 0xF174
- /** @} end of ctrl_static_msgs */
- /**
- * defgroup ctrl_static_ncs Notification codes of static control
- * @{
- */
- /**
- * def STN_DBLCLK
- * brief Notifies a double-click.
- *
- * The STN_DBLCLK notification message is sent when
- * the user double-clicks a static control that has the SS_NOTIFY style.
- */
- #define STN_DBLCLK 1
- #define STN_ENABLE 2
- #define STN_DISABLE 3
- /**
- * def STN_CLICKED
- * brief Notifies that a static control is clicked.
- *
- * The STN_CLICKED notification message is sent
- * when the user clicks a static control that has the SS_NOTIFY style.
- */
- #define STN_CLICKED 4
- /** @} end of ctrl_static_ncs */
- /** @} end of ctrl_static */
- #endif /* _CTRL_STATIC */
- /****** Button Control ******************************************************/
- #ifdef _CTRL_BUTTON
- /**
- * defgroup ctrl_button Button control
- * @{
- */
- /**
- * def CTRL_BUTTON
- * brief The class name of button control.
- */
- #define CTRL_BUTTON ("button")
- /**
- * defgroup ctrl_button_styles Styles of button control
- * @{
- */
- /**
- * def BS_PUSHBUTTON
- * brief Creates a push button.
- */
- #define BS_PUSHBUTTON 0x00000000L
- /**
- * def BS_DEFPUSHBUTTON
- * brief Creates a push button that behaves like a BS_PUSHBUTTON style button.
- * Creates a push button that behaves like a BS_PUSHBUTTON style button,
- * but also has a heavy black border. If the button is in a dialog box,
- * the user can select the button by pressing the enter key,
- * even when the button does not have the input focus.
- * This style is useful for enabling the user to quickly select
- * the most likely (default) option.
- */
- #define BS_DEFPUSHBUTTON 0x00000001L
- /**
- * def BS_CHECKBOX
- * brief Creates a small, empty check box with text.
- *
- * By default, the text is displayed to the right of the check box.
- * To display the text to the left of the check box, combine this flag
- * with the BS_LEFTTEXT style (or with the equivalent BS_RIGHTBUTTON style).
- */
- #define BS_CHECKBOX 0x00000002L
- /**
- * def BS_AUTOCHECKBOX
- * brief Creates a button that is almost the same as a check box.
- *
- * Creates a button that is the same as a check box,
- * except that the check state automatically toggles between
- * checked and unchecked each time the user selects the check box.
- */
- #define BS_AUTOCHECKBOX 0x00000003L
- /**
- * def BS_RADIOBUTTON
- * brief Creates a small circle with text.
- *
- * By default, the text is displayed to the right of the circle.
- * To display the text to the left of the circle, combine this flag
- * with the BS_LEFTTEXT style (or with the equivalent BS_RIGHTBUTTON style).
- * Use radio buttons for groups of related, but mutually exclusive choices.
- */
- #define BS_RADIOBUTTON 0x00000004L
- /**
- * def BS_3STATE
- * brief Creates a button that is almost the same as a check box.
- *
- * Creates a button that is the same as a check box, except
- * that the box can be grayed as well as checked or unchecked.
- * Use the grayed state to show that the state of the check box
- * is not determined.
- */
- #define BS_3STATE 0x00000005L
- /**
- * def BS_AUTO3STATE
- * brief Creates a button that is almost the same as a three-state check box.
- *
- * Creates a button that is the same as a three-state check box,
- * except that the box changes its state when the user selects it.
- * The state cycles through checked, grayed, and unchecked.
- */
- #define BS_AUTO3STATE 0x00000006L
- #define BS_GROUPBOX 0x00000007L
- #define BS_USERBUTTON 0x00000008L
- /**
- * def BS_AUTORADIOBUTTON
- * brief Creates a button that is almost the same as a radio button.
- *
- * Creates a button that is the same as a radio button,
- * except that when the user selects it, The system automatically
- * sets the button's check state to checked
- * and automatically sets the check state for all other buttons
- * in the same group to unchecked.
- */
- #define BS_AUTORADIOBUTTON 0x00000009L
- /**
- * def BS_OWNERDRAW
- * brief Creates an owner-drawn button.
- *
- * note Not implemented so far.
- */
- #define BS_OWNERDRAW 0x0000000BL
- #define BS_TYPEMASK 0x0000000FL
- /**
- * def BS_TEXT
- * brief Specifies that the button displays text.
- */
- #define BS_TEXT 0x00000000L
- /**
- * def BS_LEFTTEXT
- * brief Places text on the left side.
- *
- * Places text on the left side of the radio button
- * or check box when combined with a radio button or check box style.
- */
- #define BS_LEFTTEXT 0x00000020L
- /**
- * def BS_ICON
- * brief Specifies that the button displays an icon.
- */
- #define BS_ICON 0x00000040L
- /**
- * def BS_BITMAP
- * brief Specifies that the button displays a bitmap.
- */
- #define BS_BITMAP 0x00000080L
- #define BS_CONTENTMASK 0x000000F0L
- /**
- * def BS_LEFT
- * brief Left-justifies the text in the button rectangle.
- *
- * However, if the button is a check box or radio button that
- * does not have the BS_RIGHTBUTTON style, the text is left
- * justified on the right side of the check box or radio button.
- */
- #define BS_LEFT 0x00000100L
- /**
- * def BS_RIGHT
- * brief Right-justifies text in the button rectangle.
- *
- * However, if the button is a check box or radio button that
- * does not have the BS_RIGHTBUTTON style, the text is
- * right justified on the right side of the check box or radio button.
- */
- #define BS_RIGHT 0x00000200L
- /**
- * def BS_CENTER
- * brief Centers text horizontally in the button rectangle.
- */
- #define BS_CENTER 0x00000300L
- /**
- * def BS_TOP
- * brief Places text at the top of the button rectangle.
- */
- #define BS_TOP 0x00000400L
- /**
- * def BS_BOTTOM
- * brief Places text at the bottom of the button rectangle.
- */
- #define BS_BOTTOM 0x00000800L
- /**
- * def BS_VCENTER
- * brief Places text in the middle (vertically) of the button rectangle.
- */
- #define BS_VCENTER 0x00000C00L
- /**
- * def BS_REALSIZEIMAGE
- * brief Does not scale the image.
- */
- #define BS_REALSIZEIMAGE 0x00000F00L
- #define BS_ALIGNMASK 0x00000F00L
- /**
- * def BS_PUSHLIKE
- * brief Makes a button look and act like a push button.
- *
- * Makes a button (such as a check box, three-state check box, or radio button)
- * look and act like a push button. The button looks raised when it isn't
- * pushed or checked, and sunken when it is pushed or checked.
- */
- #define BS_PUSHLIKE 0x00001000L
- /**
- * def BS_MULTLINE
- * brief Wraps the button text to multiple lines.
- *
- * Wraps the button text to multiple lines if the text string is
- * too long to fit on a single line in the button rectangle.
- */
- #define BS_MULTLINE 0x00002000L
- /**
- * def BS_NOTIFY
- * brief Enables a button to send notification messages to its parent window.
- */
- #define BS_NOTIFY 0x00004000L
- /**
- * def BS_CHECKED
- * brief Makes a button checked initially.
- */
- #define BS_CHECKED 0x00004000L
- #define BS_FLAT 0x00008000L
- #define BS_NOBORDER 0x00010000L
- #define BS_RIGHTBUTTON BS_LEFTTEXT
- /** @} end of ctrl_button_styles */
- /**
- * defgroup ctrl_button_states States of button control
- * @{
- */
- /**
- * def BST_UNCHECKED
- * brief Indicates the button is unchecked.
- */
- #define BST_UNCHECKED 0x0000
- /**
- * def BST_CHECKED
- * brief Indicates the button is checked.
- */
- #define BST_CHECKED 0x0001
- /**
- * def BST_INDETERMINATE
- * brief Indicates the button is grayed because
- * the state of the button is indeterminate.
- */
- #define BST_INDETERMINATE 0x0002
- /**
- * def BST_PUSHED
- * brief Specifies the highlight state.
- */
- #define BST_PUSHED 0x0004
- /**
- * def BST_FOCUS
- * brief Specifies the focus state.
- */
- #define BST_FOCUS 0x0008
- /** @} end of ctrl_button_states */
- /**
- * defgroup ctrl_button_msgs Messages of button control
- * @{
- */
- /**
- * def BM_GETCHECK
- * brief Retrieves the check state of a radio button or check box.
- *
- * An application sends a BM_GETCHECK message to retrieve
- * the check state of a radio button or check box.
- *
- * code
- * BM_GETCHECK
- * wParam = 0;
- * lParam = 0;
- * endcode
- *
- * return An integer indicates whether the button is checked.
- *
- * retval BST_UNCHECKED The button is not checked.
- * retval BST_CHECKED The button is checked.
- * retval BST_INDETERMINATE The button is grayed because the state of the button is indeterminate.
- *
- * sa ctrl_button_states
- */
- #define BM_GETCHECK 0xF0F0
- /**
- * def BM_SETCHECK
- * brief Sets the check state of a radio button or check box.
- *
- * An application sends a BM_SETCHECK message to set
- * the check state of a radio button or check box.
- *
- * code
- * BM_SETCHECK
- * int check_state;
- *
- * wParam = (WPARAM)check_state;
- * lParam = 0;
- * endcode
- *
- * param check_state The check state of button, can be one of the following values:
- * - BST_UNCHECKEDn
- * Want the button to be unchecked.
- * - BST_CHECKEDn
- * Want the button to be checked.
- * - BST_INDETERMINATEn
- * Want the button to be grayed if it is a three states button.
- * return The old button state.
- */
- #define BM_SETCHECK 0xF0F1
- /**
- * def BM_GETSTATE
- * brief Gets the state of a button or check box.
- *
- * An application sends a BM_GETSTATE message to
- * determine the state of a button or check box.
- *
- * code
- * BM_GETSTATE
- * wParam = 0;
- * lParam = 0;
- * endcode
- *
- * return An integer indicates the button state.
- *
- * sa ctrl_button_states
- */
- #define BM_GETSTATE 0xF0F2
- /**
- * def BM_SETSTATE
- * brief Sets the state of a button.
- *
- * An application sends a BM_GETSTATE message to set the state of a
- * button.
- *
- * code
- * BM_SETSTATE
- * int push_state;
- *
- * wParam = (WPARAM)push_state;
- * lParam = 0;
- * endcode
- *
- * param push_state The push state of a button, can be one of the following values:
- * - Zeron
- * Want the button to be unpushed.
- * - Non zeron
- * Want the button to be pushed.
- *
- * return The old button state.
- */
- #define BM_SETSTATE 0xF0F3
- /**
- * def BM_SETSTYLE
- * brief Changes the style of a button.
- *
- * An application sends a BM_SETSTYLE message to change the style of a button.
- *
- * code
- * BM_SETSTYLE
- * int button_style;
- *
- * wParam = (WPARAM)button_style;
- * lParam = 0;
- * endcode
- *
- * param button_style The styles of a button.
- *
- * return Always be zero.
- *
- * sa ctrl_button_styles
- */
- #define BM_SETSTYLE 0xF0F4
- /**
- * def BM_CLICK
- * brief Simulates the user clicking a button.
- *
- * An application sends a BM_CLICK message to simulate the user clicking a button.
- *
- * code
- * BM_CLICK
- *
- * wParam = 0;
- * lParam = 0;
- * endcode
- */
- #define BM_CLICK 0xF0F5
- /**
- * def BM_GETIMAGE
- * brief Retrieves the handle to the image.
- *
- * An application sends a BM_GETIMAGE message to
- * retrieve a handle to the image (icon or bitmap) associated with the button.
- *
- * code
- * BM_GETIMAGE
- * int image_type;
- *
- * wParam = (WPARAM)&image_type;
- * lParam = 0;
- * endcode
- *
- * param image_type The type of a button image will be returned through this buferr.
- * It can be one of the following values:
- * - BM_IMAGE_BITMAPn
- * Bitmap of a button.
- * - BM_IMAGE_ICONn
- * Icon of a button.
- *
- * return A handle of the bitmap or icon of the button, zero when error.
- */
- #define BM_GETIMAGE 0xF0F6
- #define BM_IMAGE_BITMAP 1
- #define BM_IMAGE_ICON 2
- /**
- * def BM_SETIMAGE
- * brief Associates a new image (icon or bitmap) with the button.
- *
- * An application sends a BM_SETIMAGE message to
- * associate a new image (icon or bitmap) with the button.
- *
- * Please use BM_IMAGE_BITMAP or BM_IMAGE_ICON as the first parameter of the message
- * to indicate the type of button control image:
- * - BM_IMAGE_BITMAPn
- * Specifies the type of image to associate with the button to be a bitmap.
- * - BM_IMAGE_ICONn
- * Specifies the type of image to associate with the button to be an icon.
- */
- #define BM_SETIMAGE 0xF0F7
- #define BM_MSGMAX 0xF100
- /** @} end of ctrl_button_msgs */
- /**
- * defgroup ctrl_button_ncs Notification codes of button control
- * @{
- */
- /**
- * def BN_CLICKED
- * brief The BN_CLICKED notification message is sent when the user clicks a button.
- */
- #define BN_CLICKED 0
- #define BN_PAINT 1 /* not supported */
- #define BN_HILITE 2
- #define BN_UNHILITE 3
- #define BN_DISABLE 4 /* not supported */
- #define BN_DOUBLECLICKED 5
- /**
- * def BN_PUSHED
- * brief The BN_PUSHED notification message is sent when the user pushes a button.
- */
- #define BN_PUSHED BN_HILITE
- /**
- * def BN_UNPUSHED
- * brief The BN_UNPUSHED notification message is sent when the user unpushes a button.
- */
- #define BN_UNPUSHED BN_UNHILITE
- /**
- * def BN_DBLCLK
- * brief The BN_DBLCLK notification message is sent when the user double-clicks a button.
- */
- #define BN_DBLCLK BN_DOUBLECLICKED
- /**
- * def BN_SETFOCUS
- * brief The BN_SETFOCUS notification message is sent when a button receives the keyboard focus.
- */
- #define BN_SETFOCUS 6
- /**
- * def BN_KILLFOCUS
- * brief The BN_KILLFOCUS notification message is sent when a button loses the keyboard focus.
- */
- #define BN_KILLFOCUS 7
- /** @} end of ctrl_button_ncs */
- /** @} end of ctrl_button */
- #endif /* _CTRL_BUTTON */
- /****** Edit and MEdit Control ***********************************************/
- #if defined (_CTRL_SIMEDIT) || defined(_CTRL_SLEDIT) || defined(_CTRL_MLEDIT)
- /**
- * defgroup ctrl_edit Edit/MEdit control
- *
- * bug You can not pass caption argument for multi-line edit control
- * when you create it, just use null string:
- *
- * code
- * CreateWindowEx (CTRL_MEDIT, ..., "", ...);
- * endcode
- *
- * @{
- */
- /**
- * def CTRL_EDIT
- * brief The class name of simple single-line editor box.
- *
- * This edit control uses the system default fixed logical font.
- */
- #define CTRL_EDIT ("edit")
- /**
- * def CTRL_SLEDIT
- * brief The class name of single-line editor box.
- *
- * This edit control uses the system logical font for control,
- * which may be variable-width font..
- */
- #define CTRL_SLEDIT ("sledit")
- /**
- * def CTRL_MLEDIT
- * brief The class name of multiple-line editor box.
- *
- * This edit control uses the system logical font for control,
- * which may be variable-width font..
- */
- #define CTRL_MLEDIT ("mledit")
- /**
- * def CTRL_MEDIT
- * brief Another class name of multiple-line editor box.
- *
- * This edit control uses the system logical font for control,
- * which may be variable-width font..
- */
- #define CTRL_MEDIT ("medit")
- #define CTRL_OLDMEDIT ("oldmedit")
- /**
- * defgroup ctrl_edit_styles Styles of edit control
- * @{
- */
- /**
- * def ES_LEFT
- * brief Left-aligns text.
- */
- #define ES_LEFT 0x00000000L
- #define ES_CENTER 0x00000001L
- #define ES_RIGHT 0x00000002L
- #define ES_MULTILINE 0x00000004L
- /**
- * def ES_UPPERCASE
- * brief Converts all characters to uppercase as they are typed into the edit control.
- */
- #define ES_UPPERCASE 0x00000008L
- /**
- * def ES_LOWERCASE
- * brief Converts all characters to lowercase as they are typed into the edit control.
- */
- #define ES_LOWERCASE 0x00000010L
- /**
- * def ES_PASSWORD
- * brief Displays an asterisk (*) for each character typed into the edit control.
- */
- #define ES_PASSWORD 0x00000020L
- #define ES_AUTOVSCROLL 0x00000040L
- #define ES_AUTOHSCROLL 0x00000080L
- /**
- * def ES_NOHIDESEL
- * brief Edit control with this style will remain selected when focus is lost
- */
- #define ES_NOHIDESEL 0x00000100L
- /**
- * def ES_AUTOSELECT
- * brief Selects all text when getting focus
- */
- #define ES_AUTOSELECT 0x00000400L
- //#define ES_OEMCONVERT 0x00000400L
- /**
- * def ES_READONLY
- * brief Prevents the user from typing or editing text in the edit control.
- */
- #define ES_READONLY 0x00000800L
- /**
- * def ES_BASELINE
- * brief Draws base line under input area instead of frame border.
- */
- #define ES_BASELINE 0x00001000L
- /**
- * def ES_AUTOWRAP
- * brief Automatically wraps against border when inputting.
- */
- #define ES_AUTOWRAP 0x00002000L
- /**
- * def ES_TITLE
- * brief Shows specified title texts.
- */
- #define ES_TITLE 0x00004000L
- /**
- * def ES_TIP
- * brief Shows specified tip texts.
- */
- #define ES_TIP 0x00008000L
- /** @} end of ctrl_edit_styles */
- /**
- * defgroup ctrl_edit_msgs Messages of edit control
- * @{
- */
- /**
- * def EM_GETSEL
- * brief Gets the selected string in the edit control.
- *
- * code
- * EM_GETSEL
- *
- * char *buffer;
- * int len;
- *
- * wParam = len;
- * lParam = (LPARAM)buffer;
- * endcode
- *
- * param len Length of buffer.
- * param buffer Pointer to the string buffer
- *
- * return length of the selected string
- */
- #define EM_GETSEL 0xF0B0
- /**
- * def EM_SETSEL
- * brief Sets the selected point in the edit control and makes
- * the text between insertion point and selection point selected.
- *
- * Generally, you should send EM_SETCARETPOS first to set insertion
- * point before you use EM_SETSEL to select text.
- *
- * code
- * EM_SETSEL
- *
- * int line_pos;
- * int char_pos;
- *
- * wParam = (WPARAM)line_pos;
- * lParam = (LPARAM)char_pos;
- * endcode
- *
- * param line_pos line position of the selection point.
- * For single line editor, it is always zero.
- * Note : For multi-line editor, "line" means a text string ended with a line
- * seperator, not a single text line in wrap mode. So, char_pos
- * means the character position in a text string.
- * param char_pos character(wide character) position of the selection point.
- *
- * return length of the selected string
- */
- #define EM_SETSEL 0xF0B1
- #define EM_SETSELECTION EM_SETSEL
- /**
- * def EM_SELECTALL
- * brief Selects all the texts, the same meaning as ctrl+a
- *
- * code
- * EM_SELECTALL
- *
- * wParam = 0;
- * lParam = 0;
- * endcode
- */
- #define EM_SELECTALL 0xF0B2
- /**
- * def EM_GETSELPOS
- * brief Gets the position of the selection point.
- *
- * code
- * EM_GETSELPOS
- * int* line_pos;
- * int* char_pos;
- *
- * wParam = (WPARAM)line_pos;
- * lParam = (LPARAM)char_pos;
- * endcode
- *
- * param line_pos Pointer to a integer buffer to save the selection line position.
- * For single line editor, it is always zero.
- * Note : Here "line" means a text string ended with a line
- * seperator, not a single text line in wrap mode. So, char_pos
- * means the character position in a text string.
- * param char_pos Pointer to a integer buffer to save the selection character position.
- *
- * return The string length of the text from the beginning to the selection point.
- */
- #define EM_GETSELPOS 0xF0B3
- /**
- * def EM_INSERTCBTEXT
- * brief Inserts the text in the clipboard to the current caret position
- *
- * code
- * EM_INSERTCBTEXT
- * int len;
- * const char *string;
- *
- * wParam = len;
- * lParam = (LPARAM)string;
- * endcode
- *
- * param len Length of string
- * param string Pointer to the text string
- */
- #define EM_INSERTCBTEXT 0xF0B4
- /**
- * def EM_COPYTOCB
- * brief Copies the currently selected text to the clipboard
- *
- * code
- * EM_COPYTOCB
- *
- * wParam = 0;
- * lParam = 0
- * endcode
- *
- * return Length of the text which is really copied to clipboard.
- */
- #define EM_COPYTOCB 0xF0B5
- /**
- * def EM_CUTTOCB
- * brief Cuts the currently selected text to the clipboard
- *
- * code
- * EM_CUTTOCB
- *
- * wParam = 0;
- * lParam = 0
- * endcode
- *
- * return Length of the text which is really copied to clipboard.
- */
- #define EM_CUTTOCB 0xF0B6
- /**
- * def EM_SETLFDISPCHAR
- * brief Sets the char used to represent the line seperator.
- *
- * In default case, the line sperator will not be shown.
- * If the char used to represent the line seperator is not zero,
- * this char will be shown in place of line seperator.
- *
- * code
- * EM_SETLFDISPCHAR
- * unsigned char ch;
- *
- * wParam = 0;
- * lParam = ch;
- * endcode
- *
- * param ch the char used to represent the line seperator
- */
- #define EM_SETLFDISPCHAR 0xF0B7
- /**
- * def EM_SETLINESEP
- * brief Sets the line seperator.
- *
- * In default case, the line sperator is 'n'.
- *
- * code
- * EM_SETLINESEP
- * unsigned char ch;
- *
- * wParam = 0;
- * lParam = ch;
- * endcode
- *
- * param ch the new line seperator
- */
- #define EM_SETLINESEP 0xF0B8
- //#define EM_GETRECT 0xF0B2
- //#define EM_SETRECT 0xF0B3
- //#define EM_SETRECTNP 0xF0B4
- //#define EM_SCROLL 0xF0B5
- /**
- * def EM_GETCARETPOS
- * brief Gets the position of the caret.
- *
- * code
- * EM_GETCARETPOS
- * int* line_pos;
- * int* char_pos;
- *
- * wParam = (WPARAM)line_pos;
- * lParam = (LPARAM)char_pos;
- * endcode
- *
- * param line_pos Pointer to a integer buffer to save the caret line position.
- * For single line editor, it is always zero.
- * Note : Here "line" means a text string ended with a line
- * seperator, not a single text line in wrap mode. So, char_pos
- * means the character position in a text string.
- * param char_pos Pointer to a integer buffer to save the caret character position.
- *
- * return The string length of the text from the beginning to the caret pos.
- */
- #define EM_GETCARETPOS 0xF0B9
- /**
- * def EM_SETCARETPOS
- * brief Sets the position of the caret.
- *
- * code
- * EM_SETCARETPOS
- * int line_pos;
- * int char_pos;
- *
- * wParam = (WPARAM)line_pos;
- * lParam = (LPARAM)char_pos;
- * endcode
- *
- * param line_pos The new caret line position. For single line editor, it will be ignored.
- * Note : Here "line" means a text string ended with a line
- * seperator, not a single text line in wrap mode. So, char_pos
- * means the character position in a text string.
- * param char_pos The new caret character position.
- *
- * return length of the string from the beginning to the caret position
- * on success, otherwise -1.
- */
- #define EM_SETCARETPOS 0xF0BA
- #define EM_SETINSERTION EM_SETCARETPOS
- //#define EM_SCROLLCARET 0xF0B9
- //#define EM_GETMODIFY 0xF0BA
- //#define EM_SETMODIFY 0xF0BB
- /**
- * def EM_GETLINECOUNT
- * brief Gets the line number.
- *
- * code
- * EM_GETLINECOUNT
- *
- * wParam = 0;
- * lParam = 0;
- * endcode
- *
- * return Line number on success, otherwise -1.
- * note Implemented for TextEdit control.
- */
- #define EM_GETLINECOUNT 0xF0BC
- /**
- * def EM_GETLINEHEIGHT
- * brief Gets the height of a line.
- *
- * code
- * EM_GETLINEHEIGHT
- *
- * wParam = 0;
- * lParam = 0;
- * endcode
- *
- * return Height value.
- * note Implemented for TextEdit control.
- */
- #define EM_GETLINEHEIGHT 0xF0BD
- /**
- * def EM_SETLINEHEIGHT
- * brief Sets the height of a line.
- *
- * code
- * EM_SETLINEHEIGHT
- *
- * wParam = height;
- * lParam = 0;
- * endcode
- *
- * return the old height value.
- * note Implemented for TextEdit control.
- */
- #define EM_SETLINEHEIGHT 0xF0BE
- //#define EM_LINEINDEX 0xF0BD
- //#define EM_GETTHUMB 0xF0BE
- /* internal used now */
- #define EM_LINESCROLL 0xF0BF
- #define EM_LINELENGTH 0xF0C1
- #define EM_REPLACESEL 0xF0C2
- #define EM_GETLINE 0xF0C4
- /**
- * def EM_LIMITTEXT
- * brief Set text limit of an edit control.
- *
- * code
- * EM_LIMITTEXT
- * int newLimit;
- *
- * wParam = (WPARAM)newLimit;
- * lParam = 0;
- * endcode
- *
- * param newLimit The new text limit of an edit control.
- */
- #define EM_LIMITTEXT 0xF0C5
- /**
- * def EM_REDO
- * brief Redo operation.
- *
- * code
- *
- * wParam = 0;
- * lParam = 0;
- * endcode
- *
- */
- #define EM_REDO 0xF0C6
- //#define EM_CANUNDO 0xF0C6
- /**
- * def EM_UNDO
- * brief Undo operation.
- *
- * code
- *
- * wParam = 0;
- * lParam = 0;
- * endcode
- *
- */
- #define EM_UNDO 0xF0C7
- #define EM_FMTLINES 0xF0C8
- #define EM_LINEFROMCHAR 0xF0C9
- #define EM_SETTABSTOPS 0xF0CB
- /**
- * def EM_SETPASSWORDCHAR
- * brief Defines the character that edit control uses in conjunction with
- * the ES_PASSWORD style.
- *
- * code
- * EM_SETPASSWORDCHAR
- * char passwdChar;
- *
- * wParam = (WPARAM)passwdChar;
- * lParam = 0;
- * endcode
- */
- #define EM_SETPASSWORDCHAR 0xF0CC
- #define EM_EMPTYUNDOBUFFER 0xF0CD
- #define EM_GETFIRSTVISIBLELINE 0xF0CE
- /**
- * def EM_SETREADONLY
- * brief Sets or removes the read-only style (ES_READONLY) in an edit control.
- *
- * code
- * EM_SETREADONLY
- * int readonly;
- *
- * wParam = (WPARAM)readonly;
- * lParam = 0;
- * endcode
- *
- * param readonly Indicates whether the edit control is read-only:
- * - Zeron
- * Not read-only.
- * - Non zeron
- * Read-only.
- */
- #define EM_SETREADONLY 0xF0CF
- #define EM_SETWORDBREAKPROC 0xF0D0
- #define EM_GETWORDBREAKPROC 0xF0D1
- /**
- * def EM_GETPASSWORDCHAR
- * brief Returns the character that edit controls uses in conjunction with
- * the ES_PASSWORD style.
- *
- * code
- * EM_GETPASSWORDCHAR
- *
- * wParam = 0;
- * lParam = 0;
- * endcode
- *
- * return The currently used password character
- */
- #define EM_GETPASSWORDCHAR 0xF0D2
- #define EM_SETMARGINS 0xF0D3
- #define EM_GETMARGINS 0xF0D4
- #define EM_SETLIMITTEXT EM_LIMITTEXT
- #define EM_GETLIMITTEXT 0xF0D5
- #define EM_POSFROMCHAR 0xF0D6
- #define EM_CHARFROMPOS 0xF0D7
- #define EM_SETIMESTATUS 0xF0D8
- #define EM_GETIMESTATUS 0xF0D9
- #define MEM_SCROLLCHANGE 0xF0DB
- #define MED_STATE_YES 0x0
- #define MED_STATE_NOUP 0x1
- #define MED_STATE_NODN 0x2
- #define MED_STATE_NO 0x3
- /**
- * def EM_SETTITLETEXT
- * brief Sets the title text displayed before content text.
- *
- * code
- * EM_SETTITLETEXT
- * const char *title;
- * int len;
- *
- * wParam = len;
- * lParam = (LPARAM)title;
- * endcode
- *
- * note Implemented for TextEdit control.
- */
- #define EM_SETTITLETEXT 0xF0DC
- /**
- * def EM_GETTITLETEXT
- * brief Gets the title text displayed before content text.
- *
- * code
- * EM_GETTITLETEXT
- * const char *buffer;
- * int len;
- *
- * wParam = len;
- * lParam = (LPARAM)buffer;
- * endcode
- *
- * param len should be length of buffer minus 1, left space for ' '
- * param buffer string buffer
- *
- *
- * return length of title
- * note Implemented for TextEdit control.
- */
- #define EM_GETTITLETEXT 0xF0DD
- /**
- * def EM_SETTIPTEXT
- * brief Sets the tip text displayed when content is empty.
- *
- * code
- * EM_SETTIPTEXT
- * const char *buffer;
- * int len;
- *
- * wParam = len;
- * lParam = (LPARAM)buffer;
- * endcode
- *
- */
- #define EM_SETTIPTEXT 0xF0DE
- /**
- * def EM_GETTIPTEXT
- * brief Gets the tip text displayed when content is empty.
- *
- * code
- * EM_GETTIPTEXT
- * const char *buffer;
- * int len;
- *
- * wParam = len;
- * lParam = (LPARAM)buffer;
- * endcode
- *
- * param len should be length of buffer minus 1, left space for ' '
- * param buffer string buffer
- *
- * return length of tip text
- */
- #define EM_GETTIPTEXT 0xF0DF
- #define EM_MSGMAX 0xF0E0
- /** @} end of ctrl_edit_msgs */
- /**
- * defgroup ctrl_edit_ncs Notification codes of edit control
- * @{
- */
- #define EN_ERRSPACE 255
- /**
- * def EN_CLICKED
- * brief Notifies a click in an edit control.
- *
- * An edit control sends the EN_CLICKED notification code when the user clicks
- * in an edit control.
- */
- #define EN_CLICKED 0x0001
- /**
- * def EN_DBLCLK
- * brief Notifies a double click in an edit control.
- *
- * An edit control sends the EN_CLICKED notification code when the user
- * double clicks in an edit control.
- */
- #define EN_DBLCLK 0x0002
- /**
- * def EN_SETFOCUS
- * brief Notifies the receipt of the input focus.
- *
- * The EN_SETFOCUS notification code is sent when an edit control receives
- * the input focus.
- */
- #define EN_SETFOCUS 0x0100
- /**
- * def EN_KILLFOCUS
- * brief Notifies the lost of the input focus.
- *
- * The EN_KILLFOCUS notification code is sent when an edit control loses
- * the input focus.
- */
- #define EN_KILLFOCUS 0x0200
- /**
- * def EN_CHANGE
- * brief Notifies that the text is altered.
- *
- * An edit control sends the EN_CHANGE notification code when the user takes
- * an action that may have altered text in an edit control.
- */
- #define EN_CHANGE 0x0300
- #define EN_UPDATE 0x0400
- /**
- * def EN_MAXTEXT
- * brief Notifies reach of maximum text limitation.
- *
- * The EN_MAXTEXT notification message is sent when the current text
- * insertion has exceeded the specified number of characters for the edit control.
- */
- #define EN_MAXTEXT 0x0501
- #define EN_HSCROLL 0x0601
- #define EN_VSCROLL 0x0602
- /**
- * def EN_ENTER
- * brief Notifies the user has type the ENTER key in a single-line edit control.
- */
- #define EN_ENTER 0x0700
- /** @} end of ctrl_edit_ncs */
- /* Edit control EM_SETMARGIN parameters */
- /**
- * def EC_LEFTMARGIN
- * brief Value of wParam. Specifies the margins to set.
- */
- #define EC_LEFTMARGIN 0x0001
- /**
- * def EC_RIGHTMARGIN
- * brief Value of wParam. Specifies the margins to set.
- */
- #define EC_RIGHTMARGIN 0x0002
- /**
- * def EC_USEFONTINFO
- * brief Value of wParam. Specifies the margins to set.
- */
- #define EC_USEFONTINFO 0xffff
- /* wParam of EM_GET/SETIMESTATUS */
- /**
- * def EMSIS_COMPOSITIONSTRING
- * brief Indicates the type of status to retrieve.
- */
- #define EMSIS_COMPOSITIONSTRING 0x0001
- /* lParam for EMSIS_COMPOSITIONSTRING */
- /**
- * def EIMES_GETCOMPSTRATONCE
- * brief lParam for EMSIS_COMPOSITIONSTRING.
- */
- #define EIMES_GETCOMPSTRATONCE 0x0001
- /**
- * def EIMES_CANCELCOMPSTRINFOCUS
- * brief lParam for EMSIS_COMPOSITIONSTRING.
- */
- #define EIMES_CANCELCOMPSTRINFOCUS 0x0002
- /**
- * def EIMES_COMPLETECOMPSTRKILLFOCUS
- * brief lParam for EMSIS_COMPOSITIONSTRING.
- */
- #define EIMES_COMPLETECOMPSTRKILLFOCUS 0x0004
- /** @} end of ctrl_edit */
- #endif /* _CTRL_EDIT || _CTRL_MEDIT */
- /****** Progress Bar Control *************************************************/
- #ifdef _CTRL_PROGRESSBAR
- /**
- * defgroup ctrl_progbar ProgressBar control
- * @{
- */
- /**
- * def CTRL_PROGRESSBAR
- * brief The class name of progressbar control.
- */
- #define CTRL_PROGRESSBAR ("progressbar")
- #define PB_OKAY 0
- #define PB_ERR -1
- /**
- * defgroup ctrl_progbar_styles Styles of progressbar control
- * @{
- */
- /**
- * def PBS_NOTIFY
- * brief Notifies the parent window.
- *
- * Sends the parent window notification messages when
- * the user clicks or double-clicks the control.
- */
- #define PBS_NOTIFY 0x0001L
- /**
- * def PBS_VERTICAL
- * brief Creates progressbar vertically.
- */
- #define PBS_VERTICAL 0x0002L
- /** @} end of ctrl_progbar_styles */
- /**
- * defgroup ctrl_progbar_msgs Messages of progressbar control
- * @{
- */
- /**
- * def PBM_SETRANGE
- * brief Sets the limits of the range.
- *
- * Sets the upper and lower limits of the progress bar control's range,
- * and redraws the bar to reflect the new ranges.
- *
- * code
- * PBM_SETRANGE
- * int min, max;
- *
- * wParam = (WPARAM)min;
- * lParam = (LPARAM)max;
- * endcode
- *
- * param min The lower limit of the progress bar.
- * param max The upper limit of the progress bar.
- *
- * return PB_OKAY on success, else PB_ERR.
- */
- #define PBM_SETRANGE 0xF0A0
- /**
- * def PBM_SETSTEP
- * brief Specifies the step increment for a progress bar control.
- *
- * code
- * PBM_SETSTEP
- * int stepinc;
- *
- * wParam = (WPARAM)stepinc;
- * lParam = 0;
- * endcode
- *
- * param stepinc Step increment for a progress bar control.
- * return PB_OKAY on success, else PB_ERR.
- */
- #define PBM_SETSTEP 0xF0A1
- /**
- * def PBM_SETPOS
- * brief Sets the progress bar control's current position.
- *
- * Sets the progress bar control's current position as specified by nPos,
- * and redraw the bar to reflect the new position.
- *
- * code
- * PBM_SETPOS
- * int nPos;
- *
- * wParam = (WPARAM)nPos;
- * lParam = 0;
- * endcode
- *
- * param nPos The progress bar control's current position.
- * return Always be PB_OKAY.
- */
- #define PBM_SETPOS 0xF0A2
- /**
- * def PBM_DELTAPOS
- * brief Advances the progress bar control's current position.
- *
- * Advances the progress bar control's current position as specified by posInc,
- * and redraw the bar to reflect the new position.
- *
- * code
- * PBM_DELTAPOS
- * int posInc;
- *
- * wParam = (WPARAM)posInc;
- * lParam = 0;
- * endcode
- *
- * param posInc The progress bar control's position increment.
- * return Always be PB_OKAY.
- */
- #define PBM_DELTAPOS 0xF0A3
- /**
- * def PBM_STEPIT
- * brief Advances the current position by the step increment.
- *
- * Advances the current position for a progress bar control by
- * the step increment, and redraw the bar to reflect the new position.
- *
- * code
- * PBM_STEPIT
- *
- * wParam = 0;
- * lParam = 0;
- * endcode
- *
- * return Always be PB_OKAY.
- */
- #define PBM_STEPIT 0xF0A4
- #define PBM_MSGMAX 0xF0B0
- /** @} end of ctrl_progbar_msgs */
- /**
- * defgroup ctrl_progbar_ncs Notification codes of progressbar control
- * @{
- */
- /**
- * def PBN_REACHMAX
- * brief Notifies reach of maximum limit.
- *
- * The PBN_REACHMAX notification code is sent when the progressbar reachs its maximum limit.
- */
- #define PBN_REACHMAX 1
- /**
- * def PBN_REACHMIN
- * brief Notifies reach of minimum limit.
- *
- * The PBN_REACHMIN notification code is sent when the progressbar reachs its minimum limit.
- */
- #define PBN_REACHMIN 2
- /** @} end of ctrl_progbar_ncs */
- /** @} end of ctrl_progbar */
- #endif /* _CTRL_PROGRESSBAR */
- /****** List Box Control *****************************************************/
- #ifdef _CTRL_LISTBOX
- /**
- * defgroup ctrl_listbox ListBox control
- *
- *
- * @{
- */
- /**
- * def CTRL_LISTBOX
- * brief The class name of listbox control.
- */
- #define CTRL_LISTBOX ("listbox")
- /* Listbox return value */
- #define LB_OKAY 0
- #define LB_ERR (-1)
- #define LB_ERRSPACE (-2)
- #define CMFLAG_BLANK 0x0000
- #define CMFLAG_CHECKED 0x0001
- #define CMFLAG_PARTCHECKED 0x0002
- #define CMFLAG_MASK 0x000F
- #define IMGFLAG_BITMAP 0x0010
- /** Structrue of the listbox item info */
- typedef struct _LISTBOXITEMINFO
- {
- /** Item string */
- char* string;
- /**
- * Check mark and image flag. It can be one of the following values:
- * - CMFLAG_BLANK
- * The item is blank.
- * - CMFLAG_CHECKED
- * The item is checked.
- * - CMFLAG_PARTCHECKED
- * The item is partly checked.
- *
- * For LBS_ICON list box, if you want to display bitmap other than icon,
- * you can OR'd a cmFlag whit a IMGFLAG_BITMAP.
- */
- DWORD cmFlag; /* check mark flag */
- /** Handle to the icon (or pointer to bitmap object) of the item */
- HICON hIcon; /* handle to icon */
- } LISTBOXITEMINFO;
- /**
- * var typedef LISTBOXITEMINFO* PLISTBOXITEMINFO;
- * brief Data type of the pointer to a LISTBOXITEMINFO.
- */
- typedef LISTBOXITEMINFO* PLISTBOXITEMINFO;
- /**
- * defgroup ctrl_listbox_styles Styles of listbox control
- * @{
- */
- /**
- * def LBS_NOTIFY
- * brief Notifies the parent window.
- *
- * Causes the list box to notify the list box parent window
- * with a notification message when the user clicks or doubleclicks an item.
- */
- #define LBS_NOTIFY 0x0001L
- /**
- * def LBS_SORT
- * brief Sorts strings alphabetically.
- *
- * Causes the list box to sort strings alphabetically that are
- * added to the list box with an LB_ADDSTRING message.
- */
- #define LBS_SORT 0x0002L
- /**
- * def LBS_MULTIPLESEL
- * brief Causes the list box to allow the user to select multiple items.
- */
- #define LBS_MULTIPLESEL 0x0008L
- /**
- * def LBS_CHECKBOX
- * brief Displays a check box in an item.
- */
- #define LBS_CHECKBOX 0x1000L
- /**
- * def LBS_USEICON
- * brief Displays an icon or bitmap in an item.
- */
- #define LBS_USEICON 0x2000L
- /**
- * def LBS_AUTOCHECK
- * brief If the list box has LBS_CHECKBOX style, this
- * style tell the box to auto-switch the check box between
- * checked or un-checked when the user click the check mark box of an item.
- */
- #define LBS_AUTOCHECK 0x4000L
- #define LBS_AUTOCHECKBOX (LBS_CHECKBOX | LBS_AUTOCHECK)
- /**
- * def LBS_SBALWAYS
- * brief The list box with LBS_SBALWAYS style will always show vertical scrollbar.
- */
- #define LBS_SBALWAYS 0x8000L
- #define LBS_OWNERDRAWFIXED 0x0010L
- #define LBS_OWNERDRAWVARIABLE 0x0020L
- #define LBS_USETABSTOPS 0x0080L
- #define LBS_MULTICOLUMN 0x0200L
- #define LBS_WANTKEYBOARDINPUT 0x0400L
- #define LBS_NOREDRAW 0x0004L
- #define LBS_HASSTRINGS 0x0040L
- #define LBS_NOINTEGRALHEIGHT 0x0100L
- #define LBS_EXTENDEDSEL 0x0800L
- /** @} end of ctrl_listbox_styles */
- /**
- * defgroup ctrl_listbox_msgs Messages of listbox control
- * @{
- */
- /**
- * def LB_ADDSTRING
- * brief Appends the specified string.
- *
- * An application sends an LB_ADDSTRING message to append an item
- * specified in the lParam parameter to a list box.
- *
- * For a text-only list box:
- *
- * code
- * LB_ADDSTRING
- * const char* text;
- *
- * wParam = 0;
- * lParam = (LPARAM)text;
- * endcode
- *
- * param text Pointer to the string of the item to be added.
- *
- * For a list box with check box or icon
- * (with LBS_CHECKBOX or LBS_USEICON styles):
- *
- * code
- * LB_ADDSTRING
- * PLISTBOXITEMINFO plbii;
- *
- * wParam = 0;
- * lParam = (LPARAM)plbii;
- * endcode
- *
- * param plbii Pointer to the listbox item info to be added.
- *
- * return The index of the new item on success, else the one of
- * the following error codes:
- *
- * - LB_ERRSPACE No memory can be allocated for new item.
- * - LB_ERR Invalid passed arguments.
- *
- */
- #define LB_ADDSTRING 0xF180
- /**
- * def LB_INSERTSTRING
- * brief Inserts an item to the list box.
- *
- * An application sends an LB_INSERTSTRING message to insert an item
- * into a list box. Unlike LB_ADDSTRING message, the LB_INSERTSTRING
- * message do not cause the list to be sorted.
- *
- * For a text-only list box:
- *
- * code
- * LB_INSERTSTRING
- * const char* text;
- *
- * wParam = index;
- * lParam = (LPARAM)text;
- * endcode
- *
- * param index Specifies the index of the position at which to insert the item.
- * param text Pointer to the string of the item to be inserted.
- *
- * For a list box with check box or icon
- * (with LBS_CHECKBOX or LBS_USEICON styles):
- *
- * code
- * LB_INSERTSTRING
- * int index;
- * PLISTBOXITEMINFO plbii;
- *
- * wParam = (WPARAM)index;
- * lParam = (LPARAM)plbii;
- * endcode
- *
- * param index Specifies the index of the position at which to insert the item.
- * param plbii Pointer to the listbox item info to be inserted.
- *
- * return The index of the new item on success, else the one of
- * the following error codes:
- *
- * - LB_ERRSPACE No memory can be allocated for new item.
- * - LB_ERR Invalid passed arguments.
- *
- */
- #define LB_INSERTSTRING 0xF181
- /**
- * def LB_DELETESTRING
- * brief Removes an item from the list box.
- *
- * An application sends an LB_DELETESTRING message to a list box
- * to remove from the list box.
- *
- * code
- * LB_DELETESTRING
- * int delete;
- *
- * wParam = (WPARAM)delete;
- * lParam = 0;
- * endcode
- *
- * param delete The index of the listbox item to be deleted.
- *
- * return LB_OKAY on success, else LB_ERR to indicate you passed an invalid index.
- */
- #define LB_DELETESTRING 0xF182
- #define LB_SELITEMRANGEEX 0xF183
- /**
- * def LB_RESETCONTENT
- * brief Removes the contents of a list box.
- *
- * An application sends an LB_RESETCONTENT message to remove the all items
- * in a list box.
- *
- * code
- * LB_RESETCONTENT
- *
- * wParam = 0;
- * lParam = 0;
- * endcode
- *
- * return Always be zero.
- */
- #define LB_RESETCONTENT 0xF184
- /**
- * def LB_GETSEL
- * brief Gets the selected state for an specified item.
- *
- * An application sends an LB_GETSEL message to a list box to get the selected
- * state for an item specified in the wParam parameter.
- *
- * code
- * LB_GETSEL
- * int index;
- *
- * wParam = (WPARAM)index;
- * lParam = 0;
- * endcode
- *
- * param index The index of the specified item.
- *
- * return The state of the specified item:
- * - 0n Not selected.
- * - >0n Selected.
- * - LB_ERRn Invalid index.
- */
- #define LB_GETSEL 0xF187
- /**
- * def LB_SETSEL
- * brief Selects an item in a multiple-selection list box.
- *
- * An application sends an LB_SETSEL message to select an item
- * in a multiple-selection list box and scroll it into view if necessary.
- *
- * code
- * LB_SETSEL
- * int index, sel
- *
- * wParam = (WPARAM)sel;
- * lParam = (LPARAM)index;
- * endcode
- *
- * param sel Indicates the changes to be made to the listbox item,
- * can be one of the following values:
- * - -1n If the item has been selected, makes it unselected, vice versa.
- * - 0n Makes the item unselected.
- * - othern Makes the item selected.
- * param index The index of the item.
- *
- * return LB_OKAY on success, else LB_ERR to indicate you passed an invalid index
- * or the list box has no LBS_MULTIPLESEL style.
- */
- #define LB_SETSEL 0xF185
- /**
- * def LB_GETCURSEL
- * brief Gets the index of the currently selected or highlighted item.
- *
- * An application sends an LB_GETCURSEL message to a list box to get the index of
- * the currently selected item, if there is one, in a single-selection list box.
- * For multiple-selection list box, appliction send an LB_GETCURSEL message to a
- * list box to get the index of the current highlighted item.
- *
- * code
- * LB_GETCURSEL
- *
- * wParam = 0;
- * lParam = 0;
- * endcode
- *
- * return The index of the currently selected item for single-selection list box;
- * Eles the index of the highlighted item for multiple-selection list box.
- */
- #define LB_GETCURSEL 0xF188
- /**
- * def LB_SETCURSEL
- * brief Selects an item.
- *
- * An application sends an LB_SETCURSEL message to a list box to
- * select an item and scroll it into view, if necessary.
- *
- * code
- * LB_SETCURSEL
- * int cursel;
- *
- * wParam = (WPARAM)cursel;
- * lParam = 0;
- * endcode
- *
- * param cursel The index of the item to be selected and hilighted.
- *
- * return The old index of the item selected on error, else LB_ERR to
- * indicate an error occurred.
- */
- #define LB_SETCURSEL 0xF186
- /**
- * def LB_GETTEXT
- * brief Retrieves the text of an item in list box.
- *
- * An application sends an LB_GETTEXT message to a list box to retrieve the text
- * of an item.
- *
- * code
- * LB_GETTEXT
- * int index;
- * char *string;
- *
- * wParam = (WPARAM)index;
- * lParam = (LPARAM)string;
- * endcode
- *
- * param index The index of the selected item.
- * param string Pointer to the string buffer. The buffer should be large enough
- * to contain the text of the item.
- *
- * return One of the following values:
- * - LB_OKAYn Success.
- * - LB_ERRn Invalid item index.
- *
- * sa LB_GETTEXTLEN
- */
- #define LB_GETTEXT 0xF189
- /**
- * def LB_GETTEXTLEN
- * brief Gets the length of text of item specified in a list box.
- *
- * An application sends an LB_GETTEXTLEN message to a list box to get the length
- * of text of the item specified in the a wParam parameter.
- *
- * code
- * LB_GETTEXTLEN
- * int index;
- *
- * wParam = (WPARAM)index;
- * lParam = 0;
- * endcode
- *
- * param index The index of the specified item.
- *
- * return The length of the strings on success, else LB_ERR to indicate invalid index.
- */
- #define LB_GETTEXTLEN 0xF18A
- /**
- * def LB_GETCOUNT
- * brief Gets the number of items in the list box.
- *
- * An application sends an LB_GETCOUNT message to a list box to get the number
- * of items in the list box.
- *
- * code
- * LB_GETCOUNT
- *
- * wParam = 0;
- * lParam = 0;
- * endcode
- *
- * return The number of items in the listbox.
- */
- #define LB_GETCOUNT 0xF18B
- #define LB_SELECTSTRING 0xF18C
- #define LB_DIR 0xF18D
- /**
- * def LB_GETTOPINDEX
- * brief Gets the index to the first visible item in the list box.
- *
- * An application sends an LB_GETTOPINDEX message to get the index to the first
- * visible item in the list box. Initially, the first visible item is item 0, but
- * this changes as the list box is scrolled.
- *
- * code
- * LB_GETTOPINDEX
- *
- * wParam = 0;
- * lParam = 0;
- * endcode
- *
- * return The index of the first visible item in the listbox.
- */
- #define LB_GETTOPINDEX 0xF18E
- /**
- * def LB_FINDSTRING
- * brief Searchs a specified string.
- *
- * An application sends an LB_FINDSTRING message to search a list box for an item
- * that begins with the characters specified in the lParam parameter. The wParam
- * parameter specifies the zero-based index of the item before the first item to
- * be searched; The lParam parameter specifies a pointer to a null-terminated
- * string that contains the prefix to search for.
- *
- * code
- * LB_FINDSTRING
- * int index;
- * char *string;
- *
- * wParam = (WPARAM)index;
- * lParam = (LPARAM)string;
- * endcode
- *
- * param index The index of the item to be searched.
- * param string The string of the item to be searched.
- *
- * return The index of the matched item; LB_ERR for not found.
- */
- #define LB_FINDSTRING 0xF18F
- /**
- * def LB_GETSELCOUNT
- * brief Gets the number of selected items in a multiple-selection list box.
- *
- * An application sends an LB_GETSELCOUNT message to a list box to get the number
- * of selected items in a multiple-selection list box.
- *
- * code
- * LB_GETSELCOUNT
- *
- * wParam = 0;
- * lParam = 0;
- * endcode
- *
- * return The number of selected items in the multiple-selection listbox.
- */
- #define LB_GETSELCOUNT 0xF190
- /**
- * def LB_GETSELITEMS
- * brief Gets the numbers of selected items.
- *
- * An application sends an LB_GETSELITEMS message to a list box to fill a buffer
- * with an array of integers that specify the item numbers of selected items in
- * a multiple-selection list box.
- *
- * code
- * LB_GETSELITEMS
- * int nItem;
- * int *pInt;
- *
- * wParam = (WPARAM)nItem;
- * lParam = (LPARAM)pInt;
- * endcode
- *
- * param nItem The maximum integer numbers wanted.
- * param pInt The buffer of an array of integers to save the indices of selected items.
- *
- * return The number of selected items.
- */
- #define LB_GETSELITEMS 0xF191
- #define LB_SETTABSTOPS 0xF192
- #define LB_GETHORIZONTALEXTENT 0xF193
- #define LB_SETHORIZONTALEXTENT 0xF194
- #define LB_SETCOLUMNWIDTH 0xF195
- #define LB_ADDFILE 0xF196
- /**
- * def LB_SETTOPINDEX
- * brief Ensures that a particular item in it is visible.
- *
- * An application sends an LB_SETTOPINDEX message to a list box to ensure that a
- * particular item in it is visible. The item is specified in the wParam parameter.
- * The list box scrolls so that either the specified item appears at the top of
- * the list box or the maximum scroll range has been reached.
- *
- * code
- * LB_SETTOPINDEX
- * int index;
- *
- * wParam = (WPARAM)index;
- * lParam = 0;
- * endcode
- *
- * param index The index of the particular item to be set.
- *
- * return Always be zero.
- */
- #define LB_SETTOPINDEX 0xF197
- /**
- * def LB_GETITEMRECT
- * brief Retrieves the dimensions of the rectangle.
- *
- * An application sends an LB_GETITEMRECT message to a list box to retrieve
- * the dimensions of the rectangle that bounds an item as it is currently
- * displayed in the list box window. The item is specified in the wParam
- * parameter, and a pointer to a RECT structure is given in the lParam parameter.
- *
- * code
- * LB_GETITEMRECT
- * int index;
- * RECT *rcItem;
- *
- * wParam = (WPARAM)index;
- * lParam = (LPARAM)rcItem;
- * endcode
- *
- * param index The index of the specified item.
- * param rcItem Pointer to the buffer used for storing the item rect;
- *
- * return LB_OKAY on success; LB_ERR on error.
- */
- #define LB_GETITEMRECT 0xF198
- /**
- * def LB_GETITEMDATA
- * brief Gets item data in a list box if the box has LBS_CHECKBOX
- * and/or LBS_USEICON styles.
- *
- * An application sends LB_GETITEMDATA message to a list box to retrive the
- * check box flag and the handle of icon. Note that the text of the item
- * will not be returned, i.e., the field of a string of LISTBOXITEMINFO
- * structure will be ignored.
- *
- * code
- * LB_GETITEMDATA
- * int index;
- * PLISTBOXITEMINFO plbii;
- *
- * wParam = (WPARAM)index;
- * lParam = (LPARAM)plbii;
- * endcode
- *
- * param index The index of the specified item.
- * param plbii Pointer to the buffer used for storing the item data of the
- * specified item.
- *
- * return LB_OKAY on success; LB_ERR on error.
- *
- * sa LISTBOXITEMINFO
- */
- #define LB_GETITEMDATA 0xF199
- /**
- * def LB_SETITEMDATA
- * brief Sets item data in a list box if the box has LBS_CHECKBOX
- * and/or LBS_USEICON styles.
- *
- * An application sends LB_SETITEMDATA message to a list box to set the
- * check box flag and the handle of icon. Note that the text of the item
- * will not be changed, i.e., the field of a string of LISTBOXITEMINFO
- * structure will be ignored.
- *
- * code
- * LB_SETITEMDATA
- * int index;
- * PLISTBOXITEMINFO plbii;
- *
- * wParam = (WPARAM)index;
- * lParam = (LPARAM)plbii;
- * endcode
- *
- * param index The index of the specified item.
- * param plbii Pointer to the buffer used for setting the item info of the
- * specified item.
- *
- * return LB_OKAY on success; LB_ERR on error.
- *
- * sa LISTBOXITEMINFO
- */
- #define LB_SETITEMDATA 0xF19A
- #define LB_SELITEMRANGE 0xF19B
- #define LB_SETANCHORINDEX 0xF19C
- #define LB_GETANCHORINDEX 0xF19D
- /**
- * def LB_SETCARETINDEX
- * brief Sets the focus rectangle to the item at the specified index.
- *
- * An application sends an LB_SETCARETINDEX message to set the focus rectangle
- * to the item at the specified index in a multiple-selection list box.
- *
- * code
- * LB_SETCARETINDEX
- * int index;
- *
- * wParam = (WPARAM)index;
- * lParam = 0;
- * endcode
- */
- #define LB_SETCARETINDEX 0xF19E
- /**
- * def LB_GETCARETINDEX
- * brief Determines the index of the item that has the focus rectangle.
- *
- * An application sends an LB_GETCARETINDEX message to a list box to determine
- * the index of the item that has the focus rectangle in a multiple-selection
- * list box.
- *
- * code
- * LB_GETCARETINDEX
- *
- * wParam = 0;
- * lParam = 0;
- * endcode
- *
- * return The index of the item that has the focus rectangle.
- */
- #define LB_GETCARETINDEX 0xF19F
- /**
- * def LB_SETITEMHEIGHT
- * brief Sets the height of all items.
- *
- * An application sends an LB_SETITEMHEIGHT message to set the height of
- * all items in a list box.
- *
- * code
- * LB_SETITEMHEIGHT
- * int itemHeight;
- *
- * wParam = 0;
- * lParam = (LPARAM)itemHeight;
- * endcode
- *
- * param itemHeight New height of item.
- *
- * return The effective height of item.
- */
- #define LB_SETITEMHEIGHT 0xF1A0
- /**
- * def LB_GETITEMHEIGHT
- * brief Gets the height in pixels of an item specified in the wParam parameter.
- *
- * An application sends an LB_GETITEMHEIGHT message to a list box to get the
- * height in pixels of an item specified in the wParam parameter.
- *
- * code
- * LB_GETITEMHEIGHT
- *
- * wParam = 0;
- * lParam = 0;
- * endcode
- *
- * return The height of item in the listbox.
- */
- #define LB_GETITEMHEIGHT 0xF1A1
- /**
- * def LB_FINDSTRINGEXACT
- * brief Searchs for an item that exactly matches the characters specified.
- *
- * An application sends an LB_FINDSTRINGEXACT message to a list box to search
- * it for an item that exactly matches the characters specified in the lParam parameter.
- *
- * code
- * LB_FINDSTRINGEXACT
- * int index;
- * const char *string;
- *
- * wParam = (WPARAM)index;
- * lParam = (LPARAM)string;
- * endcode
- *
- * param index The index of the specified item.
- * param string The string of the item to be searched for.
- *
- * return The index of the found item on success, else LB_ERR.
- */
- #define LB_FINDSTRINGEXACT 0xF1A2
- #define LB_SETLOCALE 0xF1A5
- #define LB_GETLOCALE 0xF1A6
- #define LB_SETCOUNT 0xF1A7
- #define LB_INITSTORAGE 0xF1A8
- #define LB_ITEMFROMPOINT 0xF1A9
- /**
- * def LB_SETTEXT
- * brief Sets text of the specified item.
- *
- * code
- * LB_SETTEXT
- * int index;
- * const char *string;
- *
- * wParam = (WPARAM)index;
- * lParam = (LPARAM)string;
- * endcode
- *
- * param index The index of the specified item.
- * param string The string of the item to be set.
- *
- * return One of the following values:
- * - LB_OKAYn Success
- * - LB_ERRn Invalid item index or memory allocation error.
- */
- #define LB_SETTEXT 0xF1AA
- /**
- * def LB_GETCHECKMARK
- * brief Gets check mark status of an item.
- *
- * code
- * LB_GETCHECKMARK
- * int index;
- *
- * wParam = (WPARAM)index;
- * lParam = 0;
- * endcode
- *
- * param index The index of the specified item.
- *
- * return The check mark status of specified item on success; LB_ERR on error.
- *
- * retval LB_ERR Invalid item index or the list box have no LBS_CHECKBOX style.
- * retval CMFLAG_CHECKED The item is checked.
- * retval CMFLAG_PARTCHECKED The item is partly checked.
- * retval CMFLAG_BLANK The item is not checked.
- */
- #define LB_GETCHECKMARK 0xF1AB
- /**
- * def LB_SETCHECKMARK
- * brief Sets check mark status of an item.
- *
- * code
- * LB_SETCHECKMARK
- * int index, status;
- *
- * wParam = (WPARAM)index;
- * lParam = (LPARAM)status;
- * endcode
- *
- * param index The index of the specified item.
- * param status The new check mark status, can be one of the followings.
- * - CMFLAG_CHECKEDn The item is checked.
- * - CMFLAG_PARTCHECKEDn The item is partly checked.
- *
- * return One of the following values:
- * - LB_OKAYn
- * Success
- * - LB_ERRn
- * Invalid item index or this list box have no LBS_CHECKBOX style.
- */
- #define LB_SETCHECKMARK 0xF1AC
- /**
- * def LB_GETITEMADDDATA
- * brief Gets the 32-bit data value associated with an item.
- *
- * An application sends an LB_GETITEMADDDATA message to a list box to get the
- * 32-bit data value the list box has stored for the item with index of
- * a wParam; By default this is zero. An application must set the
- * item data value by sending an LB_SETITEMADDDATA message to the list box for
- * this value to have meaning.
- *
- * code
- * LB_GETITEMADDDATA
- * int index;
- *
- * wParam = (WPARAM)index;
- * lParam = 0;
- * endcode
- *
- * param index The index of the specified item.
- *
- * return The 32-bit data value associated with an item on success, otherwise
- * LB_ERR to indicate an error.
- */
- #define LB_GETITEMADDDATA 0xF1AD
- /**
- * def LB_SETITEMADDDATA
- * brief Associates a 32-bit data value with an item.
- *
- * An application sends an LB_SETITEMADDDATA message to associate a 32-bit data
- * value specified in the a lParam parameter with an item in the list box.
- *
- * code
- * LB_SETITEMADDDATA
- * int index;
- * DWORD addData;
- *
- * wParam = (WPARAM)index;
- * lParam = (LPARAM)addData;
- * endcode
- *
- * param index The index of the specified item.
- * param addData the 32-bit data value which will associated with the item.
- *
- * return One of the following values:
- * - LB_OKAYn Success
- * - LB_ERRn Invalid item index
- */
- #define LB_SETITEMADDDATA 0xF1AE
- /**
- * def LB_SETSTRCMPFUNC
- * brief Sets the STRCMP function used to sort items.
- *
- * An application sends an LB_SETSTRCMPFUNC message to set a
- * new STRCMP function to sort items.
- *
- * Note that you should send this message before adding
- * any item to the list box control.
- *
- * code
- * static int my_strcmp (const char* s1, const char* s2, size_t n)
- * {
- * ...
- * return 0;
- * }
- *
- * LB_SETSTRCMPFUNC
- *
- * wParam = 0;
- * lParam = (LPARAM)my_strcmp;
- * endcode
- *
- * param my_strcmp Your own function to compare two strings.
- *
- * return One of the following values:
- * - LB_OKAYn Success
- * - LB_ERRn Not an empty list box.
- */
- #define LB_SETSTRCMPFUNC 0xF1AF
- #define LB_MSGMAX 0xF1B0
- /** @} end of ctrl_listbox_msgs */
- /**
- * defgroup ctrl_listbox_ncs Notification codes of listbox control
- * @{
- */
- /**
- * def LBN_ERRSPACE
- * brief Indicates that memory is not enough.
- *
- * A list box sends an LBN_ERRSPACE notification message to its parent window
- * when it cannot allocate enough memory to complete the current operation.
- */
- #define LBN_ERRSPACE 255
- /**
- * def LBN_SELCHANGE
- * brief Indicates change due to mouse or keyboard user input.
- *
- * A list box created with the LBS_NOTIFY style sends an LBN_SELCHANGE
- * notification message to its parent window when the selection is about to
- * change due to mouse or keyboard user input.
- */
- #define LBN_SELCHANGE 1
- /**
- * def LBN_DBLCLK
- * brief Indicates double click on an item.
- *
- * A list box created with the LBS_NOTIFY style sends an LBN_DBLCLK notification
- * message to its parent window when the user double-clicks a string in it.
- */
- #define LBN_DBLCLK 2
- /**
- * def LBN_SELCANCEL
- * brief Indicates cancel of the selection in the list box.
- *
- * A list box created with the LBS_NOTIFY style sends an LBN_SELCANCEL
- * notification message to its parent window when the user cancels the selection
- * in the list box.
- */
- #define LBN_SELCANCEL 3
- /**
- * def LBN_SETFOCUS
- * brief Indicates gain of input focus.
- *
- * A list box sends an LBN_SETFOCUS notification message to its parent window
- * when the list box gains the input focus.
- */
- #define LBN_SETFOCUS 4
- /**
- * def LBN_KILLFOCUS
- * brief Indicates loss of input focus.
- *
- * A list box sends an LBN_KILLFOCUS notification message to its parent window
- * when the list box loses the input focus.
- */
- #define LBN_KILLFOCUS 5
- /**
- * def LBN_CLICKCHECKMARK
- * brief Indicates click on the check mark.
- */
- #define LBN_CLICKCHECKMARK 6
- /**
- * def LBN_CLICKED
- * brief Indicates click on the string.
- */
- #define LBN_CLICKED 7
- /**
- * def LBN_ENTER
- * brief Indicates the user has pressed the ENTER key.
- */
- #define LBN_ENTER 8
- /** @} end of ctrl_listbox_ncs */
- /** @} end of ctrl_listbox */
- #endif /* _CTRL_LISTBOX */
- /****** Property Sheet Control ***********************************************/
- #ifdef _CTRL_PROPSHEET
- /**
- * defgroup ctrl_propsheet PropertySheet control
- * @{
- */
- /**
- * def CTRL_PROPSHEET
- * brief The class name of propsheet control.
- */
- #define CTRL_PROPSHEET ("propsheet")
- /**
- * defgroup ctrl_propsheet_styles Styles of propertysheet control
- * @{
- */
- /**
- * def PSS_SIMPLE
- * brief A simple property sheet control. All tabs of the control
- * will have the same width.
- */
- #define PSS_SIMPLE 0x0000L
- /**
- * def PSS_COMPACTTAB
- * brief Compact tab style. The width of a tab is adaptive to the tab title.
- */
- #define PSS_COMPACTTAB 0x0001L
- /** @} end of ctrl_propsheet_styles */
- /**
- * defgroup ctrl_propsheet_msgs Messages of propertysheet control
- * @{
- */
- #define PS_OKAY 0
- #define PS_ERR (-1)
- /**
- * def PSM_GETACTIVEPAGE
- * brief Gets the handle of current active page.
- *
- * Sends this message to retreive the propsheet window's active page.
- *
- * code
- * PSM_GETACTIVEPAGE
- *
- * wParam = 0;
- * lParam = 0;
- * endcode
- *
- * return The handle to the active page; HWND_INVALID if no such a page.
- */
- #define PSM_GETACTIVEPAGE 0xF1C0L
- /**
- * def PSM_SETACTIVEINDEX
- * brief Changes the active page by index.
- *
- * Sends this message to change the propsheet window's active page.
- *
- * code
- * PSM_SETACTIVEINDEX
- * int page;
- *
- * wParam = (WPARAM)page;
- * lParam = 0;
- * endcode
- *
- * param page Index of the page to set.
- *
- * return PS_OKAY on success, otherwise PS_ERR.
- */
- #define PSM_SETACTIVEINDEX 0xF1C2L
- /**
- * def PSM_GETPAGE
- * brief Gets the handle of a page by index.
- *
- * Sends this message to retreive the handle to a page by index.
- *
- * code
- * PSM_GETPAGE
- * int index;
- *
- * wParam = index;
- * lParam = 0;
- * endcode
- *
- * param index The index of the page.
- *
- * return The handle to the page; HWND_INVALID if no such a page.
- */
- #define PSM_GETPAGE 0xF1C3L
- /**
- * def PSM_GETACTIVEINDEX
- * brief Gets the index of the current active page.
- *
- * Sends this message to retreive the index of the propsheet window's active page.
- *
- * code
- * PSM_GETACTIVEINDEX
- *
- * wParam = 0;
- * lParam = 0;
- * endcode
- *
- * return The index number of the active page.
- */
- #define PSM_GETACTIVEINDEX 0xF1C4L
- /**
- * def PSM_GETPAGEINDEX
- * brief Gets the index of a page by handle.
- *
- * Sends this message to retreive the index to a page by handle.
- *
- * code
- * PSM_GETPAGEINDEX
- * HWND hwnd;
- *
- * wParam = hwnd;
- * lParam = 0;
- * endcode
- *
- * param hwnd The handle of the page.
- *
- * return The index of the page; PS_ERR if no such a page.
- */
- #define PSM_GETPAGEINDEX 0xF1C5L
- /**
- * def PSM_GETPAGECOUNT
- * brief Gets the number of pages of the propsheet.
- *
- * Sends this message to retreive the number of pages currently in the propsheet.
- *
- * code
- * PSM_GETPAGECOUNT
- *
- * wParam = 0;
- * lParam = 0;
- * endcode
- *
- * return The number of pages in the propsheet.
- */
- #define PSM_GETPAGECOUNT 0xF1C6L
- /**
- * def PSM_GETTITLELENGTH
- * brief Gets the length of a page title.
- *
- * Sends this message to retreive the title length of a page.
- *
- * code
- * PSM_GETTITLELENGTH
- * int index;
- *
- * wParam = (WPARAM)index;
- * lParam = 0;
- * endcode
- *
- * param index The index number of the page in the propsheet.
- *
- * return The length of the page in the propsheet; PS_ERR if no such a page.
- */
- #define PSM_GETTITLELENGTH 0xF1C7L
- /**
- * def PSM_GETTITLE
- * brief Gets a page title.
- *
- * Sends this message to retreive the title of a page.
- *
- * code
- * PSM_GETTITLE
- * int index;
- * char *buffer;
- *
- * wParam = (WPARAM)index;
- * lParam = (LPARAM)buffer;
- * endcode
- *
- * param index The index number of the page in the propsheet.
- * param buffer The buffer storing the title string.
- *
- * return PS_OKAY on success; PS_ERR if no such a page.
- */
- #define PSM_GETTITLE 0xF1C8L
- /**
- * def PSM_SETTITLE
- * brief Sets a page title.
- *
- * Sends this message to specify the title of a page.
- *
- * code
- * PSM_SETTITLE
- * int index;
- * char *buffer;
- *
- * wParam = (WPARAM)index;
- * lParam = (LPARAM)buffer;
- * endcode
- *
- * param index The index number of the page in the propsheet.
- * param buffer The string buffer storing the title.
- *
- * return PS_OKAY on success; PS_ERR if no such a page.
- */
- #define PSM_SETTITLE 0xF1C9L
- /**
- * def PSM_ADDPAGE
- * brief Adds a page to the propsheet.
- *
- * Sends this message to add a page to the propsheet.
- *
- * code
- * PSM_ADDPAGE
- * DLGTEMPLATE *dlg_tmpl;
- * WNDPROC proc;
- *
- * wParam = (WPARAM)dlg_tmpl;
- * lParam = (LPARAM)proc;
- * endcode
- *
- * param hdlg The handle of the page window to be added in the propsheet.
- * param proc The window callback procedure of the page window.
- * Note that the procedure should call DefaultPageProc function
- * by default.
- *
- * return The index of the page added on success; PS_ERR on error.
- */
- #define PSM_ADDPAGE 0xF1D0L
- /**
- * def PSM_REMOVEPAGE
- * brief Removes a page from the propsheet.
- *
- * Sends this message to remove a page from the propsheet and destroys the
- * associated controls.
- *
- * code
- * PSM_REMOVEPAGE
- * int index;
- *
- * wParam = (WPARAM)index;
- * lParam = 0;
- * endcode
- *
- * param index The index number of the page to be removed from the propsheet.
- *
- * return If success, return PS_OKAY, otherwise PS_ERR.
- */
- #define PSM_REMOVEPAGE 0xF1D1L
- /**
- * def PSM_SHEETCMD
- * brief Sends a MSG_SHEETCMD message to all pages in the propsheet.
- *
- * If you send MSG_SHEETCMD message to the propsheet control, the control
- * will broadcast the message to all pages it contains. The page callback
- * procedure will receive the message and handle it. If one page return non-zero
- * value, the broadcast will be broken and the message will return a value
- * indicating which page returned error. The value will be equal to the page index
- * plus one.
- *
- * The PSM_SHEETCMD can be used by property sheet window, i.e., the container
- * of the property pages. The sheet can create three buttons, like
- * "Ok", "Cancel", and "Apply". When the user clicked the "Apply" or "Ok"
- * button, it can send a PSM_SHEETCMD message to the propsheet control, the
- * control will then send the message to all pages to notify pages to apply
- * the changes made by the user. If there are some errors, the page can return