3 /////////////////////////////////////////////////////////////////////////////
5 // Copyright (c) 2002 Iain Murray, Inference Group, Cavendish, Cambridge.
7 /////////////////////////////////////////////////////////////////////////////
9 // TODO: This class is fairly pointless now - it's basically a wrapper around
10 // a rebar control, which is almost definitely duplicating WTL functionality
12 #include "../Common/WinCommon.h"
13 #include "../resource.h"
16 using namespace Dasher
;
18 // Track memory leaks on Windows to the line that new'd the memory
20 #ifdef _DEBUG_MEMLEAKS
21 #define DEBUG_NEW new( _NORMAL_BLOCK, THIS_FILE, __LINE__ )
24 static char THIS_FILE
[] = __FILE__
;
28 CSlidebar::CSlidebar(HWND ParentWindow
, CAppSettings
*pAppSettings
) {
29 m_hRebar
= CreateWindowEx(WS_EX_WINDOWEDGE
,
32 WS_CHILD
| //WS_CLIPSIBLINGS |
34 CCS_BOTTOM
| CCS_NODIVIDER
,
36 ParentWindow
, NULL
, WinHelper::hInstApp
,
40 rbi
.cbSize
= sizeof(REBARINFO
);
42 rbi
.himl
= (HIMAGELIST
)NULL
;
44 SendMessage(m_hRebar
, RB_SETBARINFO
, 0, (LPARAM
)&rbi
);
47 rbBand
.cbSize
= sizeof(REBARBANDINFO
);
48 rbBand
.fMask
= RBBIM_STYLE
| RBBIM_CHILD
| RBBIM_CHILDSIZE
;
49 rbBand
.fStyle
= RBBS_CHILDEDGE
| RBBS_GRIPPERALWAYS
;
51 m_pStatusControl
= new CStatusControl(pAppSettings
);
52 m_pStatusControl
->Create(ParentWindow
);
55 m_pStatusControl
->GetWindowRect(&rc
);
57 rbBand
.hwndChild
= m_pStatusControl
->m_hWnd
;
58 rbBand
.cxMinChild
= 0;
59 rbBand
.cyMinChild
= rc
.bottom
- rc
.top
;
62 SendMessage(m_hRebar
, RB_INSERTBAND
, (WPARAM
)-1, (LPARAM
)&rbBand
);
65 void CSlidebar::Resize() {
66 SendMessage(m_pStatusControl
->m_hWnd
, WM_SIZE
, 0, 0);
71 int CSlidebar::GetHeight() {
73 GetWindowRect(m_hRebar
, &sRect
);
74 return sRect
.bottom
- sRect
.top
;