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.

105 lines
3.2 KiB

  1. #ifndef _FMTBAR_H
  2. #define _FMTBAR_H
  3. #define FBN_BODYHASFOCUS 8001
  4. #define FBN_BODYSETFOCUS 8002
  5. #define FBN_GETMENUFONT 8003
  6. class CFmtBar
  7. {
  8. public:
  9. CFmtBar(BOOL fSep);
  10. ~CFmtBar();
  11. ULONG AddRef();
  12. ULONG Release();
  13. HRESULT Init(HWND hwndParent, int iddlg);
  14. HRESULT SetCommandTarget(LPOLECOMMANDTARGET pCmdTarget);
  15. HRESULT OnWMCommand(HWND hwnd, int id, WORD wCmd);
  16. HRESULT Update();
  17. HRESULT Show();
  18. HRESULT Hide();
  19. HRESULT TranslateAcclerator(LPMSG lpMsg);
  20. HRESULT GetWindow(HWND *pHwnd);
  21. static LRESULT CALLBACK ExtWndProc(HWND hwnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
  22. static LRESULT CALLBACK EditSubProc(HWND hwnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
  23. static LRESULT CALLBACK ComboBoxSubProc(HWND hwnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
  24. static LRESULT CALLBACK RebarSubProc(HWND hwnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
  25. static INT CALLBACK ExtEnumFontNamesProcEx(ENUMLOGFONTEX *plf, NEWTEXTMETRICEX *ptm, INT nFontType, LPARAM lParam);
  26. private:
  27. IOleCommandTarget *m_pCmdTarget;
  28. ULONG m_cRef;
  29. HWND m_hwnd,
  30. m_hwndParent,
  31. m_hwndToolbar,
  32. m_hwndName,
  33. m_hwndSize,
  34. m_hwndRebar,
  35. m_hwndTT;
  36. HMENU m_hmenuColor,
  37. m_hmenuTag;
  38. WNDPROC m_wndprocEdit,
  39. m_wndprocNameComboBox,
  40. m_wndprocSizeComboBox,
  41. m_wndprocRebar;
  42. HBITMAP m_hbmName;
  43. BOOL m_fDestroyTagMenu :1,
  44. m_fVisible :1,
  45. m_fSep :1;
  46. int m_idd;
  47. HIMAGELIST m_himlHot,
  48. m_himl;
  49. HBITMAP LoadDIBBitmap(int id);
  50. VOID AddToolTip(HWND hwndToolTips, HWND hwnd, UINT idRsrc);
  51. DWORD FlipColor(DWORD rgb);
  52. HRESULT HrShowTagMenu(POINT pt);
  53. HRESULT HrInitTagMenu();
  54. INT XFontSizeCombo(HDC hdc);
  55. HRESULT CheckColor();
  56. INT EnumFontNamesProcEx(ENUMLOGFONTEX *plf, NEWTEXTMETRICEX *ptm, INT nFontType);
  57. // format bar
  58. void FillFontNames();
  59. void FillSizes();
  60. HRESULT ExecCommand(UINT uCmDId, DWORD dwOpt, VARIANTARG *pvaIn);
  61. LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  62. // message handling
  63. void OnNCDestroy();
  64. HRESULT OnNCCreate(HWND hwnd);
  65. void WMNotify(WPARAM wParam, NMHDR* pnmhdr);
  66. // owner draw
  67. void OnDrawItem(LPDRAWITEMSTRUCT pdis);
  68. void OnMeasureItem(LPMEASUREITEMSTRUCT pmis);
  69. void ComboBox_WMDrawItem(LPDRAWITEMSTRUCT pdis);
  70. BOOL FBodyHasFocus();
  71. void SetBodyFocus();
  72. HMENU hmenuGetStyleTagMenu();
  73. HRESULT AttachWin();
  74. HIMAGELIST _CreateToolbarBitmap(int idb, int cx);
  75. HRESULT _SetToolbarBitmaps();
  76. HRESULT _FreeImageLists();
  77. };
  78. typedef CFmtBar *LPFORMATBAR;
  79. HRESULT HrCreateFormatBar(HWND hwndParent, int iddlg, BOOL fSep, LPFORMATBAR *ppFmtBar);
  80. #endif // _FMTBAR_H