diff --git "a/AtlRollOutCtrl.h" "b/AtlRollOutCtrl.h"index 68566eb..2f585d4100644
--- "a/ARK-Breeding-Calculator/AtlRollOutCtrl.h"
+++ "b/ARK-Breeding-Calculator/AtlRollOutCtrl.h"@@-319,6 +319,15 @@ public:#define RCM_COLLAPSE (RCM_BASE + 2)
#define RCM_ISEXPANDED (RCM_BASE + 3)
#define RCM_GETRECT (RCM_BASE + 4)
+#define RCM_REINIT (RCM_BASE + 5)
+
+//Messages
+#define RCCM_BASE (WM_USER + 2)
+//Ensures that the given rect is visible
+//WPARAM unused
+//LPARAM ptr to rect in screen space
+#define RCCM_ENSUREVISIBLE (RCCM_BASE + 0)
+#define RCCM_RECALC_LAYOUT (RCCM_BASE + 1)template<DWORD t_dwStyle, DWORD t_dwExStyle, DWORD t_dwExRolloutCtrlStyle>
classCRolloutCtrlImplTraits
@@-462,6 +471,7 @@ public:
MESSAGE_HANDLER(RCM_COLLAPSE, OnCollapse)
MESSAGE_HANDLER(RCM_ISEXPANDED, OnIsExpanded)
MESSAGE_HANDLER(RCM_GETRECT, OnGetRect)+MESSAGE_HANDLER(RCM_REINIT, OnReInit)
COMMAND_CODE_HANDLER(BN_CLICKED, OnButtonClicked)
COMMAND_CODE_HANDLER(BN_SETFOCUS, OnButtonSetFocus)
ALT_MSG_MAP(1)
@@-594,6 +604,38 @@ public:return 1;
}+ LRESULT OnReInit(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)+{+ m_Child.GetWindowRect(&m_rcExpanded);+ ScreenToClient(&m_rcExpanded);+
+ HFONT hFont = m_Child.GetFont();//AtlGetDefaultGuiFont();
+SetFont(hFont);+
+CWindowDC dc(m_hWnd);+ HFONT hOldFont =dc.SelectFont(hFont);+SIZE ptTextExtent;+TCHAR szTitle[MAX_PATH];+GetWindowText(szTitle, MAX_PATH);+ dc.GetTextExtent(szTitle, -1, &ptTextExtent);+dc.SelectFont(hOldFont);+
+ int cyButton = ptTextExtent.cy + 2 *m_sizeBorder.cy;+
+ ::InflateRect(&m_rcExpanded, m_sizeBorder.cx, m_sizeBorder.cy);+ m_rcExpanded.bottom +=cyButton;+
+ m_rcCollapsed =m_rcExpanded;+ m_rcCollapsed.bottom = m_rcCollapsed.top +cyButton;+
+ SetWindowPos(NULL, &m_rcExpanded, SWP_NOMOVE | SWP_NOZORDER |SWP_NOACTIVATE);+
+ //notify parent change layout.
+ ::SendMessage(::GetParent(m_hWnd), RCCM_RECALC_LAYOUT, 0, 0);+
+ return 0;+}+
//Implementation
voidInit()
{
@@-681,13 +723,6 @@ public:
typedef CRolloutContainerImplTraits<WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, WS_EX_CLIENTEDGE | WS_EX_CONTROLPARENT>CRolloutContainerTraits;-//Messages
-#define RCCM_BASE (WM_USER + 2)
-//Ensures that the given rect is visible
-//WPARAM unused
-//LPARAM ptr to rect in screen space
-#define RCCM_ENSUREVISIBLE (RCCM_BASE + 0)
-template<class T, class TBase = CWindow, class TWinTraits = CRolloutContainerTraits>
class ATL_NO_VTABLE CRolloutContainerImpl : public CWindowImpl<T, TBase, TWinTraits>{
@@-906,9 +941,19 @@ public:
MESSAGE_HANDLER(WM_SETCURSOR, OnSetCursor)
MESSAGE_HANDLER(DM_GETDEFID, OnGetDefId)
MESSAGE_HANDLER(RCCM_ENSUREVISIBLE, OnEnsureVisible)+MESSAGE_HANDLER(RCCM_RECALC_LAYOUT, OnUpdateLayout)
COMMAND_CODE_HANDLER(BN_CLICKED, OnRolloutCtrlClicked)
END_MSG_MAP()+ LRESULT OnUpdateLayout(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL&bHandled)+{+UpdateSliderRect();+InvalidateSlider();+UpdateLayout();+
+ return 0;+}+LRESULT OnSize(UINT/*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL&bHandled)
{
m_sizePage.cx= LOWORD(lParam);
主要增加两个消息,CRolloutCtrlImpl的RCM_REINIT消息,及CRolloutContainerImpl的RCCM_RECALC_LAYOUT消息