aduiDock.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2015 Autodesk, Inc. All rights reserved.
  4. //
  5. // Use of this software is subject to the terms of the Autodesk license
  6. // agreement provided at the time of installation or download, or which
  7. // otherwise accompanies this software in either electronic or hard copy form.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. #ifndef _aduiDock_h
  11. #define _aduiDock_h
  12. #if _MSC_VER >= 1000
  13. #pragma once
  14. #endif // _MSC_VER >= 1000
  15. #include <afxpriv.h> // For CDockBar and CMiniDockFrameWnd
  16. #include "AdAChar.h"
  17. #pragma pack (push, 8)
  18. class CPaletteSetTooltip;
  19. class CAdUiDockFrame;
  20. class CAdUiDockControlBar;
  21. //////////////////////////////////////////////////////////////////////////////
  22. #define ADUI_DOCK_POSITION_TOOL_KEY ADUI_XML_DOCK_TOOL_INFO
  23. #define ADUI_DOCK_STARTUP_TOOL_KEY ADUI_XML_DOCK_STARTUP_INFO
  24. #define ADUI_XML_ROOT ACRX_T("AdUiTools")
  25. #define ADUI_XML_DOCK_TOOL_INFO ACRX_T("ToolsInfo")
  26. #define ADUI_XML_DOCK_TOOL ACRX_T("Tool")
  27. #define ADUI_XML_DOCK_TOOL_CLSID ACRX_T("CLSID")
  28. #define ADUI_XML_DOCK_STARTUP_INFO ACRX_T("StartupInfo")
  29. #define ADUI_XML_DOCK_STARTUP_TOOL_NAME ACRX_T("ToolName")
  30. #define ADUI_XML_DOCK_STARTUP_CMD_NAME ACRX_T("Command")
  31. #define ID_ADUI_ALLOWDOCK 0x1001
  32. #define ID_ADUI_HIDEBAR 0x1002
  33. #define ADUI_DOCK_CS_DESTROY_ON_CLOSE 0x01 // closing the floating window closes the control bar
  34. #define ADUI_DOCK_CS_STDMOUSECLICKS 0x02 // standard mouse handling for the menu
  35. #define ADUI_DOCK_NF_SIZECHANGED 0x01
  36. #define ADUI_DOCK_NF_STATECHANGED 0x02
  37. #define ADUI_DOCK_NF_FRAMECHANGED 0x02
  38. #define WM_ACAD_DOCKBAR_ROLLED_UP (WM_USER+37) // From "winacad.h"
  39. #define WM_ACAD_DOCKBAR_ROLLED_OUT (WM_USER+38) // From "winacad.h"
  40. //////////////////////////////////////////////////////////////////////////////
  41. #pragma warning(push)
  42. #ifndef _ADESK_MAC_
  43. #pragma warning(disable : 4275)
  44. /////////////////////////////////////////////////////////////////////////////
  45. // CAdUiDockControlBarThemeModReactor class
  46. class CAdUiDockControlBarThemeModReactor : public CAdUiThemeModifiedReactor // INTERNAL USE ONLY
  47. {
  48. public:
  49. CAdUiDockControlBarThemeModReactor(CAdUiDockControlBar* pDockControlBar);
  50. virtual void ThemeModified(const CAdUiTheme * pTheme, AdUiThemeElement element);
  51. void SetDockControlBar(CAdUiDockControlBar* pDockControlBar);
  52. private:
  53. CAdUiDockControlBar * m_pDockControlBar;
  54. };
  55. /////////////////////////////////////////////////////////////////////////////
  56. // CAdUiDockControlBar class
  57. class ADUI_PORT CAdUiDockControlBar : public CControlBar
  58. {
  59. friend class CAdUiDockFrame;
  60. friend class CAdUiPaletteSetDockFrame;
  61. friend class CAdUiDockDragContext;
  62. friend class CAdUiDockBar;
  63. friend class CAdUiImpPaletteSet;
  64. friend class CAdUiDockBarMutator;
  65. friend class CAdUiDockControlBarThemeModReactor; // INTERNAL USE ONLY
  66. // Attributes
  67. private:
  68. static CObArray * m_paBars; // array of dynamically allocated bars
  69. CSize m_FloatSize; // size when docked
  70. CSize m_HorzDockSize; // size when docked horizontal
  71. CSize m_VertDockSize; // size when docked vertical
  72. CPoint m_FloatingPosition; // floating position
  73. bool m_bAllowDockingMenuItemState; // allow docking menu item state
  74. int m_Style; // style flags
  75. CSize m_PrevSize;
  76. BOOL m_bPrevFloating;
  77. CAdUiBitmapButton m_closeBtn;
  78. CAdUiBitmapButton m_pinBtn;
  79. CLSID m_ID;
  80. bool m_bShowCloseButton; // Show and draw close button on docked bar
  81. static int m_nLastBarID;
  82. static bool m_bToolsRestartMode; // Boolean variable to signal start/end of
  83. // restarting of tools (usually set/cleared
  84. // by the the application during startup.
  85. // variables which reflect persisted dock/float rect for the controlbar
  86. // across application sessions
  87. CRect m_PersistedDockRect;
  88. CRect m_PersistedFloatRect;
  89. private:
  90. void SetDockFlag (DWORD dwStyle);
  91. void Resized (int cx, int cy, BOOL bFloating, int flags);
  92. LRESULT AddMenuItems (WPARAM wParam, LPARAM lParam);
  93. static void RemoveBars ();
  94. void OnUpdateCmdUI (CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
  95. void PaintBar (CDC *pDC);
  96. void Draw3DRect (CDC *pDC, LPRECT lpRect, CPen *pPenGray);
  97. LRESULT WindowProc (UINT nMsg, WPARAM wParam, LPARAM lParam);
  98. void LoadDefaultLocation(UINT nOrientation, RECT *pSizeFloating);
  99. public:
  100. CAdUiDockControlBar (int nStyle = ADUI_DOCK_CS_STDMOUSECLICKS);
  101. BOOL Create (CWnd * pParent, LPCTSTR lpszTitle, UINT nID,
  102. DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_BOTTOM,
  103. const RECT & rect = CFrameWnd::rectDefault);
  104. BOOL Create (LPCTSTR lpszClassName, LPCTSTR lpszWindowName,
  105. DWORD dwStyle, const RECT& rect, CWnd* pParentWnd,
  106. UINT nID, CCreateContext* pContext = NULL);
  107. void EnableDocking (DWORD dwDockStyle);
  108. void TileInRow ();
  109. BOOL IsFloating ();
  110. void DockControlBar (UINT nOrientation, RECT *pRect);
  111. void RestoreControlBar (UINT nPreferredOrientation = AFX_IDW_DOCKBAR_LEFT,
  112. CRect *pSizeFloating = NULL);
  113. void InitFloatingPosition (CRect *pSizeFloating);
  114. void GetFloatingRect (CRect *pFloatingPos);
  115. // access methods which returns the cached dock/float
  116. // rect which would have persisted in the fixed profile
  117. // across autocad sessions.
  118. void GetPersistedDockingRect(CRect *pDockRect);
  119. void GetPersistedFloatingRect(CRect *pFloatRect);
  120. // Get/Set methods to signal begining and end of
  121. // restarting of tools. Set and cleared by the
  122. // application to position controlbars inside
  123. // one of the four dockbars during the application
  124. // startup.
  125. static void SetToolsRestartMode ( bool bMode );
  126. static bool GetToolsRestartMode ( );
  127. void SetAllowDockingMenuItemState(bool bState) { m_bAllowDockingMenuItemState = bState; }
  128. bool AllowDockingMenuItemState() { return m_bAllowDockingMenuItemState; }
  129. void SetToolID (CLSID* pCLSID);
  130. CLSID* GetToolID () { return &m_ID; }
  131. DWORD GetDockStyle () { return m_dwDockStyle; }
  132. // Called in response to the application's query to take the focus back.
  133. // Default implementation returns false, keeping the focus in the tool window.
  134. virtual bool CanFrameworkTakeFocus () { return false; }
  135. // Loads the data from xml file
  136. virtual BOOL Load(IUnknown* pUnk);
  137. // Saves the data to xml file
  138. virtual BOOL Save(IUnknown* pUnk);
  139. virtual CSize CalcFixedLayout (BOOL bStretch, BOOL bHorz);
  140. bool Anchored();
  141. bool Anchored(bool bHiddenReturnsLastState);
  142. static bool ShowPalettes();
  143. static bool HidePalettes();
  144. bool AdjustVertDockedBarHeight(int nHeight);
  145. /// <summary>
  146. /// Gets the theme being used
  147. /// </summary>
  148. /// <returns>
  149. /// The pointer to the CAdUiTheme instance being used
  150. /// </returns>
  151. CAdUiTheme* GetTheme();
  152. /// <summary>
  153. /// Sets the theme to be used
  154. /// </summary>
  155. /// <param name="pTheme">
  156. /// The pointer to the CAdUiTheme instance
  157. /// </param>
  158. /// <returns>
  159. /// The current theme being used
  160. /// </returns>
  161. CAdUiTheme* SetTheme(CAdUiTheme* pTheme);
  162. /// <summary>
  163. /// Virtual method that receives the theme modification event.
  164. /// </summary>
  165. /// <param name="element">
  166. /// A index of the theme element that was modified.
  167. /// </param>
  168. /// <remarks>
  169. /// This method is also called when the theme uses the active theme colors
  170. /// and the active theme is changed. In that case, element = kUnknownElements
  171. /// </remarks>
  172. virtual void ThemeModified(AdUiThemeElement element);
  173. // Returns the title bar width/height
  174. LONG GetTitleBarSize();
  175. // Get/Sets horizontal/vertical dock size
  176. const CSize& GetHorzDockSize() { return m_HorzDockSize; } // INTERNAL USE ONLY
  177. const CSize& GetVertDockSize() { return m_VertDockSize; } // INTERNAL USE ONLY
  178. void SetHorzDockSize(const CSize& size) { m_HorzDockSize = size; } // INTERNAL USE ONLY
  179. void SetVertDockSize(const CSize& size) { m_VertDockSize = size; } // INTERNAL USE ONLY
  180. #ifdef _DEBUG
  181. void AssertValid() const;
  182. #endif
  183. // Overrides
  184. // ClassWizard generated virtual function overrides
  185. //{{AFX_VIRTUAL(CAdUiDockControlBar)
  186. protected:
  187. virtual BOOL OnCommand (WPARAM wParam, LPARAM lParam);
  188. //}}AFX_VIRTUAL
  189. public:
  190. virtual ~CAdUiDockControlBar();
  191. protected:
  192. enum {
  193. btnWidth = 12,
  194. btnHeight = 12,
  195. idCloseBtn = 10001,
  196. idPinBtn = 10002
  197. };
  198. protected:
  199. // windows message handlers
  200. //{{AFX_MSG(CAdUiDockControlBar)
  201. afx_msg void OnWindowPosChanged (WINDOWPOS FAR* lpwndpos);
  202. afx_msg BOOL OnEraseBkgnd (CDC* pDC);
  203. afx_msg void OnAllowDock ();
  204. afx_msg void OnAnchor ();
  205. afx_msg void OnAnchorLeft();
  206. afx_msg void OnAnchorRight();
  207. afx_msg void OnHideBar ();
  208. afx_msg void OnContextMenu (CWnd* pWnd, CPoint point);
  209. afx_msg int OnCreate (LPCREATESTRUCT lpCreateStruct);
  210. afx_msg void OnPaint ();
  211. //afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  212. //}}AFX_MSG
  213. protected:
  214. void GetUsedRect (CRect& rect);
  215. void ShowCloseButton (bool bShow) { m_bShowCloseButton = bShow; };
  216. bool CloseButtonVisible () { return m_bShowCloseButton; };
  217. void RepositionOrHideButtons ();
  218. static LRESULT CALLBACK MouseProc (int nCode, WPARAM wParam, LPARAM lParam);
  219. // Overridable functions
  220. virtual void PaintControlBar (CDC *pDC);
  221. virtual BOOL CreateControlBar (LPCREATESTRUCT lpCreateStruct);
  222. virtual void SizeChanged (CRect * /*lpRect*/, BOOL /*bFloating*/, int /*flags*/) {}
  223. virtual bool OnClosing ();
  224. virtual void GetFloatingMinSize (long *pnMinWidth, long *pnMinHeight);
  225. virtual BOOL AddCustomMenuItems(LPARAM hMenu);
  226. virtual void OnUserSizing (UINT /*nSide*/, LPRECT /*pRect*/) {};
  227. DECLARE_DYNAMIC (CAdUiDockControlBar)
  228. DECLARE_MESSAGE_MAP()
  229. };
  230. /////////////////////////////////////////////////////////////////////////////
  231. // CAdUiDockFrame window
  232. class ADUI_PORT CAdUiDockFrame : public CMiniDockFrameWnd // INTERNAL USE ONLY
  233. {
  234. DECLARE_DYNCREATE (CAdUiDockFrame)
  235. public:
  236. CAdUiDockFrame ();
  237. // Docking frame
  238. public:
  239. enum ContainedBarType { Unknown, Standard, AdskBar } ;
  240. enum ContainedBarType GetContainedBarType ();
  241. protected:
  242. enum ContainedBarType m_nContainedBarType;
  243. bool m_bZOrderChanged;
  244. bool CanFrameworkTakeFocus ();
  245. void ForceChildRepaint ();
  246. // ClassWizard-controlled
  247. public:
  248. //{{AFX_VIRTUAL(CAdUiDockFrame)
  249. protected:
  250. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  251. //}}AFX_VIRTUAL
  252. protected:
  253. //{{AFX_MSG(CAdUiDockFrame)
  254. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  255. afx_msg void OnSize(UINT nType, int cx, int cy);
  256. afx_msg void OnClose();
  257. afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint pt);
  258. #if _MSC_VER<1400
  259. afx_msg UINT OnNcHitTest(CPoint point);
  260. #else
  261. afx_msg LRESULT OnNcHitTest(CPoint point);
  262. #endif
  263. afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message);
  264. afx_msg void OnWindowPosChanging (WINDOWPOS* lpwndpos);
  265. afx_msg void OnPaint ();
  266. afx_msg void OnGetMinMaxInfo (MINMAXINFO FAR* lpMMI);
  267. afx_msg void OnSizing (UINT nSide, LPRECT pRect);
  268. //}}AFX_MSG
  269. bool CanAutoCADTakeFocus ();
  270. DECLARE_MESSAGE_MAP()
  271. };
  272. /////////////////////////////////////////////////////////////////////////////
  273. // CAdUiPaletteSetDockFrame window
  274. class ADUI_PORT CAdUiPaletteSetDockFrame : public CMiniDockFrameWnd // INTERNAL USE ONLY
  275. {
  276. friend class CAdUiImpPaletteSet;
  277. friend class CAdUiDockDragContext;
  278. friend class CAdUiDockBarMutator;
  279. friend class CAdUiAnchorBar;
  280. DECLARE_DYNCREATE (CAdUiPaletteSetDockFrame)
  281. public:
  282. CAdUiPaletteSetDockFrame ();
  283. virtual ~CAdUiPaletteSetDockFrame ();
  284. virtual BOOL Create(CWnd* pParent, DWORD dwBarStyle);
  285. static bool HidePalettes();
  286. static bool ShowPalettes();
  287. // Docking frame
  288. public:
  289. enum ContainedBarType { Unknown, Standard, AdskBar } ;
  290. enum ContainedBarType GetContainedBarType ();
  291. void SetAutoRollup(BOOL bSet);
  292. virtual void CalcWindowRect(LPRECT lpClientRect, UINT nAdjustType = adjustBorder);
  293. // AdUiTitleBarLocation
  294. typedef enum {
  295. kLeft = 0,
  296. kRight
  297. } AdUiTitleBarLocation ;
  298. // Returns enum specifiying title bar location
  299. CAdUiPaletteSetDockFrame::AdUiTitleBarLocation TitleBarLocation();
  300. void SetTitleBarLocation(CAdUiPaletteSetDockFrame::AdUiTitleBarLocation);
  301. protected:
  302. enum ContainedBarType m_nContainedBarType;
  303. bool m_bZOrderChanged;
  304. bool CanFrameworkTakeFocus ();
  305. void ForceChildRepaint ();
  306. /// <summary>
  307. /// Updates the themed UI elements. This method should be called in a themed
  308. /// environment after a theme switch.
  309. /// </summary>
  310. void UpdateThemeElements();
  311. // ClassWizard-controlled
  312. public:
  313. //{{AFX_VIRTUAL(CAdUiPaletteSetDockFrame)
  314. protected:
  315. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  316. //}}AFX_VIRTUAL
  317. protected:
  318. virtual BOOL PreTranslateMessage(MSG * msg);
  319. //{{AFX_MSG(CAdUiPaletteSetDockFrame)
  320. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  321. afx_msg void OnDestroy();
  322. afx_msg void OnSize(UINT nType, int cx, int cy);
  323. afx_msg void OnClose();
  324. afx_msg void OnLButtonDown(UINT nHitTest, CPoint pt);
  325. afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint pt);
  326. afx_msg void OnNcRButtonDown(UINT nHitTest, CPoint pt);
  327. afx_msg void OnNcRButtonUp(UINT nHitTest, CPoint pt);
  328. afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint pt);
  329. #if _MSC_VER<1400
  330. afx_msg UINT OnNcHitTest(CPoint point);
  331. #else
  332. afx_msg LRESULT OnNcHitTest(CPoint point);
  333. #endif
  334. afx_msg void OnMouseMove(UINT nHitTest, CPoint pt);
  335. afx_msg void OnNcMouseMove(UINT nHitTest, CPoint pt);
  336. afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message);
  337. afx_msg void OnWindowPosChanging (WINDOWPOS* lpwndpos);
  338. afx_msg void OnPaint ();
  339. afx_msg void OnNcPaint ();
  340. afx_msg LRESULT OnDisplayChange(WPARAM wParam, LPARAM lParam);
  341. afx_msg LRESULT OnNcCalcSize(WPARAM wParam, LPARAM lParam);
  342. afx_msg void OnActivate( UINT nState, CWnd* pWndOther, BOOL bMinimized );
  343. afx_msg BOOL OnNcActivate(BOOL bActive);
  344. afx_msg void OnGetMinMaxInfo (MINMAXINFO FAR* lpMMI);
  345. afx_msg void OnSizing (UINT nSide, LPRECT pRect);
  346. afx_msg void OnShowWindow( BOOL bShow, UINT nStatus );
  347. afx_msg BOOL OnSetCursor(CWnd *pwnd, UINT nHitTest, UINT msg);
  348. afx_msg void OnSetFocus(CWnd * pOldWnd);
  349. afx_msg void OnTimer(UINT_PTR nIdEvent);
  350. afx_msg void OnContextMenu(CWnd* pWnd, CPoint pos);
  351. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  352. afx_msg LRESULT OnEnterSizeMove(WPARAM, LPARAM);
  353. afx_msg LRESULT OnExitSizeMove(WPARAM, LPARAM);
  354. afx_msg void OnSettingChange( UINT uFlags, LPCTSTR lpszSection );
  355. //}}AFX_MSG
  356. // Handler for UM_ADUI_DRAG_ENTER.
  357. virtual LRESULT OnDragEnter(WPARAM wParam, LPARAM lParam);
  358. // Handler for UM_ADUI_DRAG_OVER.
  359. virtual LRESULT OnDragOver(WPARAM wParam, LPARAM lParam);
  360. // Handler for UM_ADUI_DROP.
  361. virtual LRESULT OnDrop(WPARAM wParam, LPARAM lParam);
  362. // Handler for UM_ADUI_DROP_EX.
  363. virtual LRESULT OnDropEx(WPARAM wParam, LPARAM lParam);
  364. // Handler for UM_ADUI_DRAG_LEAVE.
  365. virtual LRESULT OnDragLeave(WPARAM wParam, LPARAM lParam);
  366. // Handler for UM_ADUI_DRAGSCROLL
  367. virtual LRESULT OnDragScroll(WPARAM wParam, LPARAM lParam);
  368. bool CanAutoCADTakeFocus ();
  369. // Determines which part of the palette set, if any, is at a specified position.
  370. BOOL HitTest(CPoint pt, UINT& nFlag, DWORD& dwData);
  371. CAdUiPaletteSet* GetPaletteSet();
  372. DECLARE_MESSAGE_MAP()
  373. private:
  374. enum AdUiSkBtnItems {
  375. kBtnUnknown = -1,
  376. kBtnPushPin = 0,
  377. kBtnOptionMenu = 1,
  378. kBtnClose = 2,
  379. kBtnIcon = 3,
  380. };
  381. enum AdUiSkIds {
  382. kRollupTimerId = 0x3011,
  383. kRolloutTimerId = 0x3012,
  384. kCursorCheckTimerId = 0x3013
  385. };
  386. enum AdUiSkUiFlags {
  387. kImgListUnpinnedLeft = 0,
  388. kImgListUnpinnedRight = 1,
  389. kImgListPinnedLeft = 2,
  390. kImgListPinnedRight = 3,
  391. kImgListOptionMenuLeft = 4,
  392. kImgListOptionMenuRight = 5,
  393. kImgListClose = 6,
  394. kImgList_Count = 7,
  395. };
  396. void ncPaint(UINT nPtFlags);
  397. void windowToNonClient(CRect & rect);
  398. void nonclientToWindow(CRect & rect);
  399. void getRegion(CRgn & rgn);
  400. void getBorderRects(CRect & rectTop, CRect & rectBottom, CRect & rectSide);
  401. int getMetrics(UINT nItem);
  402. void getWndCaptionRect(CRect & rect);
  403. void getWndStatusRect(CRect & rect);
  404. void getWndSizerRect(CRect & rect);
  405. void getButtonItemRect(AdUiSkBtnItems eBtn, CRect & rect);
  406. void GetNonClientSize(CSize& size);
  407. int GetTopGrabbableHeight();
  408. void SnapToRect(CRect & rect, WINDOWPOS * pWndpos,
  409. int nPaletteWidth, int nPaletteHeight,
  410. bool bSnapInside, bool bSnapOutside);
  411. void InitFonts();
  412. BOOL isImgListItemValid(int nItem);
  413. // Called when the options menu button in the palette set is clicked
  414. void OnOptionsMenu();
  415. // Called by the OnContextMenu() handler if the right click is in the
  416. // caption area.
  417. void OnSystemMenu(CPoint pos);
  418. bool btnPress(AdUiSkBtnItems eBtn, LPPOINT pt);
  419. //helpers for the btnPress method
  420. void btnPressOptionMenu();
  421. void btnPressPushPin();
  422. void btnPressClose();
  423. void setWindowRgn();
  424. void doDrawCaption(CDC *pDC);
  425. void doDrawStatus(CDC *pDC);
  426. void doDrawBorder(CDC* pDC);
  427. void doDrawButton(CDC *pDC, AdUiSkBtnItems btnItem, BOOL bErase = false);
  428. void doEraseBackground(CDC *pDC, const CRect & rect, BOOL bErase);
  429. void doButtonBlt(CDC *pDC,int nImage, CRect &rcBtn);
  430. void displayTip(LPPOINT pt);
  431. void SetRollupDelay();
  432. DWORD GetRollupDelay() {
  433. return m_bDelayRolledOut ? m_nHoldopenDelay : m_nRollupDelay; }
  434. void SetRolloutDelay();
  435. DWORD GetRolloutDelay() { return m_nRolloutDelay; }
  436. void RollOut(CPoint * pPt, bool bDelay = false);
  437. void rollupDlg(BOOL bRollup = TRUE);
  438. void SetRolloutTimer();
  439. void SetRollupTimer();
  440. bool shouldWindowBeRolledUp( CWnd* pWndUnderCursor, CAdUiPaletteSet& ps) const;
  441. // Returns TRUE if the palette set window is "rolled up"
  442. BOOL RolledUp() { return (! m_rectSize.IsRectEmpty()); }
  443. CRect m_rectSize; // Store the full dialog size (when rolled)
  444. CSize m_sizeShadow;
  445. CRect m_rectCaptionText;
  446. CImageList m_imgListGui;
  447. CImageList m_imgListIcon;
  448. DWORD m_dwUiTransientFlags;
  449. bool m_bRolloutTimerSet;
  450. bool m_bRollupTimerSet;
  451. static DWORD m_nRollupDelay;
  452. static DWORD m_nRolloutDelay;
  453. static DWORD m_nHoldopenDelay;
  454. CPaletteSetTooltip* m_pToolTip; // not used
  455. BOOL m_bAllowSnapping;
  456. CAdUiDropTarget* m_pDropTarget;
  457. AdUiTitleBarLocation m_orphanTitleBarLoc;
  458. bool m_bUserEnteredAutoHideMode;
  459. CRect m_rectWorkArea;
  460. bool m_bDelayRolledOut;
  461. };
  462. #endif // _ADESK_MAC_
  463. #pragma warning(pop)
  464. /////////////////////////////////////////////////////////////////////////////
  465. void ADUI_PORT AdUiSaveDockingToolPositions (); // INTERNAL USE ONLY
  466. void ADUI_PORT AdUiShowDockControlBars (bool bShow); // INTERNAL USE ONLY
  467. bool ADUI_PORT AdUiRegisterDockingTool ( // INTERNAL USE ONLY
  468. LPCTSTR lpszToolName, LPCTSTR lpszCommand, UINT nToolbarID
  469. );
  470. bool ADUI_PORT AdUiRegisterTool (
  471. LPCTSTR lpszToolName, LPCTSTR lpszCommand, CLSID* pID
  472. );
  473. ADUI_PORT CRuntimeClass* AdUiSetFloatingFrameClass(CRuntimeClass* pNewClass);
  474. ADUI_PORT void AdUiRegisterFloatingFrameClassAddress(CRuntimeClass** pClass);
  475. ADUI_PORT void AdUiRegisterPaletteSetFloatingFrameClass(CRuntimeClass* pClass); // INTERNAL USE ONLY
  476. ADUI_PORT CRuntimeClass* AdUiGetRegisteredPaletteSetFloatingFrameClass(void);
  477. typedef HRESULT ADUI_LOADFN(IUnknown** ppAdUiRootNode);
  478. typedef HRESULT ADUI_SAVEFN(IUnknown* pAdUiRootNode);
  479. #ifndef _ADESK_MAC_
  480. void ADUI_PORT AdUiEnableDocking ( // INTERNAL USE ONLY
  481. CFrameWnd *pFrame, DWORD dwDockStyle, ADUI_LOADFN* pLoadFcn, ADUI_SAVEFN* pSaveFcn);
  482. // INTERNAL USE ONLY
  483. class ADUI_PORT CAdUiPaletteSetDockSite {
  484. public:
  485. void Initialize(CControlBar* pBar, CSize* pDesiredSize, DWORD dwDockStyle);
  486. CRect* CanDock(const CPoint& pMousePos);
  487. bool DockControlBar(CControlBar* pBar);
  488. private:
  489. DWORD m_dwDockStyle;
  490. CControlBar* m_pBar;
  491. CAdUiDockBar* m_pTargetDockBar;
  492. CFrameWnd* m_pDockSite;
  493. CRect m_rectDragDock;
  494. CRect m_rectDragHorz;
  495. CRect m_rectDragHorzAlone;
  496. };
  497. #endif // _ADESK_MAC_
  498. bool ADUI_PORT CanStealFocusFromDockedWindow (); // INTERNAL USE ONLY
  499. void ADUI_PORT GetSystemVirtualScreen(RECT &rect); // INTERNAL USE ONLY
  500. void ADUI_PORT AdUiEnableDockControlBars(BOOL bEnable, CStringArray* pToolIds = NULL); // INTERNAL USE ONLY
  501. /////////////////////////////////////////////////////////////////////////////
  502. //{{AFX_INSERT_LOCATION}}
  503. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  504. #pragma pack (pop)
  505. #endif