SavvyUI C++ UI Library
Loading...
Searching...
No Matches
CardPanel.h
Go to the documentation of this file.
1#pragma once
2
3#include "Component.h"
4
5class Card
6{
7public:
8 Card(const wstring& cardName, Component* 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, Component* component);
80
86 void setVisibleCard(const wstring& cardName);
87
93 void onPaint(Graphics *g);
94
99
104};
Card(const wstring &cardName, Component *component)
Definition CardPanel.h:8
Component * _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 addCard(const wstring &cardName, Component *component)
Adds a new card to the panel.
void clear()
Removes all cards from the panel.
void onWindowResized()
Called when the window is resized.
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.
Base class for all UI components providing window creation, event handling, and listener management.
Definition Component.h:32
Component()
Constructs a new Component instance.
Definition Graphics.h:171