wavelength 1.0.0
Loading...
Searching...
No Matches
uicomponentselectstartmsg.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4
5#include "msg/message.h"
6#include "os/mem.h"
7#include "os/prnstream.h"
8#include "ui/uicomponent.h"
9#include "ui/uipanel.h"
10#include "ui/uiscreen.h"
11
19
28public:
41 UIComponent *pComponent, UIPanel *pPanel, UIScreen *pScreen, int nButton, int nPad)
42 : mComponent(pComponent), mPanel(pPanel), mScreen(pScreen), mButton(nButton), mPad(nPad) {
43 }
44
51 void *operator new(size_t nSize) {
52 return PoolMemAlloc(static_cast<int>(nSize), "UIComponentSelectStartMsg", 0);
53 }
54
60 void operator delete(void *pBlock) {
61 PoolMemFree(pBlock);
62 }
63
71 Message *Clone() override {
72 return new UIComponentSelectStartMsg(*this);
73 }
74
82 int Type() override {
84 }
85
93 const char *GetName() const override {
94 return "UIComponentSelectStartMsg";
95 }
96
104 void PrintExtra(PrnStream &stream) const override;
105
108 return mComponent;
109 }
110
112 UIPanel *GetPanel() const {
113 return mPanel;
114 }
115
118 return mScreen;
119 }
120
122 int GetButton() const {
123 return mButton;
124 }
125
127 int GetPad() const {
128 return mPad;
129 }
130
131private:
132 UIComponent *mComponent;
133 UIPanel *mPanel;
134 UIScreen *mScreen;
135 int mButton;
136 int mPad;
137};
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
Text output stream.
Definition prnstream.h:16
const char * GetName() const override
Report this message's class name.
Definition uicomponentselectstartmsg.h:93
int Type() override
Report this message's registered identity.
Definition uicomponentselectstartmsg.h:82
int GetPad() const
Definition uicomponentselectstartmsg.h:127
int GetButton() const
Definition uicomponentselectstartmsg.h:122
UIScreen * GetScreen() const
Definition uicomponentselectstartmsg.h:117
UIComponent * GetComponent() const
Definition uicomponentselectstartmsg.h:107
UIComponentSelectStartMsg(UIComponent *pComponent, UIPanel *pPanel, UIScreen *pScreen, int nButton, int nPad)
Construct the message.
Definition uicomponentselectstartmsg.h:40
UIPanel * GetPanel() const
Definition uicomponentselectstartmsg.h:112
void PrintExtra(PrnStream &stream) const override
Write the names of the component, the panel, and the screen.
Message * Clone() override
Produce a heap copy of this message.
Definition uicomponentselectstartmsg.h:71
One control of a front-end panel, such as a label, a button, or a list.
Definition uicomponent.h:21
Group of components drawn from one .rnd file, which a screen shows.
Definition uipanel.h:35
One front-end screen, a set of panels shown together with one panel holding the focus.
Definition uiscreen.h:35
void * PoolMemAlloc(int nSize, const char *pszTag, int nAlign)
Allocate a block from the pool heaps and bill it to a tag.
void PoolMemFree(void *pBlock)
Return a block PoolMemAlloc() handed out to the pool heap that owns it.
int g_nUIComponentSelectStartMsgType
Identity that UIComponentSelectStartMsg::Type() reports.