18 #ifndef INC_C4ScriptGuiWindow
19 #define INC_C4ScriptGuiWindow
108 int32_t subwindowID{0};
141 Prop *current{
nullptr};
145 std::map<C4String*, Prop> taggedProperties;
146 void CleanUp(Prop &prop);
153 void SetInt(int32_t to,
C4String *tag =
nullptr);
154 void SetFloat(
float to,
C4String *tag =
nullptr);
155 void SetNull(
C4String *tag =
nullptr);
203 bool mainWindowNeedsLayoutUpdate;
205 bool wasRemovedFromParent{
false };
206 bool wasClosed{
false };
208 int lockRemovalForClosingCallbackCounter{ 0 };
209 void lockRemovalForClosingCallback();
210 void unlockRemovalForClosingCallback();
211 bool isRemovalLockedForClosingCallback() const noexcept {
return lockRemovalForClosingCallbackCounter > 0; }
214 const C4Object *GetTarget() {
return target; }
220 void SetID(int32_t to) {
id = to; }
224 std::multimap<int32_t, C4ScriptGuiWindow *> childrenIDMap;
237 int32_t GenerateMenuID() {
return ++id; }
238 int32_t GenerateActionID() {
return ++id; }
242 void EnableScrollBar(
bool enable =
true,
float childrenHeight = 0.0f);
329 virtual bool MouseInput(int32_t iButton, int32_t iX, int32_t iY,
DWORD dwKeyParam);
331 virtual bool ProcessMouseInput(int32_t iButton, int32_t iX, int32_t iY,
DWORD dwKeyParam, int32_t parentOffsetX, int32_t parentOffsetY);
350 void OnMouseIn(int32_t
player, int32_t parentOffsetX, int32_t parentOffsetY);
356 static float Em2Pix(
float em);
357 static float Pix2Em(
float pix);
bool Init(C4ValueArray *array, int32_t index=0)
const C4Value ToC4Value(bool first=true)
void Execute(C4ScriptGuiWindow *parent, int32_t player, int32_t actionType)
bool ExecuteCommand(int32_t actionID, C4ScriptGuiWindow *parent, int32_t player)
C4ScriptGuiWindowAction()
~C4ScriptGuiWindowAction()
void ClearPointers(C4Object *pObj)
bool UpdateChildLayout(C4TargetFacet &cgo, float parentWidth, float parentHeight)
void UpdateLayoutVertical()
C4ScriptGuiWindow * GetChildByName(C4String *childName)
void RemoveChild(C4ScriptGuiWindow *child, bool close=true, bool all=false)
bool DrawChildren(C4TargetFacet &cgo, int32_t player, int32_t withMultipleFlag=-1, C4Rect *currentClippingRect=nullptr)
float CalculateRelativeSize(float parentWidthOrHeight, C4ScriptGuiWindowPropertyName::type absoluteProperty, C4ScriptGuiWindowPropertyName::type relativeProperty)
bool CreateFromPropList(C4PropList *proplist, bool resetStdTag=false, bool isUpdate=false, bool isLoading=false)
C4ScriptGuiWindow * GetChildByID(int32_t child)
C4ScriptGuiWindow * GetSubWindow(int32_t childID, C4Object *childTarget)
bool IsVisibleTo(int32_t player)
bool ExecuteCommand(int32_t actionID, int32_t player, int32_t subwindowID, int32_t actionType, C4Object *target)
void Draw(C4TargetFacet &cgo) override
const C4Value ToC4Value()
virtual bool ProcessMouseInput(int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam, int32_t parentOffsetX, int32_t parentOffsetY)
void SetEnumeratedID(int enumID)
bool DrawAll(C4TargetFacet &cgo, int32_t player)
~C4ScriptGuiWindow() override
void RequestLayoutUpdate()
int32_t currentMouseState
bool GetClippingRect(int32_t &left, int32_t &top, int32_t &right, int32_t &bottom)
static const float standardHeight
void OnMouseIn(int32_t player, int32_t parentOffsetX, int32_t parentOffsetY)
virtual bool MouseInput(int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam)
C4ScriptGuiWindow * AddChild()
static const float standardWidth
void Denumerate(C4ValueNumbers *numbers)
friend class C4ScriptGuiWindowScrollBar
void SetTag(C4String *tag)
void MouseEnter(C4GUI::CMouse &rMouse) override
void UpdateLayoutTightGrid()
bool UpdateLayout(C4TargetFacet &cgo)
void MouseLeave(C4GUI::CMouse &rMouse) override
void ClearPointers(C4Object *pObj)
void OnMouseOut(int32_t player)
C4ScriptGuiWindowAction * GetAction()
C4ScriptGuiWindowProperty()=default
const C4Value ToC4Value()
~C4ScriptGuiWindowProperty()
void ClearPointers(C4Object *pObj)
C4String * GetCurrentTag()
std::list< C4ScriptGuiWindowAction * > GetAllActions()
void Set(const C4Value &value, C4String *tag)
bool SwitchTag(C4String *tag)
StdCopyStrBuf * GetStrBuf()
C4GUI::FrameDecoration * GetFrameDecoration()