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.

48 lines
1.3 KiB

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