wavelength 1.0.0
Loading...
Searching...
No Matches
uicomponentfocuschangemsg.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
27public:
34 ~UIComponentFocusChangeMsg() override = default;
35
47 UIComponent *pOldComponent,
48 UIPanel *pPanel,
49 UIScreen *pScreen)
50 : mComponent(pComponent), mOldComponent(pOldComponent), mPanel(pPanel), mScreen(pScreen) {
51 }
52
59 void *operator new(size_t nSize) {
60 return PoolMemAlloc(static_cast<int>(nSize), "UIComponentFocusChangeMsg", 0);
61 }
62
68 void operator delete(void *pBlock) {
69 PoolMemFree(pBlock);
70 }
71
79 Message *Clone() override {
80 return new UIComponentFocusChangeMsg(*this);
81 }
82
90 int Type() override {
92 }
93
101 const char *GetName() const override {
102 return "UIComponentFocusChangeMsg";
103 }
104
112 void PrintExtra(PrnStream &stream) const override;
113
116 return mComponent;
117 }
118
121 return mOldComponent;
122 }
123
125 UIPanel *GetPanel() const {
126 return mPanel;
127 }
128
131 return mScreen;
132 }
133
134private:
135 UIComponent *mComponent;
136 UIComponent *mOldComponent;
137 UIPanel *mPanel;
138 UIScreen *mScreen;
139};
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
Text output stream.
Definition prnstream.h:16
void PrintExtra(PrnStream &stream) const override
Write the names of both components, the panel, and the screen.
~UIComponentFocusChangeMsg() override=default
Destroy the object.
const char * GetName() const override
Report this message's class name.
Definition uicomponentfocuschangemsg.h:101
UIPanel * GetPanel() const
Definition uicomponentfocuschangemsg.h:125
UIScreen * GetScreen() const
Definition uicomponentfocuschangemsg.h:130
int Type() override
Report this message's registered identity.
Definition uicomponentfocuschangemsg.h:90
UIComponent * GetComponent() const
Definition uicomponentfocuschangemsg.h:115
UIComponent * GetOldComponent() const
Definition uicomponentfocuschangemsg.h:120
UIComponentFocusChangeMsg(UIComponent *pComponent, UIComponent *pOldComponent, UIPanel *pPanel, UIScreen *pScreen)
Construct the message.
Definition uicomponentfocuschangemsg.h:46
Message * Clone() override
Produce a heap copy of this message.
Definition uicomponentfocuschangemsg.h:79
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_nUIComponentFocusChangeMsgType
Identity that UIComponentFocusChangeMsg::Type() reports.