SavvyUI C++ UI Library
Loading...
Searching...
No Matches
CardPanel.h
Go to the documentation of this file.
1#pragma once
2
3#include "PanelBase.h"
4
5class Card
6{
7public:
8 Card(const wstring& cardName, PanelBase*component)
9 {
10 _cardName = cardName;
11 _component = component;
12 }
13
14 wstring _cardName;
15
17};
18
26class CardPanel : public Component
27{
31 vector<Card> _cards;
32
36 wstring _visibleCardName;
37
38protected:
39
49 BOOL getCreateWindowOptions(wstring& title, UINT& widownStyles, wstring& wndClassName, BOOL& isCustomWndProc);
50
55
56public:
57
62
66 virtual ~CardPanel();
67
71 void clear();
72
79 void addCard(const wstring& cardName, PanelBase* component);
80
86 void setVisibleCard(const wstring& cardName);
87
93 void onPaint(Graphics *g);
94
99
104};
Card(const wstring &cardName, PanelBase *component)
Definition CardPanel.h:8
PanelBase * _component
Definition CardPanel.h:16
wstring _cardName
Definition CardPanel.h:14
BOOL getCreateWindowOptions(wstring &title, UINT &widownStyles, wstring &wndClassName, BOOL &isCustomWndProc)
Retrieves options for window creation.
void clear()
Removes all cards from the panel.
void onWindowResized()
Called when the window is resized.
void addCard(const wstring &cardName, PanelBase *component)
Adds a new card to the panel.
void onPaint(Graphics *g)
Renders the currently visible card.
void windowCreated()
Called when the window has been successfully created.
void setVisibleCard(const wstring &cardName)
Sets which card is currently visible based on its name.
CardPanel()
Constructs a new CardPanel instance.
virtual ~CardPanel()
Destroys the CardPanel and its contained components.
void onWindowMoved()
Called when the window is moved.
Component()
Constructs a new Component instance.
Definition Graphics.h:161
Base class for panel-like components that arrange child components in a grid layout.
Definition PanelBase.h:29