| 1 | /* $Id: controls.h,v 1.6 2002-12-18 12:28:02 sandervl Exp $ */
|
|---|
| 2 | /*
|
|---|
| 3 | * Win32 common controls
|
|---|
| 4 | *
|
|---|
| 5 | * Copyright (c) 1999 Christoph Bratschi
|
|---|
| 6 | *
|
|---|
| 7 | */
|
|---|
| 8 |
|
|---|
| 9 | #ifndef __CONTROLS_H
|
|---|
| 10 | #define __CONTROLS_H
|
|---|
| 11 |
|
|---|
| 12 | #ifdef __cplusplus
|
|---|
| 13 | #include "win32wbase.h"
|
|---|
| 14 | #endif
|
|---|
| 15 |
|
|---|
| 16 | #define GetInfoPtr(hwnd) (GetWindowLongA(hwnd,0))
|
|---|
| 17 | #define SetInfoPtr(hwnd,data) \
|
|---|
| 18 | SetWindowLongA(hwnd,0,data)
|
|---|
| 19 |
|
|---|
| 20 | void CONTROLS_Register();
|
|---|
| 21 | void CONTROLS_Unregister();
|
|---|
| 22 |
|
|---|
| 23 | #define BUTTON_CONTROL 0
|
|---|
| 24 | #define STATIC_CONTROL 1
|
|---|
| 25 | #define SCROLLBAR_CONTROL 2
|
|---|
| 26 | #define LISTBOX_CONTROL 3
|
|---|
| 27 | #define COMBOLBOX_CONTROL 4
|
|---|
| 28 | #define COMBOBOX_CONTROL 5
|
|---|
| 29 | #define EDIT_CONTROL 6
|
|---|
| 30 | #define MDICLIENT_CONTROL 7
|
|---|
| 31 | #define DIALOG_CONTROL 8
|
|---|
| 32 | #define DESKTOP_CONTROL 9
|
|---|
| 33 | #define WINSWITCH_CONTROL 10
|
|---|
| 34 | #define ICONTITLE_CONTROL 11
|
|---|
| 35 | #define POPUPMENU_CONTROL 12
|
|---|
| 36 | #define MAX_CONTROLS 13
|
|---|
| 37 |
|
|---|
| 38 | #ifdef __cplusplus
|
|---|
| 39 | BOOL CONTROLS_IsControl(Win32BaseWindow *window, int control);
|
|---|
| 40 | #endif
|
|---|
| 41 |
|
|---|
| 42 | /* combo box */
|
|---|
| 43 |
|
|---|
| 44 | #define ID_CB_LISTBOX 1000
|
|---|
| 45 | #define ID_CB_EDIT 1001
|
|---|
| 46 |
|
|---|
| 47 | /* internal flags */
|
|---|
| 48 | #define CBF_DROPPED 0x0001
|
|---|
| 49 | #define CBF_BUTTONDOWN 0x0002
|
|---|
| 50 | #define CBF_NOROLLUP 0x0004
|
|---|
| 51 | #define CBF_MEASUREITEM 0x0008
|
|---|
| 52 | #define CBF_FOCUSED 0x0010
|
|---|
| 53 | #define CBF_CAPTURE 0x0020
|
|---|
| 54 | #define CBF_EDIT 0x0040
|
|---|
| 55 | #define CBF_NORESIZE 0x0080
|
|---|
| 56 | #define CBF_NOTIFY 0x0100
|
|---|
| 57 | #define CBF_NOREDRAW 0x0200
|
|---|
| 58 | #define CBF_SELCHANGE 0x0400
|
|---|
| 59 | #define CBF_NOEDITNOTIFY 0x1000
|
|---|
| 60 | #define CBF_NOLBSELECT 0x2000 /* do not change current selection */
|
|---|
| 61 | #define CBF_EUI 0x8000
|
|---|
| 62 |
|
|---|
| 63 | /* combo state struct */
|
|---|
| 64 | typedef struct
|
|---|
| 65 | {
|
|---|
| 66 | HWND self;
|
|---|
| 67 | HWND owner;
|
|---|
| 68 | UINT dwStyle;
|
|---|
| 69 | HWND hWndEdit;
|
|---|
| 70 | HWND hWndLBox;
|
|---|
| 71 | UINT wState;
|
|---|
| 72 | HFONT hFont;
|
|---|
| 73 | RECT textRect;
|
|---|
| 74 | RECT buttonRect;
|
|---|
| 75 | RECT droppedRect;
|
|---|
| 76 | INT droppedIndex;
|
|---|
| 77 | INT fixedOwnerDrawHeight;
|
|---|
| 78 | INT droppedWidth; /* last two are not used unless set */
|
|---|
| 79 | INT editHeight; /* explicitly */
|
|---|
| 80 | } HEADCOMBO,*LPHEADCOMBO;
|
|---|
| 81 |
|
|---|
| 82 | /* Note, that CBS_DROPDOWNLIST style is actually (CBS_SIMPLE | CBS_DROPDOWN) */
|
|---|
| 83 | #define CB_GETTYPE( lphc ) ((lphc)->dwStyle & (CBS_DROPDOWNLIST))
|
|---|
| 84 |
|
|---|
| 85 | extern BOOL COMBO_FlipListbox( LPHEADCOMBO, BOOL, BOOL );
|
|---|
| 86 | extern BOOL COMBO_RollupListbox( LPHEADCOMBO lphc);
|
|---|
| 87 |
|
|---|
| 88 | #endif // __CONTROLS_H
|
|---|