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 Label _themeName;
16
17 BOOL _showThemeToggler;
18
19 wstring _licenseMessage;
20
21public:
22
24 virtual ~StatusBar();
25
26 void setText(const wstring& text);
27 void setLicenseMessage(const wstring& message);
28
29 void setShowThemeToggler(BOOL bShow = TRUE);
30
31 void onAction(const ActionEvent& ev);
32};
33
41class Frame: public Component
42{
43 GridPanel _contentPane;
44 StatusBar _statusBar;
45 TitleBar _titleBar;
46 MenuBar _menuBar;
47 BOOL _menuBarVisible;
48
49 wstring _title;
50 wstring _statusBarText;
51 wstring _ltoken;
52 BOOL _lValid;
53 wstring _lTo;
54 wstring _lDate;
55 wstring _lApplication;
56 BOOL _isCentered;
57
58 BOOL _showThemeToggler;
59
60 ActionListener* _menuBarListener;
61
62 Bounds _bannerRect;
63
68 void _clt(const wstring& t);
69
70protected:
71
80 BOOL getCreateWindowOptions(wstring& title, UINT& widownStyles, wstring& wndClassName, BOOL& isCustomWndProc);
81
86
87protected:
88
94
96
97 void setShowThemeToggler(BOOL bShow = TRUE);
98
99public:
100
106 Frame(const wstring& title);
107
111 virtual ~Frame();
112
113 void setIcon(const IconSource& iconSource);
114
115 void setTitle(const wstring& title);
116
117 void setStatusBarText(const wstring& text);
118
120
121 int show(long x = -1, long y = -1, long width = -1, long height = -1);
122
127 void setLicense(const wstring& licenseToken);
128
130
131 void Close();
132
133 Menu* addMenu(const wstring& menuName);
135
141 virtual void onConstructWindow() = 0;
142
147 void onTimer(unsigned int timerId);
148
151
156
157 void onMouseMoved(WinHandle hWnd, int x, int y, BOOL shiftPressed, BOOL ctrlPressed);
158
159 void onAction(WinHandle hTarget, long actionId, const ProcParams& procParams);
160};
HWND WinHandle
Definition Common.h:16
Definition EventListeners.h:38
Definition EventListeners.h:46
Definition Common.h:21
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()
Called when the component's window is resized.
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 onPaint(Graphics *g)
Called to paint the component's client area.
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 onMouseMoved(WinHandle hWnd, int x, int y, BOOL shiftPressed, BOOL ctrlPressed)
Called when the mouse is moved within the component.
int show(long x=-1, long y=-1, long width=-1, long height=-1)
void setIcon(const IconSource &iconSource)
Definition Graphics.h:171
A panel that arranges child components in a grid layout.
Definition GridPanel.h:40
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