Skip to content

Commit 8024f9f

Browse files
committed
POC CTimelineView now working inside splitter and TabItem
1 parent 1a7baa5 commit 8024f9f

File tree

5 files changed

+36
-35
lines changed

5 files changed

+36
-35
lines changed

GDIGraphicsPOC/CMainFrame2.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ LRESULT fusion::CMainFrame2::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, B
3131
GetClientRect(&rect);
3232
rect.bottom = 540; // 40x 13 = 520, + 20 for colomn header
3333

34-
// here class Reflector is used, but I could also just have added REFLECT_NOTIFICATIONS() to the MSG_MAP of class CMainFrame2 (tested both, both work)
35-
m_reflector.Create(*this, rect, L"", WS_CHILD | WS_VISIBLE);
36-
m_reflector.GetClientRect(&rect);
37-
m_logview.Create(m_reflector, rect);
34+
m_logview.Create(*this, rect);
3835
AddDummyContent(m_logview);
3936
return 0;
4037
}

GDIGraphicsPOC/CMainFrame2.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,25 @@ namespace fusion {
3030
class CMainFrame2 : public WTL::CFrameWindowImpl<CMainFrame2, ATL::CWindow, ATL::CFrameWinTraits>
3131
{
3232
public:
33-
DECLARE_FRAME_WND_CLASS(_T("First WTL window"), IDR_MAINFRAME);
34-
35-
BEGIN_MSG_MAP(CMainFrame2)
36-
MESSAGE_HANDLER(WM_CREATE, OnCreate)
37-
MESSAGE_HANDLER(WM_CLOSE, OnClose)
38-
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
39-
MSG_WM_SIZE(OnSize)
40-
CHAIN_MSG_MAP(CFrameWindowImpl<CMainFrame2>)
41-
DEFAULT_REFLECTION_HANDLER()
42-
END_MSG_MAP()
43-
44-
LRESULT OnSize(UINT nType, CSize Extent);
45-
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
46-
LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
47-
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
33+
DECLARE_FRAME_WND_CLASS(_T("First WTL window"), IDR_MAINFRAME);
34+
35+
BEGIN_MSG_MAP(CMainFrame2)
36+
MESSAGE_HANDLER(WM_CREATE, OnCreate)
37+
MESSAGE_HANDLER(WM_CLOSE, OnClose)
38+
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
39+
MSG_WM_SIZE(OnSize)
40+
CHAIN_MSG_MAP(CFrameWindowImpl<CMainFrame2>)
41+
DEFAULT_REFLECTION_HANDLER()
42+
REFLECT_NOTIFICATIONS()
43+
END_MSG_MAP()
44+
45+
LRESULT OnSize(UINT nType, CSize Extent);
46+
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
47+
LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
48+
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
4849

4950
private:
50-
CLogView m_logview;
51-
Reflector m_reflector;
51+
CLogView m_logview;
5252
};
5353

5454
} // namespace fusion

GDIGraphicsPOC/Logview.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,6 @@
2020

2121
namespace fusion {
2222

23-
class Reflector : public CWindowImpl<Reflector>
24-
{
25-
public:
26-
DECLARE_WND_CLASS_EX(_T("MyReflectorWindow"), 0, -1)
27-
BEGIN_MSG_MAP(Reflector)
28-
REFLECT_NOTIFICATIONS()
29-
END_MSG_MAP()
30-
};
31-
3223
template <typename T>
3324
void AddDummyContent(T& t)
3425
{

GDIGraphicsPOC/MainFrame.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hInstPrev, LPSTR szCmdLine, int nC
1010
// CMainFrame is a CTabbedFrameImpl<> and does not render as intended
1111
// CMainFrame2 is a CFrameWindowImpl<> and _does_ render as intended
1212

13-
fusion::CMainFrame wndMain;
13+
fusion::CMainFrame2 wndMain;
1414

1515
// Create & show our main window
1616
if (nullptr == wndMain.Create(nullptr, CWindow::rcDefault, _T("WTL Frame"), WS_OVERLAPPEDWINDOW))
@@ -75,4 +75,4 @@ namespace fusion
7575
return 0;
7676
}
7777

78-
}
78+
}

GDIGraphicsPOC/TabItem.h

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ inline std::wstring FormatDuration(double seconds)
6969
return wstringbuilder() << std::fixed << std::setprecision(3) << seconds << L" " << *unit;
7070
}
7171

72+
class CMyPaneContainer : public CPaneContainerImpl<CMyPaneContainer>
73+
{
74+
public:
75+
DECLARE_WND_CLASS_EX(_T("MY_PaneContainer"), 0, -1)
76+
77+
BEGIN_MSG_MAP(CMyPaneContainerImpl)
78+
REFLECT_NOTIFICATIONS()
79+
CHAIN_MSG_MAP(CPaneContainerImpl<CMyPaneContainer>)
80+
END_MSG_MAP()
81+
};
82+
7283
template <typename T>
7384
class TabItem : public CTabViewTabItem
7485
{
@@ -83,7 +94,7 @@ class TabItem : public CTabViewTabItem
8394
return m_timelineView;
8495
}
8596

86-
void DisablePaneHeader(CPaneContainer& panecontainer)
97+
void DisablePaneHeader(CMyPaneContainer& panecontainer)
8798
{
8899
panecontainer.SetPaneContainerExtendedStyle(PANECNT_NOCLOSEBUTTON, 0);
89100
panecontainer.m_cxyHeader = 0;
@@ -104,6 +115,8 @@ class TabItem : public CTabViewTabItem
104115
m_bottom.Create(m_split, L"");
105116
m_split.SetSplitterPanes(m_top, m_bottom, true);
106117
m_split.SetSplitterPos(560);
118+
m_split.UpdateProportionalPos();
119+
m_split.Invalidate();
107120

108121
DisablePaneHeader(m_top);
109122
DisablePaneHeader(m_bottom);
@@ -112,8 +125,8 @@ class TabItem : public CTabViewTabItem
112125
private:
113126
T m_logview;
114127
CHorSplitterWindow m_split;
115-
CPaneContainer m_top;
116-
CPaneContainer m_bottom;
128+
CMyPaneContainer m_top;
129+
CMyPaneContainer m_bottom;
117130
};
118131

119132
using CLogViewTabItem2 = TabItem<CLogView>;

0 commit comments

Comments
 (0)