SavvyUI C++ UI Library
Loading...
Searching...
No Matches
Frame.h
Go to the documentation of this file.
1#pragma once
2
3#include "Component.h"
4#include "GridPanel.h"
5#include "Button.h"
6#include "Label.h"
7#include "TitleBar.h"
8#include "MenuBar.h"
9
10class StatusBar : public GridPanel, public ActionListener
11{
12 Label _textLabel;
13 Button _licenseBtn;
14 Button _themeBtn;
15
16 BOOL _showThemeToggler;
17
18 wstring _licenseMessage;
19
20public:
21
23 virtual ~StatusBar();
24
25 void setText(const wstring& text);
26 void setLicenseMessage(const wstring& message);
27
28 void setShowThemeToggler(BOOL bShow = TRUE);
29
30 void onAction(const ActionEvent& ev);
31};
32
40class Frame: public Component
41{
42 GridPanel _contentPane;
43 StatusBar _statusBar;
44 TitleBar _titleBar;
45 MenuBar _menuBar;
46
47 wstring _title;
48 wstring _statusBarText;
49 wstring _ltoken;
50 BOOL _lValid;
51 wstring _lTo;
52 wstring _lDate;
53 wstring _lApplication;
54 BOOL _isCentered;
55
56 BOOL _showThemeToggler;
57
58 ActionListener* _menuBarListener;
59
64 void _clt(const wstring& t);
65
66protected:
67
76 BOOL getCreateWindowOptions(wstring& title, UINT& widownStyles, wstring& wndClassName, BOOL& isCustomWndProc);
77
82
83protected:
84
90
92
93 void setShowThemeToggler(BOOL bShow = TRUE);
94
95public:
96
102 Frame(const wstring& title);
103
107 virtual ~Frame();
108
109 void setIcon(const IconSource& iconSource);
110
111 void setTitle(const wstring& title);
112
113 void setStatusBarText(const wstring& text);
114
116
121 void setLicense(const wstring& licenseToken);
122
124
125 void Close();
126
127 Menu* addMenu(const wstring& menuName);
129
135 virtual void onConstructWindow() = 0;
136
141 void onTimer(unsigned int timerId);
142
147
152
153 void onAction(WinHandle hTarget, long actionId, const ProcParams& procParams);
154};
HWND WinHandle
Definition Common.h:16
Definition EventListeners.h:38
Definition EventListeners.h:46
A clickable UI component representing a button with customizable text and type.
Definition Button.h:13
Component()
Constructs a new Component instance.
void setMenuBarListener(ActionListener *l)
void onWindowResized()
Handles window resize events.
Frame(const wstring &title)
Constructs a Frame with specified window class name and title.
void setStatusBarText(const wstring &text)
GridPanel * getContentPane()
Returns a pointer to the frame's content pane (GridPanel).
void Close()
void onTimer(unsigned int timerId)
Handles timer events.
void windowCreated()
Called after the native window has been created.
BOOL getCreateWindowOptions(wstring &title, UINT &widownStyles, wstring &wndClassName, BOOL &isCustomWndProc)
Retrieves window creation options such as title, styles, and class name.
void setTitle(const wstring &title)
void onWindowMoved()
Handles window move events.
void onAction(WinHandle hTarget, long actionId, const ProcParams &procParams)
Called when an action occurs on the component.
void setMenuListener(ActionListener *l)
BOOL usesCustomCaption()
void setWindowCentered()
virtual ~Frame()
Destructor.
virtual void onConstructWindow()=0
Abstract method called to perform window construction tasks.
Menu * addMenu(const wstring &menuName)
void setShowThemeToggler(BOOL bShow=TRUE)
void setLicense(const wstring &licenseToken)
Sets the license token and updates licensing status.
void setIcon(const IconSource &iconSource)
A panel that arranges child components in a grid layout.
Definition GridPanel.h:39
Definition Graphics.h:125
A UI component for displaying text with customizable alignment.
Definition Label.h:13
Definition MenuBar.h:46
Definition MenuBar.h:26
Definition Component.h:9
Definition Frame.h:11
void setLicenseMessage(const wstring &message)
void setText(const wstring &text)
void setShowThemeToggler(BOOL bShow=TRUE)
void onAction(const ActionEvent &ev)
virtual ~StatusBar()
Definition TitleBar.h:7