aduiTabCtrl.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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 _aduiTabCtrl_h
  11. #define _aduiTabCtrl_h
  12. #pragma pack (push, 8)
  13. #if _MSC_VER >= 1000
  14. #pragma once
  15. #endif // _MSC_VER >= 1000
  16. #ifndef _ADESK_MAC_
  17. /////////////////////////////////////////////////////////////////////////////
  18. /*
  19. USAGE TIPS:
  20. * For the most logical tab ordering w/r/t added tabs, make sure that the tab
  21. control itself is last in the tab order of the Main Frame dialog. Don't
  22. worry, this isn't really a constraint! (If you really must know the gory
  23. details, SetActiveTab() automatically sets focus to one of the controls
  24. within the newly activated tabs, so the main frame dialog's tab order is
  25. important in determining the tab *cycle*, not which control will receive
  26. focus at dialog initialization...)
  27. */
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CAdUiTab window
  30. #pragma warning(push)
  31. #pragma warning(disable : 4275)
  32. class ADUI_PORT CAdUiTab : public CTabCtrl {
  33. friend class CAdUiTabMainDialog;
  34. friend class CAdUiTabChildDialog;
  35. DECLARE_DYNAMIC(CAdUiTab);
  36. public:
  37. CAdUiTab ();
  38. virtual ~CAdUiTab ();
  39. // Operations
  40. private:
  41. BOOL m_bDirty;
  42. HWND m_hwndFocus;
  43. int m_iActiveTab;
  44. UINT m_uApplyButtonID;
  45. BOOL BringTabToFront(int iPos);
  46. void PositionTabDialog (CAdUiTabChildDialog *pDialog);
  47. public:
  48. BOOL AddTab (
  49. int iPos, CString const& sTabname,
  50. UINT uTemplateID, CAdUiTabChildDialog *pDialog
  51. );
  52. BOOL AddTab (
  53. int iPos, UINT uTabStringID,
  54. UINT uTemplateID, CAdUiTabChildDialog *pDialog
  55. );
  56. // Don't use CTabCtrl::DeleteItem! Use CAdUiTab::RemoveTab() instead!
  57. BOOL DeleteItem (int iPos);
  58. // Removes tab, destroys child. Only updates if child IsDirty().
  59. BOOL DestroyTab (int iPos, BOOL bUpdateData=FALSE);
  60. int GetActiveTab ();
  61. CAdUiTabMainDialog *GetMainDialog ();
  62. int GetTabIndex (CAdUiTabChildDialog *pDialog);
  63. CAdUiTabChildDialog *GetDialogPointer (int iPos);
  64. BOOL IsDirty ();
  65. // Removes tab (hiding it) Doesn't destroy child dialog.
  66. BOOL RemoveTab (int iPos);
  67. int SetActiveTab (int iPos);
  68. void SetApplyButtonID (UINT uID);
  69. // Focuses on the child of the currently active tab.
  70. void SetChildFocus ();
  71. void SetDirty (BOOL bDirty=TRUE);
  72. void SetValidationInfo (CDataExchange* pDX);
  73. // Data Exchange methods.
  74. public:
  75. BOOL DisplayData ();
  76. BOOL ExchangeData (BOOL bSaveAndValidate);
  77. BOOL ValidateData ();
  78. // ClassWizard-controlled
  79. public:
  80. //{{AFX_VIRTUAL(CAdUiTab)
  81. protected:
  82. virtual void PreSubclassWindow(); // INTERNAL USE ONLY
  83. //}}AFX_VIRTUAL
  84. protected:
  85. //{{AFX_MSG(CAdUiTab)
  86. afx_msg BOOL OnSelChange(NMHDR* pNMHDR, LRESULT* pResult); // INTERNAL USE ONLY
  87. afx_msg BOOL OnSelChanging(NMHDR* pNMHDR, LRESULT* pResult); // INTERNAL USE ONLY
  88. //}}AFX_MSG
  89. DECLARE_MESSAGE_MAP()
  90. };
  91. #pragma warning(pop)
  92. #endif //_ADESK_MAC_
  93. /////////////////////////////////////////////////////////////////////////////
  94. //{{AFX_INSERT_LOCATION}}
  95. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  96. #pragma pack (pop)
  97. #endif
  98. //////////////////////////////////////////////////////////////////////////////