1// Windows/Control/StatusBar.h
2
3#ifndef __WINDOWS_CONTROL_STATUSBAR_H
4#define __WINDOWS_CONTROL_STATUSBAR_H
5
6#include "../Window.h"
7
8namespace NWindows {
9namespace NControl {
10
11class CStatusBar: public NWindows::CWindow
12{
13public:
14  bool Create(LONG style, LPCTSTR text, HWND hwndParent, UINT id)
15    { return (_window = ::CreateStatusWindow(style, text, hwndParent, id)) != 0; }
16  bool SetText(LPCTSTR text)
17    { return CWindow::SetText(text); }
18  bool SetText(unsigned index, LPCTSTR text, UINT type)
19    { return LRESULTToBool(SendMessage(SB_SETTEXT, index | type, (LPARAM)text)); }
20  bool SetText(unsigned index, LPCTSTR text)
21    { return SetText(index, text, 0); }
22
23  #ifndef _UNICODE
24  bool Create(LONG style, LPCWSTR text, HWND hwndParent, UINT id)
25    { return (_window = ::CreateStatusWindowW(style, text, hwndParent, id)) != 0; }
26  bool SetText(LPCWSTR text)
27    { return CWindow::SetText(text); }
28  bool SetText(unsigned index, LPCWSTR text, UINT type)
29    { return LRESULTToBool(SendMessage(SB_SETTEXTW, index | type, (LPARAM)text)); }
30  bool SetText(unsigned index, LPCWSTR text)
31    { return SetText(index, text, 0); }
32  #endif
33
34  bool SetParts(unsigned numParts, const int *edgePostions)
35    { return LRESULTToBool(SendMessage(SB_SETPARTS, numParts, (LPARAM)edgePostions)); }
36  void Simple(bool simple)
37    { SendMessage(SB_SIMPLE, BoolToBOOL(simple), 0); }
38};
39
40}}
41
42#endif
43