Leaked source code of windows server 2003
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.

65 lines
1.7 KiB

  1. #ifndef COMBO_TOOLBAR_H
  2. #define COMBO_TOOLBAR_H
  3. #include <gencontrols.h>
  4. #include <gencontainers.h>
  5. #define RES_CH_MAX 256
  6. extern HINSTANCE g_hDllInst;
  7. #define STRING_RESOURCE_MODULE g_hDllInst
  8. #define RES2T(uID, psz ) ( Res2THelper( uID, psz, RES_CH_MAX ) )
  9. inline TCHAR* Res2THelper( UINT uID, TCHAR* psz, int cch )
  10. {
  11. if( LoadString( STRING_RESOURCE_MODULE, uID, psz, cch ) )
  12. {
  13. return psz;
  14. }
  15. return _T("");
  16. }
  17. // Private structure for defining a button
  18. struct Buttons
  19. {
  20. int idbStates; // Bitmap ID for the states
  21. UINT nInputStates; // Number of input states in the bitmap
  22. UINT nCustomStates; // Number of custom states in the bitmap
  23. int idCommand; // Command ID for WM_COMMAND messages
  24. LPCTSTR pszTooltip; // Tooltip text
  25. } ;
  26. class CComboToolbar : public CToolbar
  27. {
  28. private:
  29. CComboBox *m_Combobox;
  30. int m_iCount;
  31. CGenWindow **m_Buttons;
  32. int m_iNumButtons;
  33. void *m_pOwner; // pointer to owner (CAppletWindow*)
  34. public:
  35. CComboToolbar();
  36. BOOL Create(HWND hwndParent, struct Buttons* buttons,
  37. int iNumButtons, LPVOID owner);
  38. virtual void OnDesiredSizeChanged();
  39. void OnCommand(int id) { OnCommand(GetWindow(), id, NULL, 0); }
  40. void HandlePeerNotification(T120ConfID confId, // handle PeerMsg
  41. T120NodeID nodeID, PeerMsg *pMsg);
  42. UINT GetSelectedItem(LPARAM *ItemData); // get selected item and data
  43. void UpdateButton(int *iFlags); // update button state
  44. protected:
  45. virtual ~CComboToolbar();
  46. virtual LRESULT ProcessMessage(HWND hwnd, UINT message,
  47. WPARAM wParam, LPARAM lParam);
  48. private:
  49. void OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify);
  50. };
  51. #endif /* COMBO_TOOLBAR_H */