Module cToolbar_h.pkg

     1// Generic NM Notifications...
     2Define NM_FIRST           for 0 // generic to all controls
     3
     4Define NM_OUTOFMEMORY     for (NM_FIRST-1)
     5Define NM_CLICK           for (NM_FIRST-2)    // uses NMCLICK struct
     6Define NM_DBLCLK          for (NM_FIRST-3)
     7Define NM_RETURN          for (NM_FIRST-4)
     8Define NM_RCLICK          for (NM_FIRST-5)    // uses NMCLICK struct
     9Define NM_RDBLCLK         for (NM_FIRST-6)
    10Define NM_SETFOCUS        for (NM_FIRST-7)
    11Define NM_KILLFOCUS       for (NM_FIRST-8)
    12Define NM_CUSTOMDRAW      for (NM_FIRST-12)
    13Define NM_HOVER           for (NM_FIRST-13)
    14Define NM_NCHITTEST       for (NM_FIRST-14)   // uses NMMOUSE struct
    15Define NM_KEYDOWN         for (NM_FIRST-15)   // uses NMKEY struct
    16Define NM_RELEASEDCAPTURE for (NM_FIRST-16)
    17Define NM_SETCURSOR       for (NM_FIRST-17)   // uses NMMOUSE struct
    18Define NM_CHAR            for (NM_FIRST-18)   // uses NMCHAR struct
    19
    20
    21
    22Define TBN_FIRST               for |CI-700
    23
    24Define TBSTATE_CHECKED         For |CI$01
    25Define TBSTATE_PRESSED         For |CI$02
    26Define TBSTATE_ENABLED         For |CI$04
    27Define TBSTATE_HIDDEN          For |CI$08
    28Define TBSTATE_INDETERMINATE   For |CI$10
    29Define TBSTATE_WRAP            For |CI$20
    30Define TBSTATE_ELLIPSES        For |CI$40
    31Define TBSTATE_MARKED          For |CI$80
    32
    33Define TBSTYLE_BUTTON          For |CI$0000
    34Define TBSTYLE_SEP             For |CI$0001
    35Define TBSTYLE_CHECK           For |CI$0002
    36Define TBSTYLE_GROUP           For |CI$0004
    37Define TBSTYLE_CHECKGROUP      For (TBSTYLE_GROUP ior TBSTYLE_CHECK)
    38Define TBSTYLE_DROPDOWN        For |CI$0008
    39Define TBSTYLE_AUTOSIZE        For |CI$0010 // automatically calculate the cx of the button
    40Define TBSTYLE_NOPREFIX        For |CI$0020 // if this button should not have accel prefix
    41
    42Define TBSTYLE_TOOLTIPS        For |CI$0100
    43Define TBSTYLE_WRAPABLE        For |CI$0200
    44Define TBSTYLE_ALTDRAG         For |CI$0400
    45Define TBSTYLE_FLAT            For |CI$0800
    46Define TBSTYLE_LIST            For |CI$1000
    47Define TBSTYLE_CUSTOMERASE     For |CI$2000
    48Define TBSTYLE_REGISTERDROP    For |CI$4000
    49Define TBSTYLE_TRANSPARENT     For |CI$8000
    50Define TBSTYLE_EX_DRAWDDARROWS For |CI$00000001
    51
    52// Custom Draw Structure
    53Type tNmCustomDraw
    54//    NMCUSTOMDRAW nmcd;
    55//    HBRUSH hbrMonoDither;
    56//    HBRUSH hbrLines;                // For drawing lines on buttons
    57//    HPEN hpenLines;                 // For drawing lines on buttons
    58
    59//    COLORREF clrText;               // Color of text
    60//    COLORREF clrMark;               // Color of text bk when marked. (only if TBSTATE_MARKED)
    61//    COLORREF clrTextHighlight;      // Color of text when highlighted
    62//    COLORREF clrBtnFace;            // Background of the button
    63//    COLORREF clrBtnHighlight;       // 3D highlight
    64//    COLORREF clrHighlightHotTrack;  // In conjunction with fHighlightHotTrack
    65//                                    // will cause button to highlight like a menu
    66//    RECT rcText;                    // Rect for text
    67
    68//    int nStringBkMode;
    69//    int nHLStringBkMode;
    70End_Type
    71
    72// Toolbar custom draw return flags
    73Define TBCDRF_NOEDGES              For |CI$00010000  // Don't draw button edges
    74Define TBCDRF_HILITEHOTTRACK       For |CI$00020000  // Use color of the button bk when hottracked
    75Define TBCDRF_NOOFFSET             For |CI$00040000  // Don't offset button if pressed
    76Define TBCDRF_NOMARK               For |CI$00080000  // Don't draw default highlight of image/text for TBSTATE_MARKED
    77Define TBCDRF_NOETCHEDEFFECT       For |CI$00100000  // Don't draw etched effect for disabled items
    78
    79
    80Define TB_ENABLEBUTTON             For (WM_USER + 1)
    81Define TB_CHECKBUTTON              For (WM_USER + 2)
    82Define TB_PRESSBUTTON              For (WM_USER + 3)
    83Define TB_HIDEBUTTON               For (WM_USER + 4)
    84Define TB_INDETERMINATE            For (WM_USER + 5)
    85Define TB_MARKBUTTON               For (WM_USER + 6)
    86Define TB_ISBUTTONENABLED          For (WM_USER + 9)
    87Define TB_ISBUTTONCHECKED          For (WM_USER + 10)
    88Define TB_ISBUTTONPRESSED          For (WM_USER + 11)
    89Define TB_ISBUTTONHIDDEN           For (WM_USER + 12)
    90Define TB_ISBUTTONINDETERMINATE    For (WM_USER + 13)
    91Define TB_ISBUTTONHIGHLIGHTED      For (WM_USER + 14)
    92Define TB_SETSTATE                 For (WM_USER + 17)
    93Define TB_GETSTATE                 For (WM_USER + 18)
    94Define TB_ADDBITMAP                For (WM_USER + 19)
    95
    96Define TB_ADDBUTTONS           for (WM_USER + 20)
    97Define TB_INSERTBUTTON         for (WM_USER + 21)
    98
    99Define TB_DELETEBUTTON         for (WM_USER + 22)
   100Define TB_GETBUTTON            for (WM_USER + 23)
   101Define TB_BUTTONCOUNT          for (WM_USER + 24)
   102Define TB_COMMANDTOINDEX       for (WM_USER + 25)
   103
   104Define TB_SAVERESTORE          for (WM_USER + 26)
   105Define TB_CUSTOMIZE            for (WM_USER + 27)
   106Define TB_ADDSTRING            for (WM_USER + 28)
   107Define TB_GETITEMRECT          for (WM_USER + 29)
   108Define TB_BUTTONSTRUCTSIZE     for (WM_USER + 30)
   109Define TB_SETBUTTONSIZE        for (WM_USER + 31)
   110Define TB_SETBITMAPSIZE        for (WM_USER + 32)
   111Define TB_AUTOSIZE             for (WM_USER + 33)
   112Define TB_GETTOOLTIPS          for (WM_USER + 35)
   113Define TB_SETTOOLTIPS          for (WM_USER + 36)
   114Define TB_SETPARENT            for (WM_USER + 37)
   115Define TB_SETROWS              for (WM_USER + 39)
   116Define TB_GETROWS              for (WM_USER + 40)
   117Define TB_SETCMDID             for (WM_USER + 42)
   118Define TB_CHANGEBITMAP         for (WM_USER + 43)
   119Define TB_GETBITMAP            for (WM_USER + 44)
   120Define TB_GETBUTTONTEXT        for (WM_USER + 45)
   121Define TB_REPLACEBITMAP        for (WM_USER + 46)
   122Define TB_SETINDENT            for (WM_USER + 47)
   123Define TB_SETIMAGELIST         for (WM_USER + 48)
   124Define TB_GETIMAGELIST         for (WM_USER + 49)
   125Define TB_LOADIMAGES           for (WM_USER + 50)
   126Define TB_GETRECT              for (WM_USER + 51) // wParam is the Cmd instead of index
   127Define TB_SETHOTIMAGELIST      for (WM_USER + 52)
   128Define TB_GETHOTIMAGELIST      for (WM_USER + 53)
   129Define TB_SETDISABLEDIMAGELIST for (WM_USER + 54)
   130Define TB_GETDISABLEDIMAGELIST for (WM_USER + 55)
   131Define TB_SETSTYLE             for (WM_USER + 56)
   132Define TB_GETSTYLE             for (WM_USER + 57)
   133Define TB_GETBUTTONSIZE        for (WM_USER + 58)
   134Define TB_SETBUTTONWIDTH       for (WM_USER + 59)
   135Define TB_SETMAXTEXTROWS       for (WM_USER + 60)
   136Define TB_GETTEXTROWS          for (WM_USER + 61)
   137
   138Define TB_GETOBJECT            for (WM_USER + 62)  // wParam == IID, lParam void **ppv
   139Define TB_GETHOTITEM           for (WM_USER + 71)
   140Define TB_SETHOTITEM           for (WM_USER + 72)  // wParam == iHotItem
   141Define TB_SETANCHORHIGHLIGHT   for (WM_USER + 73)  // wParam == TRUE/FALSE
   142Define TB_GETANCHORHIGHLIGHT   for (WM_USER + 74)
   143Define TB_MAPACCELERATOR       for (WM_USER + 78)  // wParam == ch, lParam int * pidBtn
   144
   145Define TBIMHT_AFTER            for |CI$00000001 // TRUE = insert After iButton, otherwise before
   146Define TBIMHT_BACKGROUND       for |CI$00000002 // TRUE iff missed buttons completely
   147
   148Define TB_GETINSERTMARK        for (WM_USER + 79)  // lParam == LPTBINSERTMARK
   149Define TB_SETINSERTMARK        for (WM_USER + 80)  // lParam == LPTBINSERTMARK
   150Define TB_INSERTMARKHITTEST    for (WM_USER + 81)  // wParam == LPPOINT lParam == LPTBINSERTMARK
   151Define TB_MOVEBUTTON           for (WM_USER + 82)
   152Define TB_GETMAXSIZE           for (WM_USER + 83)  // lParam == LPSIZE
   153Define TB_SETEXTENDEDSTYLE     for (WM_USER + 84)  // For TBSTYLE_EX_*
   154Define TB_GETEXTENDEDSTYLE     for (WM_USER + 85)  // For TBSTYLE_EX_*
   155Define TB_GETPADDING           for (WM_USER + 86)
   156Define TB_SETPADDING           for (WM_USER + 87)
   157Define TB_SETINSERTMARKCOLOR   for (WM_USER + 88)
   158Define TB_GETINSERTMARKCOLOR   for (WM_USER + 89)
   159
   160Define TB_SETCOLORSCHEME       for CCM_SETCOLORSCHEME  // lParam is color scheme
   161Define TB_GETCOLORSCHEME       for CCM_GETCOLORSCHEME  // fills in COLORSCHEME pointed to by lParam
   162
   163Define TB_SETUNICODEFORMAT     for CCM_SETUNICODEFORMAT
   164Define TB_GETUNICODEFORMAT     for CCM_GETUNICODEFORMAT
   165
   166Define TBBF_LARGE              for |CI$0001
   167
   168Define TB_GETBITMAPFLAGS       for (WM_USER + 41)
   169
   170Define TBIF_IMAGE              for |CI$00000001
   171Define TBIF_TEXT               for |CI$00000002
   172Define TBIF_STATE              for |CI$00000004
   173Define TBIF_STYLE              for |CI$00000008
   174Define TBIF_LPARAM             for |CI$00000010
   175Define TBIF_COMMAND            for |CI$00000020
   176Define TBIF_SIZE               for |CI$00000040
   177
   178// BUTTONINFO APIs do NOT support the string pool.
   179Define TB_GETBUTTONINFO        for (WM_USER + 65)
   180Define TB_SETBUTTONINFO        for (WM_USER + 66)
   181
   182Define TB_HITTEST              for (WM_USER + 69)
   183
   184Define TB_SETDRAWTEXTFLAGS     for (WM_USER + 70)  // wParam == mask lParam == bit values
   185
   186Define TBN_GETBUTTONINFO       for (TBN_FIRST-0)
   187Define TBN_BEGINDRAG           for (TBN_FIRST-1)
   188Define TBN_ENDDRAG             for (TBN_FIRST-2)
   189Define TBN_BEGINADJUST         for (TBN_FIRST-3)
   190Define TBN_ENDADJUST           for (TBN_FIRST-4)
   191Define TBN_RESET               for (TBN_FIRST-5)
   192Define TBN_QUERYINSERT         for (TBN_FIRST-6)
   193Define TBN_QUERYDELETE         for (TBN_FIRST-7)
   194Define TBN_TOOLBARCHANGE       for (TBN_FIRST-8)
   195Define TBN_CUSTHELP            for (TBN_FIRST-9)
   196Define TBN_DROPDOWN            for (TBN_FIRST - 10)
   197Define TBN_GETOBJECT           for (TBN_FIRST - 12)
   198
   199// Hot item change flags
   200Define HICF_OTHER              for |CI$00000000
   201Define HICF_MOUSE              for |CI$00000001          // Triggered by mouse
   202Define HICF_ARROWKEYS          for |CI$00000002          // Triggered by arrow keys
   203Define HICF_ACCELERATOR        for |CI$00000004          // Triggered by accelerator
   204Define HICF_DUPACCEL           for |CI$00000008          // This accelerator is not unique
   205Define HICF_ENTERING           for |CI$00000010          // idOld is invalid
   206Define HICF_LEAVING            for |CI$00000020          // idNew is invalid
   207Define HICF_RESELECT           for |CI$00000040          // hot item reselected
   208
   209Define TBN_HOTITEMCHANGE       for (TBN_FIRST - 13)
   210Define TBN_DRAGOUT             for (TBN_FIRST - 14) // this is sent when the user clicks down on a button then drags off the button
   211Define TBN_DELETINGBUTTON      for (TBN_FIRST - 15) // uses TBNOTIFY
   212Define TBN_GETDISPINFO         for (TBN_FIRST - 16) // This is sent when the  toolbar needs  some display information
   213Define TBN_GETINFOTIP          for (TBN_FIRST - 18)
   214
   215Define TBNF_IMAGE              for |CI$00000001
   216Define TBNF_TEXT               for |CI$00000002
   217Define TBNF_DI_SETITEM         for |CI$10000000
   218
   219// Return codes for TBN_DROPDOWN
   220Define TBDDRET_DEFAULT         for |CI0
   221Define TBDDRET_NODEFAULT       for |CI1
   222Define TBDDRET_TREATPRESSED    for |CI2       // Treat as a standard press button
   223
   224Define HINST_COMMCTRL       for -1
   225Define IDB_STD_SMALL_COLOR  for 0
   226Define IDB_STD_LARGE_COLOR  for 1
   227Define IDB_VIEW_SMALL_COLOR for 4
   228Define IDB_VIEW_LARGE_COLOR for 5
   229Define IDB_HIST_SMALL_COLOR for 8
   230Define IDB_HIST_LARGE_COLOR for 9
   231
   232
   233Type tTbInsertMark
   234    Field tTbInsertMark.iButton as DWord
   235    Field tTbInsertMark.dwFlags as DWord
   236End_Type
   237
   238Type tTbReplaceBitmap
   239    Field tTbReplaceBitmap.hInstOld as Handle
   240    Field tTbReplaceBitmap.nIdOld   as DWord
   241    Field tTbReplaceBitmap.hInstNew as Handle
   242    Field tTbReplaceBitmap.nIdNew   as DWord
   243    Field tTbReplaceBitmap.nButtons as DWord
   244    End_Type
   245
   246Type tTbButtonInfo
   247    Field tTbButtonInfo.cbSize    as DWord
   248    Field tTbButtonInfo.dwMask    as DWord
   249    Field tTbButtonInfo.idCommand as DWord
   250    Field tTbButtonInfo.iImage    as DWord
   251    Field tTbButtonInfo.fsState   as Byte
   252    Field tTbButtonInfo.fsStyle   as Byte
   253    Field tTbButtonInfo.cx        as Word
   254    Field tTbButtonInfo.lParam    as DWord
   255    Field tTbButtonInfo.pszText   as Pointer
   256    Field tTbButtonInfo.cchText   as DWord
   257End_Type
   258
   259// Structure for TBN_HOTITEMCHANGE notification
   260Type tNmTbHotItem
   261    Field tNmTbHotItem.hdr.hWndFrom as Handle
   262    Field tNmTbHotItem.hdr.idFrom   as DWord
   263    Field tNmTbHotItem.hdr.code     as DWord
   264    Field tNmTbHotItem.idOld        as DWord
   265    Field tNmTbHotItem.idNew        as DWord
   266    Field tNmTbHotItem.dwFlags      as DWord
   267End_Type
   268
   269Type tNmTbGetInfoTip
   270    Field tNmTbGetInfoTip.hdr.hWndFrom as Handle
   271    Field tNmTbGetInfoTip.hdr.idFrom   as DWord
   272    Field tNmTbGetInfoTip.hdr.code     as DWord
   273    Field tNmTbGetInfoTip.pszText      as Pointer
   274    Field tNmTbGetInfoTip.cchTextMax   as DWord
   275    Field tNmTbGetInfoTip.iItem        as DWord
   276    Field tNmTbGetInfoTip.lParam       as DWord
   277End_Type
   278
   279Type tNmTbDispInfo
   280    Field tNmTbDispInfo.hdr.hWndFrom as Handle
   281    Field tNmTbDispInfo.hdr.idFrom   as DWord
   282    Field tNmTbDispInfo.hdr.code     as DWord
   283    Field tNmTbDispInfo.dwMask       as DWord    // [in] Specifies the values requested .[out] Client ask the data to be set for future use
   284    Field tNmTbDispInfo.idCommand    as DWord    // [in] id of button we're requesting info for
   285    Field tNmTbDispInfo.lParam       as DWord    // [in] lParam of button
   286    Field tNmTbDispInfo.iImage       as DWord    // [out] image index
   287    Field tNmTbDispInfo.pszText      as Pointer  // [out] new text for item
   288    Field tNmTbDispInfo.cchText      as DWord    // [in] size of buffer pointed to by pszText
   289End_Type
   290
   291Type tTbButton
   292    Field tTbButton.iBitmap    as DWord
   293    Field tTbButton.idCommand  as DWord
   294    Field tTbButton.fsState    as Byte
   295    Field tTbButton.fsStyle    as Byte
   296    Field tTbButton.bReserved1 as Byte
   297    Field tTbButton.bReserved2 as Byte
   298    Field tTbButton.dwData     as DWord
   299    Field tTbButton.iString    as DWord
   300End_Type
   301
   302Type tNmToolbar
   303    Field tNmToolbar.hdr.hWndFrom        as Handle
   304    Field tNmToolbar.hdr.idFrom          as DWord
   305    Field tNmToolbar.hdr.code            as DWord
   306    Field tNmToolbar.iItem               as DWord
   307    Field tNmToolbar.tbButton.iBitmap    as DWord
   308    Field tNmToolbar.tbButton.idCommand  as DWord
   309    Field tNmToolbar.tbButton.fsState    as Byte
   310    Field tNmToolbar.tbButton.fsStyle    as Byte
   311    Field tNmToolbar.tbButton.bReserved1 as Byte
   312    Field tNmToolbar.tbButton.bReserved2 as Byte
   313    Field tNmToolbar.tbButton.dwData     as DWord
   314    Field tNmToolbar.tbButton.iString    as DWord
   315    Field tNmToolbar.cchText             as DWord
   316    Field tNmToolbar.pszText             as Pointer
   317End_Type
   318
   319Enum_List // for peStyle
   320    Define bsSeparator
   321    Define bsButton
   322    Define bsCheck
   323    Define bsDropDown
   324End_Enum_List
   325