Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
3.2 KiB

  1. /*
  2. * GIZMO.H
  3. * GizmoBar Version 1.00, Win32 version August 1993
  4. *
  5. * Data structure and type definitions for the GIZMO data structure. Each
  6. * gizmo on a gizmobar has one of these structures associated with it.
  7. *
  8. * Copyright (c)1993 Microsoft Corporation, All Rights Reserved
  9. *
  10. * Kraig Brockschmidt, Software Design Engineer
  11. * Microsoft Systems Developer Relations
  12. *
  13. * Internet : kraigb@microsoft.com
  14. * Compuserve: >INTERNET:kraigb@microsoft.com
  15. */
  16. #ifndef _GIZMO_H_
  17. #define _GIZMO_H_
  18. #ifdef __cplusplus
  19. extern "C"
  20. {
  21. #endif
  22. typedef struct tagGIZMO
  23. {
  24. struct tagGIZMO FAR *pPrev;
  25. struct tagGIZMO FAR *pNext;
  26. UINT iType;
  27. HWND hWnd; //Texts, edits, lists, and combos only.
  28. UINT uID;
  29. UINT x, y;
  30. UINT dx, dy;
  31. UINT cxImage; //From UIToolConfigureForDisplay
  32. UINT cyImage;
  33. HBITMAP hBmp; //Buttons only.
  34. UINT iBmp;
  35. BOOL fNotify; //Indicates whether we send WM_COMMANDs
  36. BOOL fHidden; //Independent of state
  37. BOOL fDisabled;
  38. UINT uState;
  39. UINT uStateOrg;
  40. DWORD dwData; //Application-supplied data.
  41. } GIZMO, FAR * LPGIZMO;
  42. typedef LPGIZMO FAR *LPLPGIZMO;
  43. #define CBGIZMO sizeof(GIZMO)
  44. //Property name we attach to controls in a gizmo to identify control type
  45. #define SZTYPEPROP TEXT("iType")
  46. //Number of controls we subclass
  47. #define CSUBGIZMOS 4
  48. //ID of edit controls in comboboxes
  49. #define ID_COMBOEDIT 1001
  50. /*
  51. * Conversion of iType (a positioned bit) into its position.
  52. * The BITPOSITION macro does not need to be fast because we only
  53. * use it once when creating a gizmo. POSITIONBIT does, however, since
  54. * we use it in subclass procedures.
  55. */
  56. #define BITPOSITION(i, j) {int k=i; for (j=0; k>>=1; j++);}
  57. #define POSITIONBIT(i) (1 << i)
  58. //Control classifications. GIZMOBAR.H must be included first.
  59. #define GIZMOTYPE_WINDOWS (GIZMOTYPE_TEXT | GIZMOTYPE_EDIT | GIZMOTYPE_LISTBOX | GIZMOTYPE_COMBOBOX | GIZMOTYPE_BUTTONNORMAL)
  60. #define GIZMOTYPE_BUTTONS (GIZMOTYPE_BUTTONATTRIBUTEIN | GIZMOTYPE_BUTTONATTRIBUTEEX | GIZMOTYPE_BUTTONCOMMAND | GIZMOTYPE_BUTTONNORMAL)
  61. #define GIZMOTYPE_DRAWN (GIZMOTYPE_BUTTONATTRIBUTEIN | GIZMOTYPE_BUTTONATTRIBUTEEX | GIZMOTYPE_BUTTONCOMMAND)
  62. //These must stay in sync with GIZMOBAR.H
  63. #define GIZMOTYPE_MIN GIZMOTYPE_EDIT
  64. #define GIZMOTYPE_MAX GIZMOTYPE_BUTTONCOMMAND
  65. //Enumeration callback
  66. typedef BOOL (FAR PASCAL *LPFNGIZMOENUM)(LPGIZMO, UINT, DWORD);
  67. //GIZMO.C
  68. LPGIZMO GizmoPAllocate(LPINT, LPLPGIZMO, HWND, UINT, UINT, UINT, UINT, UINT, LPTSTR, HBITMAP, UINT, UINT);
  69. void GizmosExpand(LPGIZMO);
  70. LPGIZMO GizmoPFree(LPLPGIZMO, LPGIZMO);
  71. void GizmosCompact(LPGIZMO);
  72. LPGIZMO GizmoPFind(LPLPGIZMO, UINT);
  73. LPGIZMO GizmoPEnum(LPLPGIZMO, LPFNGIZMOENUM, DWORD);
  74. UINT GizmoPStateSet(HWND, LPGIZMO, UINT);
  75. BOOL GizmoPCheck(HWND, LPGIZMO, BOOL);
  76. //LRESULT FAR PASCAL EXPORT GenericSubProc(HWND, UINT, WPARAM, LPARAM);
  77. LRESULT FAR PASCAL GenericSubProc(HWND, UINT, WPARAM, LPARAM);
  78. #ifdef __cplusplus
  79. }
  80. #endif
  81. #endif //_GIZMO_H_