OpenClonk
C4GUI::Screen Class Reference

#include <C4Gui.h>

Inheritance diagram for C4GUI::Screen:
[legend]
Collaboration diagram for C4GUI::Screen:
[legend]

Public Member Functions

void RemoveElement (Element *pChild) override
 
const C4RectGetPreferredDlgRect ()
 
void ShowDialog (Dialog *pDlg, bool fFade)
 
void CloseDialog (Dialog *pDlg, bool fFade)
 
void ActivateDialog (Dialog *pDlg)
 
void RecheckActiveDialog ()
 
DialogGetTopDialog ()
 
 Screen ()
 
 ~Screen () override
 
void Init (int32_t tx, int32_t ty, int32_t twdt, int32_t thgt)
 
void Clear ()
 
void Render (bool fDoBG)
 
void RenderMouse (C4TargetFacet &cgo)
 
ScreenGetScreen () override
 
float GetZoom () const
 
bool IsActive ()
 
bool KeyAny ()
 
virtual bool CharIn (const char *c)
 
bool MouseInput (int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam, Dialog *pDlg, class C4Viewport *pVP)
 
void MouseMove (int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam, class C4Viewport *pVP)
 
void SetMouseInGUI (bool fInGUI, bool fByMouse)
 
bool RecheckMouseInput ()
 
bool ShowMessage (const char *szMessage, const char *szCaption, Icons icoIcon, int32_t *piConfigDontShowAgainSetting=nullptr)
 
bool ShowErrorMessage (const char *szMessage)
 
bool ShowMessageModal (const char *szMessage, const char *szCaption, DWORD dwButtons, Icons icoIcon, int32_t *piConfigDontShowAgainSetting=nullptr)
 
ProgressDialogShowProgressDlg (const char *szMessage, const char *szCaption, int32_t iMaxProgress=100, int32_t iInitialProgress=0, Icons icoIcon=Ico_Wait)
 
bool ShowModalDlg (Dialog *pDlg, bool fDestruct=true)
 
bool ShowRemoveDlg (Dialog *pDlg)
 
void CloseAllDialogs (bool fWithOK)
 
void SetPreferredDlgRect (const C4Rect &rtNewPref)
 
DialogGetDialog (C4Window *pWindow)
 
void DoContext (ContextMenu *pNewCtx, Element *pAtElement, int32_t iX, int32_t iY)
 
void AbortContext (bool fByUser)
 
int32_t GetContextMenuIndex ()
 
int32_t GetLastContextMenuIndex ()
 
bool HasContext ()
 
bool HasFullscreenDialog (bool fIncludeFading)
 
DialogGetFullscreenDialog (bool fIncludeFading)
 
void OnSec1Timer ()
 
void SetExclusive (bool fToState)
 
bool IsExclusive ()
 
bool HasKeyboardFocus ()
 
bool HasMouseFocus ()
 
int32_t GetMouseControlledDialogCount ()
 
void UpdateMouseFocus ()
 
void UpdateGamepadGUIControlEnabled ()
 
void MouseInput (CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam) override
 
void MouseInput (CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam) override
 
void SetPos (int32_t iXPos, int32_t iYPos)
 
void UpdateOwnPos () override
 
C4RectGetClientRect () override
 
void ApplyElementOffset (int32_t &riX, int32_t &riY) override
 
void ApplyInvElementOffset (int32_t &riX, int32_t &riY) override
 
virtual bool IsComponentOutsideClientArea ()
 
virtual int32_t GetMarginTop ()
 
virtual int32_t GetMarginLeft ()
 
virtual int32_t GetMarginRight ()
 
virtual int32_t GetMarginBottom ()
 
void ClearChildren ()
 
void MakeLastElement (Element *pChild)
 
void AddElement (Element *pChild)
 
void ReaddElement (Element *pChild)
 
void InsertElement (Element *pChild, Element *pInsertBefore)
 
ElementGetNextNestedElement (Element *pPrevElement, bool fBackwards)
 
ElementGetFirstContained () override
 
virtual ElementGetLastContained ()
 
ElementGetFirstNestedElement (bool fBackwards) override
 
Iterator begin ()
 
Iterator end ()
 
ReverseIterator rbegin ()
 
ReverseIterator rend ()
 
ElementGetFirst ()
 
ElementGetLast ()
 
ContainerGetContainer () override
 
ElementGetElementByIndex (int32_t i)
 
int32_t GetElementCount ()
 
void SetVisibility (bool fToValue) override
 
virtual bool IsFocused (Control *pCtrl)
 
virtual bool IsSelectedChild (Element *pChild)
 
bool IsParentOf (Element *pEl) override
 
virtual void MouseEnter (CMouse &rMouse)
 
virtual void MouseLeave (CMouse &rMouse)
 
virtual void StartDragging (CMouse &rMouse, int32_t iX, int32_t iY, DWORD dwKeyParam)
 
virtual void DoDragging (CMouse &rMouse, int32_t iX, int32_t iY, DWORD dwKeyParam)
 
virtual void StopDragging (CMouse &rMouse, int32_t iX, int32_t iY, DWORD dwKeyParam)
 
bool DoContext ()
 
ContainerGetParent ()
 
virtual class DialogGetDlg ()
 
virtual ControlIsFocusElement ()
 
void ScreenPos2ClientPos (int32_t &riX, int32_t &riY)
 
void ClientPos2ScreenPos (int32_t &riX, int32_t &riY)
 
void SetToolTip (const char *szNewTooltip, bool is_immediate=false)
 
const char * GetToolTip ()
 
const char * GetOwnToolTip ()
 
bool IsImmediateToolTip () const
 
int32_t GetWidth ()
 
int32_t GetHeight ()
 
C4RectGetBounds ()
 
void SetBounds (const C4Rect &rcNewBound)
 
C4Rect GetContainedClientRect ()
 
ElementGetNext () const
 
ElementGetPrev () const
 
bool IsInActiveDlg (bool fForKeyboard)
 
C4Rect GetToprightCornerRect (int32_t iWidth=16, int32_t iHeight=16, int32_t iHIndent=4, int32_t iVIndent=4, int32_t iIndexX=0)
 
bool IsVisible ()
 
virtual int32_t GetListItemTopSpacing ()
 
virtual bool GetListItemTopSpacingBar ()
 
void SetDragTarget (Window *pToWindow)
 
void SetContextHandler (ContextHandler *pNewHd)
 
virtual ContextHandlerGetContextHandler ()
 

Static Public Member Functions

static ScreenGetScreenS ()
 
static void DrawToolTip (const char *szTip, C4TargetFacet &cgo, float guix, float guiy)
 

Public Attributes

CMouse Mouse
 
bool fVisible {true}
 

Protected Member Functions

virtual void Draw (C4TargetFacet &cgo, bool fDoBG)
 
void ElementPosChanged (Element *pOfElement) override
 
void Draw (C4TargetFacet &cgo) override
 
void Draw (C4TargetFacet &cgo) override
 
virtual void ElementSizeChanged (Element *pOfElement)
 
virtual void AfterElementRemoval ()
 
bool OnHotkey (uint32_t cHotkey) override
 
virtual void DrawElement (C4TargetFacet &cgo)
 
virtual void UpdateSize ()
 
virtual void UpdatePos ()
 
void Draw3DFrame (C4TargetFacet &cgo, bool fUp=false, int32_t iIndent=1, BYTE byAlpha=C4GUI_BorderAlpha, bool fDrawTop=true, int32_t iTopOff=0, bool fDrawLeft=true, int32_t iLeftOff=0)
 
void DrawBar (C4TargetFacet &cgo, DynBarFacet &rFacets)
 
void DrawVBar (C4TargetFacet &cgo, DynBarFacet &rFacets)
 
void DrawHBarByVGfx (C4TargetFacet &cgo, DynBarFacet &rFacets)
 
void DrawHVBar (C4TargetFacet &cgo, DynBarFacet &rFacets, C4DrawTransform &trf, int32_t iMiddleLength)
 
virtual bool IsOwnPtrElement ()
 
virtual bool IsExternalDrawDialog ()
 
virtual bool IsMenu ()
 
virtual class DialogWindowGetDialogWindow ()
 
virtual bool CheckNameHotkey (const char *)
 

Protected Attributes

DialogpActiveDlg
 
ContextMenupContext {nullptr}
 
bool fExclusive {true}
 
C4Rect PreferredDlgRect
 
float fZoom {1.0f}
 
C4Rect rcClientRect
 
ElementpFirst
 
ElementpLast
 
ContainerpParent {nullptr}
 
ElementpPrev
 
ElementpNext
 
WindowpDragTarget {nullptr}
 
int32_t iDragX
 
int32_t iDragY
 
bool fDragging {false}
 
ContextHandlerpContextHandler {nullptr}
 
C4Rect rcBounds
 

Static Protected Attributes

static ScreenpScreen
 

Friends

class Dialog
 
class ContextMenu
 

Detailed Description

Definition at line 2587 of file C4Gui.h.

Constructor & Destructor Documentation

◆ Screen()

C4GUI::Screen::Screen ( )

Definition at line 570 of file C4Gui.cpp.

570  : Window(), Mouse(0, 0)
571  {
572  // no dialog active
573  pActiveDlg = nullptr;
574  // set static var
575  pScreen = this;
576  }
CMouse Mouse
Definition: C4Gui.h:2590
static Screen * pScreen
Definition: C4Gui.h:2599
Dialog * pActiveDlg
Definition: C4Gui.h:2593

References pActiveDlg, and pScreen.

◆ ~Screen()

C4GUI::Screen::~Screen ( )
override

Definition at line 598 of file C4Gui.cpp.

599  {
600  // clear singleton
601  if (this == pScreen) pScreen = nullptr;
602  }

References pScreen.

Member Function Documentation

◆ AbortContext()

void C4GUI::Screen::AbortContext ( bool  fByUser)
inline

Definition at line 2657 of file C4Gui.h.

2657 { if (pContext) pContext->Abort(fByUser); } // close context menu
void Abort(bool fByUser)
Definition: C4GuiMenu.cpp:169
ContextMenu * pContext
Definition: C4Gui.h:2594

References C4GUI::ContextMenu::Abort(), and pContext.

Referenced by ActivateDialog(), Clear(), CloseDialog(), DoContext(), C4GUI::ContextMenu::DoOK(), and MouseInput().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ActivateDialog()

void C4GUI::Screen::ActivateDialog ( Dialog pDlg)

Definition at line 647 of file C4Gui.cpp.

648  {
649  // no change?
650  if (pActiveDlg == pDlg) return;
651  // in single-mode: release any MouseOver/Drag of previous dlg
652  if (IsExclusive())
654  // close any context menu
655  AbortContext(false);
656  // set as active dlg
657  pActiveDlg = pDlg;
658  // ensure it's last in the list, if it's not a specially ordered dlg
659  if (!pDlg->GetZOrdering() && pDlg->GetNext())
660  MakeLastElement(pDlg);
661  }
void ReleaseElements()
Definition: C4Gui.cpp:519
void MakeLastElement(Element *pChild)
void AbortContext(bool fByUser)
Definition: C4Gui.h:2657
bool IsExclusive()
Definition: C4Gui.h:2670

References AbortContext(), C4GUI::Element::GetNext(), C4GUI::Dialog::GetZOrdering(), IsExclusive(), C4GUI::Container::MakeLastElement(), Mouse, pActiveDlg, and C4GUI::CMouse::ReleaseElements().

Referenced by C4Game::DoKeyboardInput(), C4GUI::Dialog::Draw(), MouseInput(), and C4ChatDlg::ShowChat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddElement()

void C4GUI::Container::AddElement ( Element pChild)
inherited

Definition at line 118 of file C4GuiContainers.cpp.

119  {
120  // safety
121  if (!pChild) return;
122  // remove from any previous container
123  if (pChild->pParent) pChild->pParent->RemoveElement(pChild);
124  // add to end of list
125  if (pLast) pLast->pNext = pChild; else pFirst = pChild;
126  pChild->pPrev = pLast; pChild->pNext = nullptr; pLast = pChild;
127  pChild->pParent = this;
128 
129  assert(pChild->pNext != pChild);
130  assert(pChild->pPrev != pChild);
131  assert(pChild->pParent != pChild);
132  }
Element * pFirst
Definition: C4Gui.h:750
Element * pLast
Definition: C4Gui.h:750
Element * pPrev
Definition: C4Gui.h:377
Container * pParent
Definition: C4Gui.h:376
Element * pNext
Definition: C4Gui.h:377

References C4GUI::Container::pFirst, C4GUI::Container::pLast, C4GUI::Element::pNext, C4GUI::Element::pParent, C4GUI::Element::pPrev, and C4GUI::Container::RemoveElement().

Referenced by C4GUI::Tabular::AddCustomSheet(), C4GUI::ListBox::AddElement(), C4ChartDialog::C4ChartDialog(), C4ChatControl::C4ChatControl(), C4ChatDlg::C4ChatDlg(), C4DownloadDlg::C4DownloadDlg(), C4GameOptionButtons::C4GameOptionButtons(), C4GameOverDlg::C4GameOverDlg(), C4LeagueSignupDialog::C4LeagueSignupDialog(), C4Menu::C4Menu(), C4Network2ClientListDlg::C4Network2ClientListDlg(), C4Network2StartWaitDlg::C4Network2StartWaitDlg(), C4StartupAboutDlg::C4StartupAboutDlg(), C4StartupLegalDlg::C4StartupLegalDlg(), C4StartupMainDlg::C4StartupMainDlg(), C4StartupModsDlg::C4StartupModsDlg(), C4StartupModsListEntry::C4StartupModsListEntry(), C4StartupNetDlg::C4StartupNetDlg(), C4StartupNetListEntry::C4StartupNetListEntry(), C4StartupOptionsDlg::C4StartupOptionsDlg(), C4StartupPlrColorPickerDlg::C4StartupPlrColorPickerDlg(), C4StartupPlrPropertiesDlg::C4StartupPlrPropertiesDlg(), C4StartupPlrSelDlg::C4StartupPlrSelDlg(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4GUI::ContextButton::ContextButton(), C4MapFolderData::CreateGUIElements(), C4GUI::InfoDialog::CreateSubComponents(), C4FileSelDlg::DefaultListItem::DefaultListItem(), C4GUI::FullscreenDialog::FullscreenDialog(), C4FileSelDlg::InitElements(), C4GUI::InputDialog::InputDialog(), C4GUI::Container::InsertElement(), C4GUI::LabeledEdit::LabeledEdit(), C4GameLobby::MainDlg::MainDlg(), C4GUI::MessageDialog::MessageDialog(), C4ChatControl::ChatSheet::NickItem::NickItem(), C4GUI::ProgressDialog::ProgressDialog(), C4GUI::RenameEdit::RenameEdit(), C4GameLobby::ScenDesc::ScenDesc(), C4StartupScenSelDlg::ScenListItem::ScenListItem(), C4GUI::ScrollWindow::ScrollWindow(), C4GUI::InputDialog::SetCustomEdit(), C4GoalDisplay::SetGoals(), C4GUI::FullscreenDialog::SetTitle(), C4GUI::Dialog::SetTitle(), and C4GUI::TextWindow::TextWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AfterElementRemoval()

virtual void C4GUI::Container::AfterElementRemoval ( )
inlineprotectedvirtualinherited

Reimplemented in C4GUI::ListBox.

Definition at line 756 of file C4Gui.h.

757  { if (pParent) pParent->AfterElementRemoval(); } // called by ScrollWindow to parent after an element has been removed
virtual void AfterElementRemoval()
Definition: C4Gui.h:756

References C4GUI::Container::AfterElementRemoval(), and C4GUI::Element::pParent.

Referenced by C4GUI::Container::AfterElementRemoval(), C4GUI::ListBox::AfterElementRemoval(), and C4GUI::Container::RemoveElement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ApplyElementOffset()

void C4GUI::Window::ApplyElementOffset ( int32_t &  riX,
int32_t &  riY 
)
inlineoverridevirtualinherited

Reimplemented from C4GUI::Container.

Reimplemented in C4GUI::Dialog.

Definition at line 866 of file C4Gui.h.

867  { riX -= rcClientRect.x; riY -= rcClientRect.y; }
C4Rect rcClientRect
Definition: C4Gui.h:851
int32_t y
Definition: C4Rect.h:30
int32_t x
Definition: C4Rect.h:30

References C4GUI::Window::rcClientRect, C4Rect::x, and C4Rect::y.

Referenced by C4GUI::Dialog::ApplyElementOffset().

Here is the caller graph for this function:

◆ ApplyInvElementOffset()

void C4GUI::Window::ApplyInvElementOffset ( int32_t &  riX,
int32_t &  riY 
)
inlineoverridevirtualinherited

Reimplemented from C4GUI::Container.

Reimplemented in C4GUI::Dialog.

Definition at line 868 of file C4Gui.h.

869  { riX += rcClientRect.x; riY += rcClientRect.y; }

References C4GUI::Window::rcClientRect, C4Rect::x, and C4Rect::y.

Referenced by C4GUI::Dialog::ApplyInvElementOffset().

Here is the caller graph for this function:

◆ begin()

Iterator C4GUI::Container::begin ( )
inlineinherited

Definition at line 824 of file C4Gui.h.

824 { return Iterator(pFirst); }

References C4GUI::Container::pFirst.

Referenced by C4ScriptGuiWindow::ClearPointers().

Here is the caller graph for this function:

◆ CharIn()

bool C4GUI::Screen::CharIn ( const char *  c)
virtual

Definition at line 779 of file C4Gui.cpp.

780  {
781  // Special: Tab chars are ignored, because they are always handled as focus advance
782  if (c[0] == 0x09) return false;
783  // mark in mouse
785  // no processing if focus is not set
786  if (!HasKeyboardFocus()) return false;
787  // always return true in exclusive mode (which means: key processed)
788  bool fResult = IsExclusive();
789  // context menu: forward to context
790  if (pContext) return pContext->CharIn(c) || fResult;
791  // no active dlg?
792  if (!pActiveDlg || !pActiveDlg->IsVisible()) return fResult;
793  // forward to dialog
794  return pActiveDlg->CharIn(c) || fResult;
795  }
void ResetActiveInput()
Definition: C4Gui.h:2580
virtual bool CharIn(const char *c)
Definition: C4GuiMenu.cpp:453
virtual bool CharIn(const char *c)
bool IsVisible()
Definition: C4Gui.cpp:201
bool HasKeyboardFocus()
Definition: C4Gui.h:2671

References C4GUI::ContextMenu::CharIn(), C4GUI::Dialog::CharIn(), HasKeyboardFocus(), IsExclusive(), C4GUI::Element::IsVisible(), Mouse, pActiveDlg, pContext, and C4GUI::CMouse::ResetActiveInput().

Referenced by C4FullScreen::CharIn().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckNameHotkey()

virtual bool C4GUI::Element::CheckNameHotkey ( const char *  )
inlineprotectedvirtualinherited

Reimplemented in C4StartupScenSelDlg::ScenListItem.

Definition at line 407 of file C4Gui.h.

407 { return false; }

Referenced by C4GUI::ListBox::CharIn().

Here is the caller graph for this function:

◆ Clear()

void C4GUI::Screen::Clear ( )

Definition at line 588 of file C4Gui.cpp.

589  {
591  // dtor: Close context menu
592  AbortContext(false);
593  // fields reset
594  fExclusive = true;
595  fZoom = 1.0f;
596  }
bool fExclusive
Definition: C4Gui.h:2595
float fZoom
Definition: C4Gui.h:2597

References AbortContext(), C4GUI::Container::Clear(), fExclusive, and fZoom.

Referenced by C4Game::Clear().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ClearChildren()

void C4GUI::Container::ClearChildren ( )
inherited

Definition at line 68 of file C4GuiContainers.cpp.

69  {
70  // delete all items; dtor will update list
71  while (pFirst)
72  {
73  if (pFirst->IsOwnPtrElement())
74  {
75  // unlink from list
76  Element *pANext = pFirst->pNext;
77  pFirst->pPrev = pFirst->pNext = nullptr;
78  pFirst->pParent = nullptr;
79  if ((pFirst = pANext))
80  pFirst->pPrev = nullptr;
81  else
82  pLast = nullptr;
83  }
84  else
85  delete pFirst;
86  }
87  }
friend class Element
Definition: C4Gui.h:844
virtual bool IsOwnPtrElement()
Definition: C4Gui.h:401

References C4GUI::Element::IsOwnPtrElement(), C4GUI::Container::pFirst, C4GUI::Container::pLast, C4GUI::Element::pNext, C4GUI::Element::pParent, and C4GUI::Element::pPrev.

Referenced by C4GUI::Container::Clear(), C4ScriptGuiWindow::Close(), C4ScriptGuiWindow::RemoveChild(), C4GoalDisplay::SetGoals(), and C4ScriptGuiWindow::~C4ScriptGuiWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ClientPos2ScreenPos()

void C4GUI::Element::ClientPos2ScreenPos ( int32_t &  riX,
int32_t &  riY 
)
inherited

Definition at line 231 of file C4Gui.cpp.

232  {
233  // apply all parent offsets
234  Container *pCont = pParent;
235  while (pCont)
236  {
237  pCont->ApplyInvElementOffset(riX, riY);
238  pCont = pCont->GetParent();
239  }
240  // apply own offset
241  riX += rcBounds.x; riY += rcBounds.y;
242  }
virtual void ApplyInvElementOffset(int32_t &riX, int32_t &riY)
Definition: C4Gui.h:841
C4Rect rcBounds
Definition: C4Gui.h:385
friend class Container
Definition: C4Gui.h:472

References C4GUI::Container::ApplyInvElementOffset(), C4GUI::Element::GetParent(), C4GUI::Element::pParent, C4GUI::Element::rcBounds, C4Rect::x, and C4Rect::y.

Referenced by C4MapFolderData::CreateGUIElements(), DoContext(), and C4Menu::Draw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CloseAllDialogs()

void C4GUI::Screen::CloseAllDialogs ( bool  fWithOK)

Definition at line 704 of file C4Gui.cpp.

705  {
706  while (pActiveDlg) pActiveDlg->Close(fWithOK);
707  }
void Close(bool fOK)

References C4GUI::Dialog::Close(), and pActiveDlg.

Referenced by C4Network2::DoLobby(), and C4Startup::DontStartup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CloseDialog()

void C4GUI::Screen::CloseDialog ( Dialog pDlg,
bool  fFade 
)

Definition at line 663 of file C4Gui.cpp.

664  {
665  // hide dlg
666  if (!fFade) pDlg->fShow = false;
667  // kill from active
668  if (pActiveDlg == pDlg)
669  {
670  // release any MouseOver/Drag of previous dlg
672  // close context menu: probably belonging to closed dlg anyway
673  AbortContext(false);
674  // set new active dlg
676  // do not set yet if it's fading
677  if (pActiveDlg && pActiveDlg->IsFading()) pActiveDlg = nullptr;
678  }
679  // redraw background; clip update
681  }
C4GraphicsSystem GraphicsSystem
Definition: C4Globals.cpp:51
bool IsFading()
Definition: C4Gui.h:2152
void UpdateMouseFocus()
Definition: C4Gui.cpp:965
Dialog * GetTopDialog()
Definition: C4Gui.cpp:692

References AbortContext(), C4GUI::Dialog::fShow, GetTopDialog(), GraphicsSystem, C4GraphicsSystem::InvalidateBg(), C4GUI::Dialog::IsFading(), Mouse, pActiveDlg, C4GUI::CMouse::ReleaseElements(), and UpdateMouseFocus().

Referenced by C4GUI::Dialog::Close(), and C4GUI::Dialog::FadeOut().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoContext() [1/2]

bool C4GUI::Element::DoContext ( )
inherited

Definition at line 417 of file C4Gui.cpp.

418  {
419  if (!pContextHandler) return false;
420  return pContextHandler->OnContext(this, rcBounds.Wdt/2, rcBounds.Hgt/2);
421  }
virtual bool OnContext(Element *pOnElement, int32_t iX, int32_t iY)=0
ContextHandler * pContextHandler
Definition: C4Gui.h:381
int32_t Hgt
Definition: C4Rect.h:30
int32_t Wdt
Definition: C4Rect.h:30

References C4Rect::Hgt, C4GUI::ContextHandler::OnContext(), C4GUI::Element::pContextHandler, C4GUI::Element::rcBounds, and C4Rect::Wdt.

Referenced by C4GUI::Control::KeyContext(), and C4GUI::ContextButton::MouseInput().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoContext() [2/2]

void C4GUI::Screen::DoContext ( ContextMenu pNewCtx,
Element pAtElement,
int32_t  iX,
int32_t  iY 
)

Definition at line 971 of file C4Gui.cpp.

972  {
973  assert(pNewCtx); assert(pNewCtx != pContext);
974  // close previous context menu
975  AbortContext(false);
976  // element offset
977  if (pAtElement) pAtElement->ClientPos2ScreenPos(iX, iY);
978  // usually open bottom right
979  // check bottom bounds
980  if (iY + pNewCtx->GetBounds().Hgt >= GetBounds().Hgt)
981  {
982  // bottom too narrow: open to top, if height is sufficient
983  // otherwise, open to top from bottom screen pos
984  if (iY < pNewCtx->GetBounds().Hgt) iY = GetBounds().Hgt;
985  iY -= pNewCtx->GetBounds().Hgt;
986  }
987  // check right bounds likewise
988  if (iX + pNewCtx->GetBounds().Wdt >= GetBounds().Wdt)
989  {
990  // bottom too narrow: open to top, if height is sufficient
991  // otherwise, open to top from bottom screen pos
992  if (iX < pNewCtx->GetBounds().Wdt) iX = GetBounds().Wdt;
993  iX -= pNewCtx->GetBounds().Wdt;
994  }
995  // open new
996  (pContext = pNewCtx)->Open(pAtElement, iX, iY);
997  }
C4Rect & GetBounds()
Definition: C4Gui.h:445

References AbortContext(), C4GUI::Element::ClientPos2ScreenPos(), C4GUI::Element::GetBounds(), C4Rect::Hgt, pContext, and C4Rect::Wdt.

Referenced by C4GUI::CBContextHandler< CBClass >::OnContext().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoDragging()

void C4GUI::Element::DoDragging ( CMouse rMouse,
int32_t  iX,
int32_t  iY,
DWORD  dwKeyParam 
)
virtualinherited

Reimplemented in C4GUI::Edit, and C4GUI::ScrollBar.

Definition at line 269 of file C4Gui.cpp.

270  {
271  // check if anything moved
272  if (pDragTarget && (iX != iDragX || iY != iDragY))
273  {
274  // move position, then
275  pDragTarget->rcBounds.x += iX-iDragX;
276  pDragTarget->rcBounds.y += iY-iDragY;
277  // drag X/Y is up-to-date if this is a child element of the drag target
279  }
280  }
int32_t iDragY
Definition: C4Gui.h:379
int32_t iDragX
Definition: C4Gui.h:379
virtual void UpdatePos()
Definition: C4Gui.cpp:193
Window * pDragTarget
Definition: C4Gui.h:378

References C4GUI::Element::iDragX, C4GUI::Element::iDragY, C4GUI::Element::pDragTarget, C4GUI::Element::rcBounds, C4GUI::Element::UpdatePos(), C4Rect::x, and C4Rect::y.

Referenced by MouseInput(), and C4GUI::Element::StopDragging().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Draw() [1/3]

void C4GUI::Window::Draw ( C4TargetFacet cgo)
overrideprotectedvirtualinherited

Reimplemented from C4GUI::Container.

Reimplemented in C4ScriptGuiWindow, C4ScoreboardDlg, C4Menu, C4GUI::Dialog, and C4GUI::ContextMenu.

Definition at line 293 of file C4GuiContainers.cpp.

294  {
295  // invisible?
296  if (!IsVisible()) return;
297  // draw window itself
298  DrawElement(cgo);
299  // get target area
302  // clip to window area
303  int clx1, cly1, clx2, cly2;
304  pDraw->GetPrimaryClipper(clx1, cly1, clx2, cly2);
305  float nclx1 = cgo.TargetX+rcClipArea.x, ncly1 = cgo.TargetY+rcClipArea.y, nclx2 = cgo.TargetX+rcClipArea.x+rcClipArea.Wdt-1, ncly2 = cgo.TargetY+rcClipArea.y+rcClipArea.Hgt-1;
306  pDraw->ApplyZoom(nclx1, ncly1);
307  pDraw->ApplyZoom(nclx2, ncly2);
308  pDraw->SubPrimaryClipper(nclx1, ncly1, nclx2, ncly2);
309  // update target area
310  cgo.TargetX += rcClientRect.x; cgo.TargetY += rcClientRect.y;
311  // draw contents
312  Container::Draw(cgo);
313  // reset target area
314  cgo.TargetX -= rcClientRect.x; cgo.TargetY -= rcClientRect.y;
315  // reset clipper
316  pDraw->SetPrimaryClipper(clx1, cly1, clx2, cly2);
317  }
C4Draw * pDraw
Definition: C4Draw.cpp:42
bool SubPrimaryClipper(int iX1, int iY1, int iX2, int iY2)
Definition: C4Draw.cpp:196
bool GetPrimaryClipper(int &rX1, int &rY1, int &rX2, int &rY2)
Definition: C4Draw.cpp:716
bool SetPrimaryClipper(int iX1, int iY1, int iX2, int iY2)
Definition: C4Draw.cpp:217
void ApplyZoom(float &X, float &Y)
Definition: C4Draw.cpp:778
void Draw(C4TargetFacet &cgo) override
virtual void DrawElement(C4TargetFacet &cgo)
Definition: C4Gui.h:388
C4Rect & GetClientRect() override
Definition: C4Gui.h:864
virtual bool IsComponentOutsideClientArea()
Definition: C4Gui.h:870
Definition: C4Rect.h:28
float TargetY
Definition: C4Facet.h:165
float TargetX
Definition: C4Facet.h:165

References C4Draw::ApplyZoom(), C4GUI::Container::Draw(), C4GUI::Element::DrawElement(), C4GUI::Element::GetBounds(), C4GUI::Window::GetClientRect(), C4Draw::GetPrimaryClipper(), C4Rect::Hgt, C4GUI::Window::IsComponentOutsideClientArea(), C4GUI::Element::IsVisible(), pDraw, C4GUI::Window::rcClientRect, C4Draw::SetPrimaryClipper(), C4Draw::SubPrimaryClipper(), C4TargetFacet::TargetX, C4TargetFacet::TargetY, C4Rect::Wdt, C4Rect::x, and C4Rect::y.

Referenced by C4GUI::ContextMenu::Draw(), C4GUI::Dialog::Draw(), and Draw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Draw() [2/3]

void C4GUI::Window::Draw
overrideprotected

Definition at line 853 of file C4GuiContainers.cpp.

294  {
295  // invisible?
296  if (!IsVisible()) return;
297  // draw window itself
298  DrawElement(cgo);
299  // get target area
302  // clip to window area
303  int clx1, cly1, clx2, cly2;
304  pDraw->GetPrimaryClipper(clx1, cly1, clx2, cly2);
305  float nclx1 = cgo.TargetX+rcClipArea.x, ncly1 = cgo.TargetY+rcClipArea.y, nclx2 = cgo.TargetX+rcClipArea.x+rcClipArea.Wdt-1, ncly2 = cgo.TargetY+rcClipArea.y+rcClipArea.Hgt-1;
306  pDraw->ApplyZoom(nclx1, ncly1);
307  pDraw->ApplyZoom(nclx2, ncly2);
308  pDraw->SubPrimaryClipper(nclx1, ncly1, nclx2, ncly2);
309  // update target area
310  cgo.TargetX += rcClientRect.x; cgo.TargetY += rcClientRect.y;
311  // draw contents
312  Container::Draw(cgo);
313  // reset target area
314  cgo.TargetX -= rcClientRect.x; cgo.TargetY -= rcClientRect.y;
315  // reset clipper
316  pDraw->SetPrimaryClipper(clx1, cly1, clx2, cly2);
317  }

Referenced by Render().

Here is the caller graph for this function:

◆ Draw() [3/3]

void C4GUI::Screen::Draw ( C4TargetFacet cgo,
bool  fDoBG 
)
protectedvirtual

Definition at line 746 of file C4Gui.cpp.

747  {
748  // draw bg, if this won't be done by a fullscreen dialog
749  if (fDoBG)
750  {
751  Dialog *pFSDlg = GetFullscreenDialog(false);
752  if (!pFSDlg || !pFSDlg->HasBackground())
753  {
755  ::GraphicsSystem.pLoaderScreen->Draw(cgo, C4LoaderScreen::Flag::BACKGROUND);
756  else
757  // loader not yet loaded: black BG
758  pDraw->DrawBoxDw(cgo.Surface, 0,0, cgo.Wdt+1, cgo.Hgt+1, 0x00000000);
759  }
760  }
761  // draw contents (if GUI-gfx are loaded, which is assumed in GUI-drawing-functions)
763  {
764  Window::Draw(cgo);
765  if (pContext) pContext->Draw(cgo);
766  }
767  // draw mouse cursor
768  if (!Application.isEditor) RenderMouse(cgo);
769  }
C4Application Application
Definition: C4Globals.cpp:44
C4GraphicsResource GraphicsResource
void DrawBoxDw(C4Surface *sfcDest, int iX1, int iY1, int iX2, int iY2, DWORD dwClr)
Definition: C4Draw.cpp:840
C4Surface * Surface
Definition: C4Facet.h:117
float Hgt
Definition: C4Facet.h:118
float Wdt
Definition: C4Facet.h:118
void Draw(C4TargetFacet &cgo) override
Definition: C4GuiMenu.cpp:460
Dialog * GetFullscreenDialog(bool fIncludeFading)
Definition: C4Gui.cpp:1037
void RenderMouse(C4TargetFacet &cgo)
Definition: C4Gui.cpp:739
friend class Dialog
Definition: C4Gui.h:2689
void Draw(C4TargetFacet &cgo) override
C4LoaderScreen * pLoaderScreen
void Draw(C4Facet &cgo, Flag options=Flag::ALL, int iProgress=0, class C4LogBuffer *pLog=nullptr, int Process=0)

References Application, C4LoaderScreen::Draw(), C4GUI::Window::Draw(), C4GUI::ContextMenu::Draw(), C4Draw::DrawBoxDw(), GetFullscreenDialog(), GraphicsResource, GraphicsSystem, C4GUI::Dialog::HasBackground(), C4Facet::Hgt, C4Application::isEditor, C4GraphicsResource::IsInitialized(), C4GUI::Element::IsVisible(), pContext, pDraw, C4GraphicsSystem::pLoaderScreen, RenderMouse(), C4Facet::Surface, and C4Facet::Wdt.

Here is the call graph for this function:

◆ Draw3DFrame()

void C4GUI::Element::Draw3DFrame ( C4TargetFacet cgo,
bool  fUp = false,
int32_t  iIndent = 1,
BYTE  byAlpha = C4GUI_BorderAlpha,
bool  fDrawTop = true,
int32_t  iTopOff = 0,
bool  fDrawLeft = true,
int32_t  iLeftOff = 0 
)
protectedinherited

Definition at line 291 of file C4Gui.cpp.

292  {
293  DWORD dwAlpha = byAlpha<<24;
294  int32_t x0 = cgo.TargetX + rcBounds.x + iLeftOff,
295  y0 = cgo.TargetY + rcBounds.y + iTopOff,
296  x1 = cgo.TargetX + rcBounds.x + rcBounds.Wdt - 1,
297  y1 = cgo.TargetY + rcBounds.y + rcBounds.Hgt - 1;
298  if (fDrawTop) pDraw->DrawLineDw(cgo.Surface, (float)x0,(float)y0,(float)x1,(float)y0, C4GUI_BorderColor1 | dwAlpha);
299  if (fDrawLeft) pDraw->DrawLineDw(cgo.Surface, (float)x0,(float)y0,(float)x0,(float)y1, C4GUI_BorderColor1 | dwAlpha);
300  if (fDrawTop) pDraw->DrawLineDw(cgo.Surface, (float)(x0+1),(float)(y0+1),(float)(x1-1),(float)(y0+1), C4GUI_BorderColor2 | dwAlpha);
301  if (fDrawLeft) pDraw->DrawLineDw(cgo.Surface, (float)(x0+1),(float)(y0+1),(float)(x0+1),(float)(y1-1), C4GUI_BorderColor2 | dwAlpha);
302  pDraw->DrawLineDw(cgo.Surface, (float)x0,(float)y1,(float)x1,(float)y1, C4GUI_BorderColor3 | dwAlpha);
303  pDraw->DrawLineDw(cgo.Surface, (float)x1,(float)y0,(float)x1,(float)y1, C4GUI_BorderColor3 | dwAlpha);
304  pDraw->DrawLineDw(cgo.Surface, (float)(x0+1),(float)(y1-1),(float)(x1-1),(float)(y1-1), C4GUI_BorderColor1 | dwAlpha);
305  pDraw->DrawLineDw(cgo.Surface, (float)(x1-1),(float)(y0+1),(float)(x1-1),(float)(y1-1), C4GUI_BorderColor1 | dwAlpha);
306  }
#define C4GUI_BorderColor2
Definition: C4Gui.h:86
#define C4GUI_BorderColor1
Definition: C4Gui.h:85
#define C4GUI_BorderColor3
Definition: C4Gui.h:87
uint32_t DWORD
void DrawLineDw(C4Surface *sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr, float width=1.0f)
Definition: C4Draw.cpp:608

References C4GUI_BorderColor1, C4GUI_BorderColor2, C4GUI_BorderColor3, C4Draw::DrawLineDw(), C4Rect::Hgt, pDraw, C4GUI::Element::rcBounds, C4Facet::Surface, C4TargetFacet::TargetX, C4TargetFacet::TargetY, C4Rect::Wdt, C4Rect::x, and C4Rect::y.

Referenced by C4GUI::ProgressBar::DrawElement(), C4GUI::GroupBox::DrawElement(), C4GUI::Edit::DrawElement(), C4GUI::ListBox::DrawElement(), C4GUI::Tabular::DrawElement(), C4GUI::TextWindow::DrawElement(), C4GUI::ContextMenu::DrawElement(), C4GUI::ComboBox::DrawElement(), and C4GUI::Dialog::DrawElement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DrawBar()

void C4GUI::Element::DrawBar ( C4TargetFacet cgo,
DynBarFacet rFacets 
)
protectedinherited

Definition at line 308 of file C4Gui.cpp.

309  {
310  if (rcBounds.Hgt == rFacets.fctMiddle.Hgt)
311  {
312  // exact bar
313  int32_t x0=cgo.TargetX+rcBounds.x, y0=cgo.TargetY+rcBounds.y;
314  int32_t iX = rFacets.fctBegin.Wdt, w=rFacets.fctMiddle.Wdt, wLeft=rFacets.fctBegin.Wdt, wRight=rFacets.fctEnd.Wdt;
315  int32_t iRightShowLength = wRight/3;
316  bool fOverflow = (wLeft > rcBounds.Wdt);
317  if (fOverflow) rFacets.fctBegin.Wdt = rcBounds.Wdt;
318  rFacets.fctBegin.Draw(cgo.Surface, x0,y0);
319  if (fOverflow) rFacets.fctBegin.Wdt = wLeft;
320  while (iX < rcBounds.Wdt-iRightShowLength)
321  {
322  int32_t w2=std::min(w, rcBounds.Wdt-iRightShowLength-iX); rFacets.fctMiddle.Wdt=w2;
323  rFacets.fctMiddle.Draw(cgo.Surface, x0+iX, y0);
324  iX += w;
325  }
326  rFacets.fctMiddle.Wdt=w;
327  fOverflow = (wRight > rcBounds.Wdt);
328  if (fOverflow)
329  {
330  rFacets.fctEnd.X += wRight - rcBounds.Wdt;
331  rFacets.fctEnd.Wdt = rcBounds.Wdt;
332  }
333  rFacets.fctEnd.Draw(cgo.Surface, x0+rcBounds.Wdt-rFacets.fctEnd.Wdt, y0);
334  if (fOverflow)
335  {
336  rFacets.fctEnd.X -= wRight - rcBounds.Wdt;
337  rFacets.fctEnd.Wdt = wRight;
338  }
339  }
340  else
341  {
342  // zoomed bar
343  float fZoom = (float) rcBounds.Hgt / rFacets.fctMiddle.Hgt;
344  int32_t x0=cgo.TargetX+rcBounds.x, y0=cgo.TargetY+rcBounds.y;
345  int32_t iX = int32_t(fZoom*rFacets.fctBegin.Wdt), w=int32_t(fZoom*rFacets.fctMiddle.Wdt), wOld=rFacets.fctMiddle.Wdt;
346  int32_t iRightShowLength = rFacets.fctEnd.Wdt/3;
347  rFacets.fctBegin.DrawX(cgo.Surface, x0,y0,int32_t(fZoom*rFacets.fctBegin.Wdt),rcBounds.Hgt);
348  while (iX < rcBounds.Wdt-(fZoom*iRightShowLength))
349  {
350  int32_t w2=std::min<int32_t>(w, rcBounds.Wdt-int32_t(fZoom*iRightShowLength)-iX); rFacets.fctMiddle.Wdt=long(float(w2)/fZoom);
351  rFacets.fctMiddle.DrawX(cgo.Surface, x0+iX, y0, w2,rcBounds.Hgt);
352  iX += w;
353  }
354  rFacets.fctMiddle.Wdt=wOld;
355  rFacets.fctEnd.DrawX(cgo.Surface, x0+rcBounds.Wdt-int32_t(fZoom*rFacets.fctEnd.Wdt), y0,int32_t(fZoom*rFacets.fctEnd.Wdt),rcBounds.Hgt);
356  }
357  }

References C4Facet::Draw(), C4Facet::DrawX(), C4GUI::DynBarFacet::fctBegin, C4GUI::DynBarFacet::fctEnd, C4GUI::DynBarFacet::fctMiddle, C4Facet::Hgt, C4Rect::Hgt, C4GUI::Element::rcBounds, C4Facet::Surface, C4TargetFacet::TargetX, C4TargetFacet::TargetY, C4Facet::Wdt, C4Rect::Wdt, C4Facet::X, C4Rect::x, and C4Rect::y.

Referenced by C4GUI::WoodenLabel::DrawElement(), and C4GUI::Button::DrawElement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DrawElement()

◆ DrawHBarByVGfx()

void C4GUI::Element::DrawHBarByVGfx ( C4TargetFacet cgo,
DynBarFacet rFacets 
)
protectedinherited

Definition at line 365 of file C4Gui.cpp.

366  {
367  C4DrawTransform trf;
368  float fOffX = cgo.TargetX + rcBounds.x + rcBounds.Hgt/2;
369  float fOffY = cgo.TargetY + rcBounds.y + rcBounds.Hgt/2;
370  trf.SetRotate(-90.0f, fOffX, fOffY);
371 
372  DrawHVBar(cgo, rFacets, trf, rcBounds.Wdt);
373  }
void SetRotate(float iAngle, float fOffX, float fOffY)
void DrawHVBar(C4TargetFacet &cgo, DynBarFacet &rFacets, C4DrawTransform &trf, int32_t iMiddleLength)
Definition: C4Gui.cpp:375

References C4GUI::Element::DrawHVBar(), C4Rect::Hgt, C4GUI::Element::rcBounds, C4BltTransform::SetRotate(), C4TargetFacet::TargetX, C4TargetFacet::TargetY, C4Rect::Wdt, C4Rect::x, and C4Rect::y.

Referenced by C4GUI::ScrollBar::DrawElement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DrawHVBar()

void C4GUI::Element::DrawHVBar ( C4TargetFacet cgo,
DynBarFacet rFacets,
C4DrawTransform trf,
int32_t  iMiddleLength 
)
protectedinherited

Definition at line 375 of file C4Gui.cpp.

376  {
377  int32_t y0 = cgo.TargetY + rcBounds.y;
378  int32_t x0 = cgo.TargetX + rcBounds.x;
379 
380  // draw up arrow
381  rFacets.fctBegin.DrawT(cgo.Surface, x0, y0, 0, 0, &trf);
382 
383  // draw middle part
384  int32_t h = rFacets.fctMiddle.Hgt;
385  int32_t barHeight = iMiddleLength - (rFacets.fctBegin.Hgt + rFacets.fctEnd.Hgt);
386 
387  for (int32_t iY = 0; iY <= barHeight; iY += h)
388  {
389  int32_t h2 = std::min(h, barHeight - iY);
390  rFacets.fctMiddle.Hgt = h2;
391  rFacets.fctMiddle.DrawT(cgo.Surface, x0, y0 + rFacets.fctBegin.Hgt + iY, 0, 0, &trf);
392  }
393  rFacets.fctMiddle.Hgt = h;
394 
395  // draw lower arrow
396  rFacets.fctEnd.DrawT(cgo.Surface, x0, y0 + iMiddleLength - rFacets.fctEnd.Hgt, 0, 0, &trf);
397  }
int Hgt
Definition: C4Surface.h:65

References C4Facet::DrawT(), C4GUI::DynBarFacet::fctBegin, C4GUI::DynBarFacet::fctEnd, C4GUI::DynBarFacet::fctMiddle, C4Facet::Hgt, C4GUI::Element::rcBounds, C4Facet::Surface, C4TargetFacet::TargetX, C4TargetFacet::TargetY, C4Rect::x, and C4Rect::y.

Referenced by C4GUI::Element::DrawHBarByVGfx(), and C4GUI::Element::DrawVBar().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DrawToolTip()

void C4GUI::Screen::DrawToolTip ( const char *  szTip,
C4TargetFacet cgo,
float  guix,
float  guiy 
)
static

Definition at line 1009 of file C4Gui.cpp.

1010  {
1011  CStdFont *pUseFont = &(::GraphicsResource.TooltipFont);
1012  StdStrBuf sText;
1013  pUseFont->BreakMessage(szTip, std::min<int32_t>(C4GUI_MaxToolTipWdt, std::max<int32_t>(cgo.Wdt, 50)), &sText, true);
1014  // get tooltip rect
1015  int32_t tWdt,tHgt;
1016  if (pUseFont->GetTextExtent(sText.getData(), tWdt, tHgt, true))
1017  {
1018  tWdt+=6; tHgt+=4;
1019  int32_t tX, tY;
1020  if (y < cgo.Y+cgo.TargetY+tHgt+5) tY = std::min<int32_t>(y+5, cgo.TargetY+cgo.Hgt-tHgt); else tY = y-tHgt-5;
1021  tX = Clamp<int32_t>(x-tWdt/2, cgo.TargetX+cgo.X, cgo.TargetX+cgo.Wdt-tWdt);
1022  // draw tooltip box
1023  pDraw->DrawBoxDw(cgo.Surface, tX,tY,tX+tWdt-1,tY+tHgt-2, C4GUI_ToolTipBGColor);
1024  pDraw->DrawFrameDw(cgo.Surface, tX,tY,tX+tWdt-1,tY+tHgt-1, C4GUI_ToolTipFrameColor);
1025  // draw tooltip
1026  pDraw->TextOut(sText.getData(), *pUseFont, 1.0f, cgo.Surface, tX+3,tY+1, C4GUI_ToolTipColor, ALeft);
1027  // while there's a tooltip, redraw the bg, because it might overlap
1029  }
1030  }
#define C4GUI_ToolTipBGColor
Definition: C4Gui.h:72
#define C4GUI_ToolTipColor
Definition: C4Gui.h:74
#define C4GUI_ToolTipFrameColor
Definition: C4Gui.h:73
#define C4GUI_MaxToolTipWdt
Definition: C4Gui.h:140
const int ALeft
Definition: C4Surface.h:41
void DrawFrameDw(C4Surface *sfcDest, int x1, int y1, int x2, int y2, DWORD dwClr, float width=1.0f)
Definition: C4Draw.cpp:635
bool TextOut(const char *szText, CStdFont &rFont, float fZoom, C4Surface *sfcDest, float iTx, float iTy, DWORD dwFCol=0xffffffff, BYTE byForm=ALeft, bool fDoMarkup=true)
Definition: C4Draw.cpp:561
float Y
Definition: C4Facet.h:118
float X
Definition: C4Facet.h:118
std::tuple< std::string, int > BreakMessage(const char *szMsg, int iWdt, bool fCheckMarkup, float fZoom=1.0f)
bool GetTextExtent(const char *szText, int32_t &rsx, int32_t &rsy, bool fCheckMarkup=true)
const char * getData() const
Definition: StdBuf.h:442

References ALeft, CStdFont::BreakMessage(), C4GUI_MaxToolTipWdt, C4GUI_ToolTipBGColor, C4GUI_ToolTipColor, C4GUI_ToolTipFrameColor, C4Draw::DrawBoxDw(), C4Draw::DrawFrameDw(), StdStrBuf::getData(), CStdFont::GetTextExtent(), GraphicsResource, GraphicsSystem, C4Facet::Hgt, C4GraphicsSystem::InvalidateBg(), pDraw, C4Facet::Surface, C4TargetFacet::TargetX, C4TargetFacet::TargetY, C4Draw::TextOut(), C4GraphicsResource::TooltipFont, C4Facet::Wdt, C4Facet::X, and C4Facet::Y.

Referenced by C4Menu::Draw(), C4MouseControl::Draw(), and C4GUI::CMouse::Draw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DrawVBar()

void C4GUI::Element::DrawVBar ( C4TargetFacet cgo,
DynBarFacet rFacets 
)
protectedinherited

Definition at line 359 of file C4Gui.cpp.

360  {
361  C4DrawTransform trf(1);
362  DrawHVBar(cgo, rFacets, trf, rcBounds.Hgt);
363  }

References C4GUI::Element::DrawHVBar(), C4Rect::Hgt, and C4GUI::Element::rcBounds.

Referenced by C4GUI::ScrollBar::DrawElement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ElementPosChanged()

void C4GUI::Screen::ElementPosChanged ( Element pOfElement)
overrideprotectedvirtual

Reimplemented from C4GUI::Container.

Definition at line 604 of file C4Gui.cpp.

605  {
606  // redraw fullscreen BG if dlgs are dragged around in shared mode
607  if (!IsExclusive())
609  }

References GraphicsSystem, C4GraphicsSystem::InvalidateBg(), and IsExclusive().

Here is the call graph for this function:

◆ ElementSizeChanged()

virtual void C4GUI::Container::ElementSizeChanged ( Element pOfElement)
inlineprotectedvirtualinherited

Reimplemented in C4GUI::ContextMenu, C4GUI::TextWindow, C4GUI::ListBox, and C4GUI::ScrollWindow.

Definition at line 753 of file C4Gui.h.

753 { } // called when an element size is changed

Referenced by C4GUI::ListBox::ElementPosChanged(), C4GUI::TextWindow::ElementPosChanged(), C4GUI::ContextMenu::ElementPosChanged(), C4GUI::ScrollWindow::ElementSizeChanged(), C4GUI::ListBox::ElementSizeChanged(), C4GUI::TextWindow::ElementSizeChanged(), C4GUI::ContextMenu::ElementSizeChanged(), and C4GUI::Element::UpdateSize().

Here is the caller graph for this function:

◆ end()

Iterator C4GUI::Container::end ( )
inlineinherited

Definition at line 825 of file C4Gui.h.

825 { return Iterator(nullptr); }

Referenced by C4ScriptGuiWindow::ClearPointers().

Here is the caller graph for this function:

◆ GetBounds()

C4Rect& C4GUI::Element::GetBounds ( )
inlineinherited

Definition at line 445 of file C4Gui.h.

445 { return rcBounds; }

References C4GUI::Element::rcBounds.

Referenced by C4GUI::ListBox::AddElement(), C4Menu::AdjustPosition(), C4GameOverDlg::C4GameOverDlg(), C4StartupModsDlg::C4StartupModsDlg(), C4StartupModsListEntry::C4StartupModsListEntry(), C4StartupNetDlg::C4StartupNetDlg(), C4StartupNetListEntry::C4StartupNetListEntry(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4GUI::ContextMenu::CheckOpenSubmenu(), C4GUI::ListBox::ContractToElementHeight(), C4MapFolderData::CreateGUIElements(), DoContext(), C4GUI::Window::Draw(), C4GUI::ListBox::DrawElement(), C4GUI::ContextMenu::DrawElement(), C4GUI::TextWindow::ElementPosChanged(), C4GUI::TextWindow::ElementSizeChanged(), C4GUI::Dialog::GetMarginTop(), C4GUI::ScrollBar::GetMaxScroll(), C4GUI::GetScreenHgt(), C4GUI::GetScreenWdt(), C4Menu::InitSize(), C4GUI::ListBox::InsertElement(), C4GUI::ScrollWindow::IsRangeInView(), C4StartupPlrSelDlg::PlayerListItem::Load(), C4GUI::Window::MouseInput(), C4GUI::ScrollBar::MouseInput(), C4GUI::ListBox::MouseInput(), MouseInput(), C4StartupPlrSelDlg::OnNewBtn(), C4GUI::ScrollBar::OnPosChanged(), C4StartupPlrSelDlg::OnPropertyBtn(), C4StartupScenSelDlg::ScenListItem::ScenListItem(), C4GUI::ScrollWindow::ScrollBy(), C4GUI::ListBox::ScrollItemInView(), C4GUI::ScrollWindow::ScrollPages(), C4GUI::ScrollWindow::ScrollRangeInView(), C4GUI::ScrollWindow::ScrollToBottom(), C4GUI::Tabular::SetGfx(), C4GoalDisplay::SetGoals(), C4GUI::TextWindow::SetPicture(), C4GUI::Dialog::SetTitle(), C4GUI::ScrollBar::Update(), C4GUI::ScrollWindow::Update(), C4StartupPlrSelDlg::PlayerListItem::UpdateCore(), C4GUI::ListBox::UpdateElementPosition(), C4GUI::ListBox::UpdateElementPositions(), C4Menu::UpdateElementPositions(), C4GUI::ScrollWindow::UpdateOwnPos(), C4Menu::UpdateScrollBar(), and C4GUI::TextWindow::UpdateSize().

Here is the caller graph for this function:

◆ GetClientRect()

C4Rect& C4GUI::Window::GetClientRect ( )
inlineoverridevirtualinherited

Reimplemented from C4GUI::Element.

Definition at line 864 of file C4Gui.h.

864 { return rcClientRect; }

References C4GUI::Window::rcClientRect.

Referenced by C4GameOverDlg::C4GameOverDlg(), C4LeagueSignupDialog::C4LeagueSignupDialog(), C4StartupMainDlg::C4StartupMainDlg(), C4StartupModsDlg::C4StartupModsDlg(), C4StartupNetDlg::C4StartupNetDlg(), C4StartupOptionsDlg::C4StartupOptionsDlg(), C4StartupPlrColorPickerDlg::C4StartupPlrColorPickerDlg(), C4StartupPlrPropertiesDlg::C4StartupPlrPropertiesDlg(), C4StartupPlrSelDlg::C4StartupPlrSelDlg(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4GUI::ContextMenu::CheckOpenSubmenu(), C4GUI::ListBox::ContractToElementHeight(), C4MapFolderData::CreateGUIElements(), C4GUI::InfoDialog::CreateSubComponents(), C4GUI::Window::Draw(), C4GUI::ListBox::DrawElement(), C4GUI::ContextMenu::DrawElement(), C4GUI::FullscreenDialog::FullscreenDialog(), C4GUI::ListBox::GetItemWidth(), C4FileSelDlg::InitElements(), C4GUI::InputDialog::InputDialog(), C4GUI::LabeledEdit::LabeledEdit(), C4GameLobby::MainDlg::MainDlg(), C4GUI::MessageDialog::MessageDialog(), C4GUI::Window::MouseInput(), C4GUI::ContextMenu::MouseInput(), MouseInput(), C4GUI::ScrollBar::OnPosChanged(), C4GUI::ProgressDialog::ProgressDialog(), C4GameLobby::ScenDesc::ScenDesc(), C4StartupScenSelDlg::ScenListItem::ScenListItem(), C4GUI::ScrollWindow::ScrollBy(), C4GUI::ScrollWindow::ScrollRangeInView(), C4GUI::ScrollWindow::ScrollToBottom(), C4GUI::ScrollWindow::ScrollWindow(), C4GoalDisplay::SetGoals(), C4GUI::FullscreenDialog::SetTitle(), C4GUI::TextWindow::TextWindow(), C4GUI::ScrollBar::Update(), C4GUI::ListBox::UpdateColumnCount(), and C4GUI::TextWindow::UpdateSize().

Here is the caller graph for this function:

◆ GetContainedClientRect()

C4Rect C4GUI::Element::GetContainedClientRect ( )
inlineinherited

Definition at line 448 of file C4Gui.h.

448 { C4Rect rc=GetClientRect(); rc.x=rc.y=0; return rc; }
virtual C4Rect & GetClientRect()
Definition: C4Gui.h:447

References C4GUI::Element::GetClientRect(), C4Rect::x, and C4Rect::y.

Referenced by C4GUI::Tabular::AddSheet(), C4ChartDialog::C4ChartDialog(), C4Network2ClientListDlg::C4Network2ClientListDlg(), C4Network2StartWaitDlg::C4Network2StartWaitDlg(), C4StartupAboutDlg::C4StartupAboutDlg(), C4StartupLegalDlg::C4StartupLegalDlg(), C4StartupModsDlg::C4StartupModsDlg(), C4StartupModsListEntry::C4StartupModsListEntry(), C4StartupNetDlg::C4StartupNetDlg(), C4StartupNetListEntry::C4StartupNetListEntry(), C4FileSelDlg::DefaultListItem::DefaultListItem(), C4ChatDlg::DoPlacement(), C4GUI::Element::GetToprightCornerRect(), C4GUI::InputDialog::InputDialog(), C4GameLobby::MainDlg::MainDlg(), C4GUI::TextWindow::TextWindow(), C4Menu::UpdateElementPositions(), C4ChatControl::ChatSheet::NickItem::UpdateOwnPos(), C4FileSelDlg::DefaultListItem::UpdateOwnPos(), C4GUI::ScrollWindow::UpdateOwnPos(), C4StartupScenSelDlg::ScenListItem::UpdateOwnPos(), C4ChatControl::UpdateSize(), C4ChatDlg::UpdateSize(), C4GUI::Tabular::UpdateSize(), and C4GUI::TextWindow::UpdateSize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetContainer()

Container* C4GUI::Container::GetContainer ( )
inlineoverridevirtualinherited

Reimplemented from C4GUI::Element.

Definition at line 831 of file C4Gui.h.

831 { return this; } // returns parent for elements; this for containers

◆ GetContextHandler()

ContextHandler * C4GUI::Element::GetContextHandler ( )
virtualinherited

Reimplemented in C4GUI::Dialog.

Definition at line 429 of file C4Gui.cpp.

430  {
431  // fallback to parent context, if own is not assigned
433  }
virtual ContextHandler * GetContextHandler()
Definition: C4Gui.cpp:429

References C4GUI::Element::GetContextHandler(), C4GUI::Element::pContextHandler, and C4GUI::Element::pParent.

Referenced by C4GUI::ContextButton::ContextButton(), C4GUI::Element::GetContextHandler(), and C4GUI::Element::MouseInput().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetContextMenuIndex()

int32_t C4GUI::Screen::GetContextMenuIndex ( )
inline

Definition at line 2658 of file C4Gui.h.

2658 { return pContext ? pContext->GetMenuIndex() : 0; } // get current context-menu (lowest level)
int32_t GetMenuIndex()
Definition: C4Gui.h:1884

References C4GUI::ContextMenu::GetMenuIndex(), and pContext.

Referenced by C4GUI::ContextButton::DrawElement(), and C4GUI::ComboBox::DrawElement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDialog()

Dialog * C4GUI::Screen::GetDialog ( C4Window pWindow)

Definition at line 720 of file C4Gui.cpp.

721  {
722  // get dialog with matching window
723  Dialog *pDlg;
724  for (Element *pEl = pLast; pEl; pEl = pEl->GetPrev())
725  if ( (pDlg = pEl->GetDlg()) != nullptr)
726  if (pDlg->pWindow == pWindow)
727  return pDlg;
728  return nullptr;
729  }
Element * GetPrev() const
Definition: C4Gui.h:450

References C4GUI::Dialog::GetDlg(), C4GUI::Element::GetPrev(), C4GUI::Container::pLast, and C4GUI::Dialog::pWindow.

Referenced by DialogWinProc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDialogWindow()

virtual class DialogWindow* C4GUI::Element::GetDialogWindow ( )
inlineprotectedvirtualinherited

Reimplemented in C4GUI::Dialog.

Definition at line 404 of file C4Gui.h.

404 { return nullptr; } // return DialogWindow if this element is a dialog

◆ GetDlg()

Dialog * C4GUI::Element::GetDlg ( )
virtualinherited

Reimplemented in C4GUI::Dialog.

Definition at line 288 of file C4Gui.cpp.

288 { if (pParent) return pParent->GetDlg (); return nullptr; }
virtual class Dialog * GetDlg()
Definition: C4Gui.cpp:288

References C4GUI::Element::GetDlg(), and C4GUI::Element::pParent.

Referenced by C4GUI::Control::DisableFocus(), C4ChatControl::DlgEnter(), C4ChatControl::GetDefaultControl(), C4GUI::Element::GetDlg(), C4GUI::ContextMenu::GetTargetDialog(), C4GUI::Control::HasDrawFocus(), C4GUI::Element::IsInActiveDlg(), C4GUI::Label::MouseInput(), C4GUI::Control::MouseInput(), MouseInput(), C4ChatControl::OnConnectBtn(), C4GUI::RenameEdit::OnFinishInput(), C4GUI::Label::OnHotkey(), C4ChatControl::OnLoginDataEnter(), C4GUI::CloseButton::OnPress(), C4GUI::CloseIconButton::OnPress(), C4GUI::RenameEdit::RenameEdit(), C4GUI::Container::SetVisibility(), and ShowDialog().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetElementByIndex()

Element * C4GUI::Container::GetElementByIndex ( int32_t  i)
inherited

Definition at line 223 of file C4GuiContainers.cpp.

224  {
225  // get next until end of list or queried index is reached
226  // if i is negative or equal or larger than childcount, the loop will never break and nullptr returned
227  Element *pEl;
228  for (pEl = pFirst; i-- && pEl; pEl=pEl->pNext) {}
229  return pEl;
230  }

References C4GUI::Container::pFirst, and C4GUI::Element::pNext.

Referenced by C4GUI::ContextMenu::GetIndexedEntry(), C4Menu::GetItem(), C4GUI::Tabular::GetSheet(), and C4GUI::ContextMenu::SelectItem().

Here is the caller graph for this function:

◆ GetElementCount()

int32_t C4GUI::Container::GetElementCount ( )
inherited

Definition at line 232 of file C4GuiContainers.cpp.

233  {
234  int32_t cnt=0;
235  for (Element *pEl = pFirst; pEl; pEl=pEl->pNext) ++cnt;
236  return cnt;
237  }

References C4GUI::Container::pFirst, and C4GUI::Element::pNext.

Referenced by C4ScriptGuiWindow::ExecuteCommand(), C4GUI::Tabular::GetSheetCount(), and C4GUI::ListBox::SortElements().

Here is the caller graph for this function:

◆ GetFirst()

◆ GetFirstContained()

Element* C4GUI::Container::GetFirstContained ( )
inlineoverridevirtualinherited

Reimplemented from C4GUI::Element.

Definition at line 773 of file C4Gui.h.

773 { return pFirst; }

References C4GUI::Container::pFirst.

Referenced by C4GUI::ListBox::OnGetFocus().

Here is the caller graph for this function:

◆ GetFirstNestedElement()

Element * C4GUI::Container::GetFirstNestedElement ( bool  fBackwards)
overridevirtualinherited

Reimplemented from C4GUI::Element.

Definition at line 204 of file C4GuiContainers.cpp.

205  {
206  // get first/last in own list
207  if (pFirst) return (fBackwards ? pLast : pFirst)->GetFirstNestedElement(fBackwards);
208  // no own list: return this one
209  return this;
210  }

References C4GUI::Element::GetFirstNestedElement(), C4GUI::Container::pFirst, and C4GUI::Container::pLast.

Referenced by C4GUI::Container::GetNextNestedElement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetFullscreenDialog()

Dialog * C4GUI::Screen::GetFullscreenDialog ( bool  fIncludeFading)

Definition at line 1037 of file C4Gui.cpp.

1038  {
1039  Dialog *pDlg;
1040  for (Element *pEl = GetFirst(); pEl; pEl = pEl->GetNext())
1041  if ((pDlg = pEl->GetDlg()))
1042  if (pDlg->IsVisible())
1043  if (pDlg->IsFullscreenDialog())
1044  if (fIncludeFading || !pDlg->IsFading())
1045  return pDlg;
1046  return nullptr;
1047  }
Element * GetFirst()
Definition: C4Gui.h:829
Element * GetNext() const
Definition: C4Gui.h:449

References C4GUI::Dialog::GetDlg(), C4GUI::Container::GetFirst(), C4GUI::Element::GetNext(), C4GUI::Dialog::IsFading(), C4GUI::Dialog::IsFullscreenDialog(), and C4GUI::Element::IsVisible().

Referenced by Draw(), and HasFullscreenDialog().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetHeight()

int32_t C4GUI::Element::GetHeight ( )
inlineinherited

Definition at line 444 of file C4Gui.h.

444 { return rcBounds.Hgt; }

References C4Rect::Hgt, and C4GUI::Element::rcBounds.

Referenced by ShowDialog().

Here is the caller graph for this function:

◆ GetLast()

Element* C4GUI::Container::GetLast ( )
inlineinherited

Definition at line 830 of file C4Gui.h.

830 { return pLast; }

References C4GUI::Container::pLast.

Referenced by C4GUI::ListBox::GetLast(), C4Menu::InitSize(), and C4Menu::UpdateScrollBar().

Here is the caller graph for this function:

◆ GetLastContained()

virtual Element* C4GUI::Container::GetLastContained ( )
inlinevirtualinherited

Definition at line 774 of file C4Gui.h.

774 { return pLast; }

References C4GUI::Container::pLast.

◆ GetLastContextMenuIndex()

int32_t C4GUI::Screen::GetLastContextMenuIndex ( )
inline

Definition at line 2659 of file C4Gui.h.

2659 { return ContextMenu::GetLastMenuIndex(); } // get last opened context-menu (lowest level)
static int32_t GetLastMenuIndex()
Definition: C4Gui.h:1885

References C4GUI::ContextMenu::GetLastMenuIndex().

Referenced by C4GUI::ComboBox::MouseInput().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetListItemTopSpacing()

virtual int32_t C4GUI::Element::GetListItemTopSpacing ( )
inlinevirtualinherited

Reimplemented in C4StartupNetListEntry, and C4StartupModsListEntry.

Definition at line 461 of file C4Gui.h.

461 { return C4GUI_DefaultListSpacing; }
#define C4GUI_DefaultListSpacing
Definition: C4Gui.h:123

References C4GUI_DefaultListSpacing.

Referenced by C4GUI::ListBox::AddElement(), C4GUI::ListBox::DrawElement(), and C4GUI::ListBox::UpdateElementPositions().

Here is the caller graph for this function:

◆ GetListItemTopSpacingBar()

virtual bool C4GUI::Element::GetListItemTopSpacingBar ( )
inlinevirtualinherited

Definition at line 462 of file C4Gui.h.

462 { return false; }

Referenced by C4GUI::ListBox::DrawElement().

Here is the caller graph for this function:

◆ GetMarginBottom()

virtual int32_t C4GUI::Window::GetMarginBottom ( )
inlinevirtualinherited

Reimplemented in C4StartupPlrPropertiesDlg, C4Menu, C4GUI::FullscreenDialog, C4GUI::Dialog, C4GUI::ContextMenu, C4GUI::TextWindow, C4GUI::Tabular, C4GUI::ListBox, C4GUI::Edit, and C4GUI::GroupBox.

Definition at line 876 of file C4Gui.h.

876 { return 0; }

Referenced by C4GUI::Dialog::GetMarginBottom(), C4Menu::InitSize(), C4GoalDisplay::SetGoals(), and C4GUI::Window::UpdateOwnPos().

Here is the caller graph for this function:

◆ GetMarginLeft()

virtual int32_t C4GUI::Window::GetMarginLeft ( )
inlinevirtualinherited

Reimplemented in C4StartupPlrPropertiesDlg, C4Menu, C4GUI::FullscreenDialog, C4GUI::Dialog, C4GUI::ContextMenu, C4GUI::TextWindow, C4GUI::Tabular, C4GUI::ListBox, C4GUI::Edit, and C4GUI::GroupBox.

Definition at line 874 of file C4Gui.h.

874 { return 0; }

Referenced by C4GUI::Dialog::GetMarginLeft(), C4Menu::InitSize(), and C4GUI::Window::UpdateOwnPos().

Here is the caller graph for this function:

◆ GetMarginRight()

virtual int32_t C4GUI::Window::GetMarginRight ( )
inlinevirtualinherited

Reimplemented in C4StartupPlrPropertiesDlg, C4Menu, C4GUI::FullscreenDialog, C4GUI::Dialog, C4GUI::ContextMenu, C4GUI::TextWindow, C4GUI::Tabular, C4GUI::ListBox, C4GUI::Edit, and C4GUI::GroupBox.

Definition at line 875 of file C4Gui.h.

875 { return 0; }

Referenced by C4GUI::Dialog::GetMarginRight(), C4Menu::InitSize(), and C4GUI::Window::UpdateOwnPos().

Here is the caller graph for this function:

◆ GetMarginTop()

virtual int32_t C4GUI::Window::GetMarginTop ( )
inlinevirtualinherited

Reimplemented in C4StartupScenSelDlg, C4StartupPlrPropertiesDlg, C4StartupPlrSelDlg, C4GUI::FullscreenDialog, C4GUI::Dialog, C4GUI::ContextMenu, C4GUI::TextWindow, C4GUI::Tabular, C4GUI::ListBox, C4GUI::Edit, and C4GUI::GroupBox.

Definition at line 873 of file C4Gui.h.

873 { return 0; }

Referenced by C4GUI::Dialog::GetMarginTop(), C4Menu::InitSize(), C4GoalDisplay::SetGoals(), and C4GUI::Window::UpdateOwnPos().

Here is the caller graph for this function:

◆ GetMouseControlledDialogCount()

int32_t C4GUI::Screen::GetMouseControlledDialogCount ( )

Definition at line 999 of file C4Gui.cpp.

1000  {
1001  Dialog *pDlg; int32_t iResult=0;
1002  for (Element *pEl = GetFirst(); pEl; pEl = pEl->GetNext())
1003  if ((pDlg = pEl->GetDlg()))
1004  if (pDlg->IsShown() && pDlg->IsMouseControlled())
1005  ++iResult;
1006  return iResult;
1007  }
int iResult
Definition: C4GroupMain.cpp:40

References C4GUI::Dialog::GetDlg(), C4GUI::Container::GetFirst(), C4GUI::Element::GetNext(), iResult, C4GUI::Dialog::IsMouseControlled(), and C4GUI::Dialog::IsShown().

Referenced by MouseMove().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNext()

◆ GetNextNestedElement()

Element * C4GUI::Container::GetNextNestedElement ( Element pPrevElement,
bool  fBackwards 
)
inherited

Definition at line 171 of file C4GuiContainers.cpp.

172  {
173  if (fBackwards)
174  {
175  // this is last
176  if (pPrevElement == this) return nullptr;
177  // no previous given?
178  if (!pPrevElement)
179  // then use last nested for backwards search
180  return GetFirstNestedElement(true);
181  // get nested, previous element if present
182  if (pPrevElement->pPrev) return pPrevElement->pPrev->GetFirstNestedElement(true);
183  // if not, return parent (could be this)
184  return pPrevElement->pParent;
185  }
186  else
187  {
188  // forward search: first element is this
189  if (!pPrevElement) return this;
190  // check next nested
191  Element *pEl;
192  if ((pEl = pPrevElement->GetFirstContained())) return pEl;
193  // check next in list, going upwards until this container is reached
194  while (pPrevElement && pPrevElement != this)
195  {
196  if ((pEl = pPrevElement->pNext)) return pEl;
197  pPrevElement = pPrevElement->pParent;
198  }
199  // nothing found
200  }
201  return nullptr;
202  }
Element * GetFirstNestedElement(bool fBackwards) override

References C4GUI::Element::GetFirstContained(), C4GUI::Element::GetFirstNestedElement(), C4GUI::Container::GetFirstNestedElement(), C4GUI::Element::pNext, C4GUI::Element::pParent, and C4GUI::Element::pPrev.

Referenced by C4GUI::Dialog::AdvanceFocus().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetOwnToolTip()

const char* C4GUI::Element::GetOwnToolTip ( )
inlineinherited

Definition at line 440 of file C4Gui.h.

440 { return ToolTip.getData(); } // return tooltip const char*, without fallback to parent

References StdStrBuf::getData().

Here is the call graph for this function:

◆ GetParent()

◆ GetPreferredDlgRect()

const C4Rect& C4GUI::Screen::GetPreferredDlgRect ( )
inline

Definition at line 2603 of file C4Gui.h.

2603 { return PreferredDlgRect; }
C4Rect PreferredDlgRect
Definition: C4Gui.h:2596

References PreferredDlgRect.

Referenced by C4ScoreboardDlg::Update().

Here is the caller graph for this function:

◆ GetPrev()

Element* C4GUI::Element::GetPrev ( ) const
inlineinherited

Definition at line 450 of file C4Gui.h.

450 { return pPrev; }

References C4GUI::Element::pPrev.

Referenced by C4GUI::ListBox::AddElement(), GetDialog(), GetTopDialog(), C4GUI::Window::MouseInput(), MouseInput(), and C4GUI::Container::ReverseIterator::operator++().

Here is the caller graph for this function:

◆ GetScreen()

Screen* C4GUI::Screen::GetScreen ( )
inlineoverridevirtual

Reimplemented from C4GUI::Element.

Definition at line 2628 of file C4Gui.h.

2628 { return this; }; // return contained screen

◆ GetScreenS()

static Screen* C4GUI::Screen::GetScreenS ( )
inlinestatic

Definition at line 2629 of file C4Gui.h.

2629 { return pScreen; } // get global screen

References pScreen.

Referenced by C4StartupPlrSelDlg::CheckPlayerName(), C4GUI::Dialog::FadeIn(), C4GUI::FullscreenDialog::FullscreenDialog(), C4GUI::ContextMenu::GetScreen(), C4GUI::GetScreenHgt(), C4GUI::GetScreenWdt(), C4GUI::GetZoom(), C4GUI::IsActive(), C4GUI::IsExclusive(), C4GUI::MouseMove(), C4GUI::Element::RemoveElement(), C4GUI::Dialog::Show(), and C4GUI::Element::~Element().

Here is the caller graph for this function:

◆ GetToolTip()

const char * C4GUI::Element::GetToolTip ( )
inherited

Definition at line 423 of file C4Gui.cpp.

424  {
425  // fallback to parent tooltip, if own is not assigned
426  return (!pParent || !ToolTip.isNull()) ? ToolTip.getData() : pParent->GetToolTip();
427  }
const char * GetToolTip()
Definition: C4Gui.cpp:423
bool isNull() const
Definition: StdBuf.h:441

References StdStrBuf::getData(), C4GUI::Element::GetToolTip(), StdStrBuf::isNull(), and C4GUI::Element::pParent.

Referenced by C4GUI::CMouse::Draw(), C4GUI::Element::GetToolTip(), C4GameLobby::MainDlg::OnRightTabContext(), and C4GameLobby::MainDlg::UpdateRightTab().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTopDialog()

Dialog * C4GUI::Screen::GetTopDialog ( )

Definition at line 692 of file C4Gui.cpp.

693  {
694  // search backwards in component list
695  Dialog *pDlg;
696  for (Element *pEl = pLast; pEl; pEl = pEl->GetPrev())
697  if ((pDlg = pEl->GetDlg()))
698  if (pDlg->IsShown())
699  return pDlg;
700  // no dlg found
701  return nullptr;
702  }

References C4GUI::Dialog::GetDlg(), C4GUI::Element::GetPrev(), C4GUI::Dialog::IsShown(), and C4GUI::Container::pLast.

Referenced by CloseDialog(), C4GUI::Dialog::Draw(), HasKeyboardFocus(), IsActive(), and RecheckActiveDialog().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetToprightCornerRect()

C4Rect C4GUI::Element::GetToprightCornerRect ( int32_t  iWidth = 16,
int32_t  iHeight = 16,
int32_t  iHIndent = 4,
int32_t  iVIndent = 4,
int32_t  iIndexX = 0 
)
inherited

Definition at line 399 of file C4Gui.cpp.

400  {
401  // bounds by topright corner of element
402  C4Rect rtBounds = (GetContainer() != this) ? GetClientRect() : GetContainedClientRect();
403  rtBounds.x += rtBounds.Wdt - (iWidth + iHIndent) * (iIndexX + 1);
404  rtBounds.y += iVIndent;
405  rtBounds.Wdt = rtBounds.Hgt = iHeight;
406  return rtBounds;
407  }
virtual Container * GetContainer()
Definition: C4Gui.h:410
C4Rect GetContainedClientRect()
Definition: C4Gui.h:448

References C4GUI::Element::GetClientRect(), C4GUI::Element::GetContainedClientRect(), C4GUI::Element::GetContainer(), C4Rect::Hgt, C4Rect::Wdt, C4Rect::x, and C4Rect::y.

Referenced by C4GUI::ContextButton::ContextButton(), C4GameLobby::MainDlg::MainDlg(), C4GUI::Dialog::SetTitle(), and C4GUI::Dialog::UpdateSize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetWidth()

int32_t C4GUI::Element::GetWidth ( )
inlineinherited

Definition at line 443 of file C4Gui.h.

443 { return rcBounds.Wdt; }

References C4GUI::Element::rcBounds, and C4Rect::Wdt.

Referenced by ShowDialog().

Here is the caller graph for this function:

◆ GetZoom()

float C4GUI::Screen::GetZoom ( ) const
inline

Definition at line 2631 of file C4Gui.h.

2631 { return fZoom; }; // get GUI zoom

References fZoom.

Referenced by C4GUI::GetZoom(), and MouseInput().

Here is the caller graph for this function:

◆ HasContext()

bool C4GUI::Screen::HasContext ( )
inline

Definition at line 2660 of file C4Gui.h.

2660 { return !!pContext; }

References pContext.

Referenced by C4GUI::Dialog::IsActive().

Here is the caller graph for this function:

◆ HasFullscreenDialog()

bool C4GUI::Screen::HasFullscreenDialog ( bool  fIncludeFading)

Definition at line 1032 of file C4Gui.cpp.

1033  {
1034  return !!GetFullscreenDialog(fIncludeFading);
1035  }

References GetFullscreenDialog().

Referenced by C4GraphicsSystem::Execute().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HasKeyboardFocus()

bool C4GUI::Screen::HasKeyboardFocus ( )
inline

Definition at line 2671 of file C4Gui.h.

2672  {
2673  // always hook keyboard in exclusive mode; only on exclusive top dialogs in shared mode
2674  if (IsExclusive()) return true;
2675  Dialog *pDlg = GetTopDialog();
2676  return pDlg && pDlg->IsExclusiveDialog();
2677  }

References GetTopDialog(), IsExclusive(), and C4GUI::Dialog::IsExclusiveDialog().

Referenced by CharIn(), C4Game::DoKeyboardInput(), and HasMouseFocus().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HasMouseFocus()

bool C4GUI::Screen::HasMouseFocus ( )
inline

Definition at line 2678 of file C4Gui.h.

2679  { return HasKeyboardFocus(); }

References HasKeyboardFocus().

Referenced by MouseMove(), and C4MouseControl::UpdateClip().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Init()

void C4GUI::Screen::Init ( int32_t  tx,
int32_t  ty,
int32_t  twdt,
int32_t  thgt 
)

Definition at line 578 of file C4Gui.cpp.

579  {
580  Mouse.x = tx+twdt/2;
581  Mouse.y = ty+thgt/2;
582  fZoom = 1.0f;
583  // set size - calcs client area as well
584  SetBounds(C4Rect(tx,ty,twdt,thgt));
585  SetPreferredDlgRect(C4Rect(0,0,twdt,thgt));
586  }
int32_t y
Definition: C4Gui.h:2535
int32_t x
Definition: C4Gui.h:2535
void SetBounds(const C4Rect &rcNewBound)
Definition: C4Gui.h:446
void SetPreferredDlgRect(const C4Rect &rtNewPref)
Definition: C4Gui.h:2651

References fZoom, Mouse, C4GUI::Element::SetBounds(), SetPreferredDlgRect(), C4GUI::CMouse::x, and C4GUI::CMouse::y.

Referenced by C4Game::PreInit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InsertElement()

void C4GUI::Container::InsertElement ( Element pChild,
Element pInsertBefore 
)
inherited

Definition at line 150 of file C4GuiContainers.cpp.

151  {
152  // add?
153  if (!pInsertBefore) { AddElement(pChild); return; }
154  // safety
155  if (!pChild || pInsertBefore->pParent != this) return;
156  // remove from any previous container
157  if (pChild->pParent) pChild->pParent->RemoveElement(pChild);
158  // add before given element
159  if ((pChild->pPrev = pInsertBefore->pPrev))
160  pInsertBefore->pPrev->pNext = pChild;
161  else
162  pFirst = pChild;
163  pChild->pNext = pInsertBefore; pInsertBefore->pPrev = pChild;
164  pChild->pParent = this;
165 
166  assert(pChild->pNext != pChild);
167  assert(pChild->pPrev != pChild);
168  assert(pChild->pParent != pChild);
169  }
void AddElement(Element *pChild)

References C4GUI::Container::AddElement(), C4GUI::Container::pFirst, C4GUI::Element::pNext, C4GUI::Element::pParent, C4GUI::Element::pPrev, and C4GUI::Container::RemoveElement().

Referenced by C4GUI::ListBox::InsertElement(), and ShowDialog().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsActive()

bool C4GUI::Screen::IsActive ( )
inline

Definition at line 2633 of file C4Gui.h.

2633 { return !!GetTopDialog(); } // return whether GUI is active

References GetTopDialog().

Referenced by C4GUI::IsActive(), C4MessageBoard::LogNotify(), and MouseMove().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsComponentOutsideClientArea()

virtual bool C4GUI::Window::IsComponentOutsideClientArea ( )
inlinevirtualinherited

Reimplemented in C4StartupPlrPropertiesDlg, C4GUI::FullscreenDialog, C4GUI::Dialog, and C4GUI::ScrollWindow.

Definition at line 870 of file C4Gui.h.

870 { return false; } // if set, drawing routine of subcomponents will clip to Bounds rather than to ClientRect

Referenced by C4GUI::Window::Draw().

Here is the caller graph for this function:

◆ IsExclusive()

bool C4GUI::Screen::IsExclusive ( )
inline

Definition at line 2670 of file C4Gui.h.

2670 { return fExclusive; }

References fExclusive.

Referenced by ActivateDialog(), CharIn(), C4Scoreboard::DoDlgShow(), ElementPosChanged(), HasKeyboardFocus(), C4Scoreboard::HideDlg(), C4GUI::Dialog::IsActive(), C4GUI::IsExclusive(), MouseInput(), and ShowDialog().

Here is the caller graph for this function:

◆ IsExternalDrawDialog()

virtual bool C4GUI::Element::IsExternalDrawDialog ( )
inlineprotectedvirtualinherited

Reimplemented in C4Menu, and C4GUI::Dialog.

Definition at line 402 of file C4Gui.h.

402 { return false; }

◆ IsFocused()

virtual bool C4GUI::Container::IsFocused ( Control pCtrl)
inlinevirtualinherited

Reimplemented in C4GUI::Dialog, and C4GUI::ListBox.

Definition at line 836 of file C4Gui.h.

836 { return pParent ? pParent->IsFocused(pCtrl) : false; }
virtual bool IsFocused(Control *pCtrl)
Definition: C4Gui.h:836

References C4GUI::Container::IsFocused(), and C4GUI::Element::pParent.

Referenced by C4GUI::Control::HasFocus(), C4GUI::Container::IsFocused(), and C4GUI::ListBox::IsFocused().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsFocusElement()

virtual Control* C4GUI::Element::IsFocusElement ( )
inlinevirtualinherited

Reimplemented in C4GUI::ComboBox, C4GUI::TextWindow, C4GUI::Tabular, C4GUI::ListBox, C4GUI::CheckBox, and C4GUI::Control.

Definition at line 432 of file C4Gui.h.

432 { return nullptr; }; // return control to gain focus in search-cycle

Referenced by C4GUI::Dialog::AdvanceFocus().

Here is the caller graph for this function:

◆ IsImmediateToolTip()

bool C4GUI::Element::IsImmediateToolTip ( ) const
inlineinherited

Definition at line 441 of file C4Gui.h.

441 { return is_immediate_tooltip; }

Referenced by C4GUI::CMouse::Draw().

Here is the caller graph for this function:

◆ IsInActiveDlg()

bool C4GUI::Element::IsInActiveDlg ( bool  fForKeyboard)
inherited

Definition at line 435 of file C4Gui.cpp.

436  {
437  // get dlg
438  Dialog *pDlg=GetDlg();
439  if (!pDlg) return false;
440  // check if dlg is active
441  return pDlg->IsActive(fForKeyboard);
442  }

References C4GUI::Element::GetDlg(), and C4GUI::Dialog::IsActive().

Referenced by C4GUI::ControlKeyDlgCB< TargetClass >::CheckCondition(), C4GUI::Button::DrawElement(), C4GUI::IconButton::DrawElement(), C4GUI::ArrowButton::DrawElement(), C4GUI::FacetButton::DrawElement(), C4GUI::CheckBox::DrawElement(), and C4GUI::ContextButton::DrawElement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsMenu()

virtual bool C4GUI::Element::IsMenu ( )
inlineprotectedvirtualinherited

Reimplemented in C4GUI::ContextMenu, and C4GUI::ContextMenu::Entry.

Definition at line 403 of file C4Gui.h.

403 { return false; }

Referenced by C4GUI::Element::RemoveElement().

Here is the caller graph for this function:

◆ IsOwnPtrElement()

virtual bool C4GUI::Element::IsOwnPtrElement ( )
inlineprotectedvirtualinherited

Reimplemented in C4Menu.

Definition at line 401 of file C4Gui.h.

401 { return false; } // if true is returned, item will not be deleted when container is cleared

Referenced by C4GUI::Container::ClearChildren().

Here is the caller graph for this function:

◆ IsParentOf()

bool C4GUI::Container::IsParentOf ( Element pEl)
overridevirtualinherited

Reimplemented from C4GUI::Element.

Definition at line 239 of file C4GuiContainers.cpp.

240  {
241  // return whether this is the parent container (directly or recursively) of the passed element
242  for (Container *pC = pEl->GetParent(); pC; pC = pC->GetParent())
243  if (pC == this) return true;
244  return false;
245  }

References C4GUI::Element::GetParent().

Referenced by C4GUI::Control::MouseInput(), and C4GUI::Container::SetVisibility().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsSelectedChild()

virtual bool C4GUI::Container::IsSelectedChild ( Element pChild)
inlinevirtualinherited

Reimplemented in C4GUI::Tabular, and C4GUI::ListBox.

Definition at line 837 of file C4Gui.h.

837 { return pParent ? pParent->IsSelectedChild(pChild) : true; } // whether the child element is selected - only false for list-box-containers which can have unselected children
virtual bool IsSelectedChild(Element *pChild)
Definition: C4Gui.h:837

References C4GUI::Container::IsSelectedChild(), and C4GUI::Element::pParent.

Referenced by C4GUI::Dialog::AdvanceFocus(), C4StartupNetListEntry::DrawElement(), and C4GUI::Container::IsSelectedChild().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsVisible()

bool C4GUI::Element::IsVisible ( )
inherited

Definition at line 201 of file C4Gui.cpp.

202  {
203  // self and parent must be visible
204  return fVisible && (!pParent || pParent->IsVisible());
205  }
bool fVisible
Definition: C4Gui.h:383

References C4GUI::Element::fVisible, C4GUI::Element::IsVisible(), and C4GUI::Element::pParent.

Referenced by C4GUI::Dialog::AdvanceFocus(), CharIn(), C4GUI::ControlKeyDlgCB< TargetClass >::CheckCondition(), C4GUI::Container::Draw(), C4GUI::Window::Draw(), Draw(), C4ScriptGuiWindow::Draw(), C4ScriptGuiWindow::DrawAll(), C4ScriptGuiWindow::DrawChildren(), C4ChatControl::GetDefaultControl(), GetFullscreenDialog(), C4GUI::Element::IsVisible(), C4ScriptGuiWindow::IsVisibleTo(), C4GUI::Window::MouseInput(), C4GUI::Control::MouseInput(), MouseInput(), C4GUI::Container::OnHotkey(), C4ScriptGuiWindow::ProcessMouseInput(), C4Menu::SetPosition(), C4Menu::UpdateElementPositions(), and C4GUI::TextWindow::UpdateSize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ KeyAny()

bool C4GUI::Screen::KeyAny ( )

Definition at line 771 of file C4Gui.cpp.

772  {
773  // mark keystroke in mouse
775  // key not yet processed
776  return false;
777  }

References Mouse, and C4GUI::CMouse::ResetActiveInput().

Referenced by C4Game::DoKeyboardInput().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MakeLastElement()

void C4GUI::Container::MakeLastElement ( Element pChild)
inherited

Definition at line 106 of file C4GuiContainers.cpp.

107  {
108  // must be from same container
109  if (pChild->pParent != this) return;
110  // unlink from list
111  if (pChild->pPrev) pChild->pPrev->pNext = pChild->pNext; else pFirst = pChild->pNext;
112  if (pChild->pNext) pChild->pNext->pPrev = pChild->pPrev; else pLast = pChild->pPrev;
113  // readd to front of list
114  if (pLast) pLast->pNext = pChild; else pFirst = pChild;
115  pChild->pPrev = pLast; pChild->pNext = nullptr; pLast = pChild;
116  }

References C4GUI::Container::pFirst, C4GUI::Container::pLast, C4GUI::Element::pNext, C4GUI::Element::pParent, and C4GUI::Element::pPrev.

Referenced by ActivateDialog().

Here is the caller graph for this function:

◆ MouseEnter()

virtual void C4GUI::Element::MouseEnter ( CMouse rMouse)
inlinevirtualinherited

Reimplemented in C4GUI::ComboBox, C4GUI::ContextButton, C4GUI::CheckBox, C4GUI::Button, C4MenuItem, and C4ScriptGuiWindow.

Definition at line 413 of file C4Gui.h.

413 {}; // called when mouse cursor enters element region

Referenced by C4GUI::Button::MouseEnter(), C4GUI::CheckBox::MouseEnter(), C4GUI::ContextButton::MouseEnter(), C4GUI::ComboBox::MouseEnter(), and MouseInput().

Here is the caller graph for this function:

◆ MouseInput() [1/3]

void C4GUI::Window::MouseInput ( CMouse rMouse,
int32_t  iButton,
int32_t  iX,
int32_t  iY,
DWORD  dwKeyParam 
)
overridevirtualinherited

Reimplemented from C4GUI::Element.

Reimplemented in C4GUI::Dialog, C4GUI::ComboBox, C4GUI::ContextButton, C4GUI::ContextMenu, C4GUI::Tabular, C4GUI::ListBox, C4GUI::CheckBox, C4GUI::Edit, C4GUI::Button, C4GUI::Control, C4GUI::PaintBox, C4GUI::ScrollWindow, and C4StartupScenSelDlg::ScenListItem.

Definition at line 273 of file C4GuiContainers.cpp.

274  {
275  // invisible?
276  if (!IsVisible()) return;
277  // inherited
278  Container::MouseInput(rMouse, iButton, iX, iY, dwKeyParam);
279  // get client pos
281  iX -= rcClientRect.x - rcBounds.x; iY -= rcClientRect.y - rcBounds.y;
282  // forward to topmost child element
283  for (Element *pChild = pLast; pChild; pChild = pChild->GetPrev())
284  if (pChild->fVisible && pChild->GetBounds().Contains(iX, iY))
285  {
286  // forward
287  pChild->MouseInput(rMouse, iButton, iX - pChild->GetBounds().x, iY - pChild->GetBounds().y, dwKeyParam);
288  // forward to one control only
289  break;
290  }
291  }
virtual void MouseInput(CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam)
Definition: C4Gui.cpp:244

References C4GUI::Element::GetBounds(), C4GUI::Window::GetClientRect(), C4GUI::Element::GetPrev(), C4GUI::Element::IsVisible(), C4GUI::Element::MouseInput(), C4GUI::Container::pLast, C4GUI::Element::rcBounds, C4GUI::Window::rcClientRect, C4GUI::CMouse::x, C4Rect::x, and C4Rect::y.

Referenced by C4GUI::ScrollWindow::MouseInput(), C4GUI::Control::MouseInput(), C4GUI::ContextMenu::MouseInput(), C4GUI::Dialog::MouseInput(), and MouseInput().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MouseInput() [2/3]

void C4GUI::Window::MouseInput
override

Definition at line 858 of file C4GuiContainers.cpp.

274  {
275  // invisible?
276  if (!IsVisible()) return;
277  // inherited
278  Container::MouseInput(rMouse, iButton, iX, iY, dwKeyParam);
279  // get client pos
281  iX -= rcClientRect.x - rcBounds.x; iY -= rcClientRect.y - rcBounds.y;
282  // forward to topmost child element
283  for (Element *pChild = pLast; pChild; pChild = pChild->GetPrev())
284  if (pChild->fVisible && pChild->GetBounds().Contains(iX, iY))
285  {
286  // forward
287  pChild->MouseInput(rMouse, iButton, iX - pChild->GetBounds().x, iY - pChild->GetBounds().y, dwKeyParam);
288  // forward to one control only
289  break;
290  }
291  }

Referenced by MouseMove(), and RecheckMouseInput().

Here is the caller graph for this function:

◆ MouseInput() [3/3]

bool C4GUI::Screen::MouseInput ( int32_t  iButton,
int32_t  iX,
int32_t  iY,
DWORD  dwKeyParam,
Dialog pDlg,
class C4Viewport pVP 
)

Definition at line 837 of file C4Gui.cpp.

838  {
839  // convert from screen pixel coordinates to GUI coordinates
840  float fZoom = pForDlg ? 1.0f : GetZoom(); // Developer mode dialogs are currently drawn unzoomed
841  float fX = float(iPxX) / fZoom;
842  float fY = float(iPxY) / fZoom;
843  // forward to mouse
844  Mouse.Input(iButton, fX, fY, dwKeyParam);
845 
846  // dragging
847  if (Mouse.pDragElement)
848  {
849  int32_t iX2=fX, iY2=fY;
851  if (!Mouse.IsLDown())
852  {
853  // stop dragging
854  Mouse.pDragElement->StopDragging(Mouse, iX2, iY2, dwKeyParam);
855  Mouse.pDragElement = nullptr;
856  }
857  else
858  {
859  // continue dragging
860  Mouse.pDragElement->DoDragging(Mouse, iX2, iY2, dwKeyParam);
861  }
862  }
863  // backup previous MouseOver-element
865  Mouse.pMouseOverElement = nullptr;
866  bool fProcessed = false;
867  // active context menu?
868  if (!pForVP && pContext && pContext->CtxMouseInput(Mouse, iButton, fX, fY, dwKeyParam))
869  {
870  // processed by context menu: OK!
871  }
872  // otherwise: active dlg and inside screen? (or direct forward to specific dlg/viewport dlg)
873  else if (rcBounds.Contains(fX, fY) || pForDlg || pForVP)
874  {
875  // context menu open but mouse down command issued? close context then
876  if (pContext && (iButton == C4MC_Button_LeftDown || iButton == C4MC_Button_RightDown))
877  AbortContext(true);
878  // get client pos
879  if (!pForDlg && !pForVP)
880  {
881  C4Rect &rcClientArea = GetClientRect();
882  fX -= rcClientArea.x; fY -= rcClientArea.y;
883  }
884  // exclusive mode: process active dialog only
885  if (IsExclusive() && !pForDlg && !pForVP)
886  {
888  {
889  // bounds check to dlg: only if not dragging
890  C4Rect &rcDlgBounds = pActiveDlg->GetBounds();
891  if (Mouse.IsLDown() || rcDlgBounds.Contains(fX, fY))
892  // forward to active dialog
893  pActiveDlg->MouseInput(Mouse, iButton, fX - rcDlgBounds.x, fY - rcDlgBounds.y, dwKeyParam);
894  else
895  Mouse.pMouseOverElement = nullptr;
896  }
897  else
898  // outside dialog: own handling (for screen context menu)
899  Window::MouseInput(Mouse, iButton, fX, fY, dwKeyParam);
900  }
901  else
902  {
903  // non-exclusive mode: process all dialogs; make them active on left-click
904  Dialog *pDlg;
905  for (Element *pEl = pLast; pEl; pEl = pEl->GetPrev())
906  if ((pDlg = pEl->GetDlg()))
907  if (pDlg->IsShown())
908  {
909  // if specified: process specified dlg only
910  if (pForDlg && pDlg != pForDlg) continue;
911  // if specified: process specified viewport only
912  bool fIsExternalDrawDialog = pDlg->IsExternalDrawDialog();
913  C4Viewport *pVP = fIsExternalDrawDialog ? pDlg->GetViewport() : nullptr;
914  if (pForVP && pForVP != pVP) continue;
915  // calc offset
916  C4Rect &rcDlgBounds = pDlg->GetBounds();
917  int32_t iOffX=0, iOffY=0;
918  // special handling for viewport dialogs
919  if (fIsExternalDrawDialog)
920  {
921  // ignore external drawing dialogs without a viepwort assigned
922  if (!pVP) continue;
923  // always clip to viewport bounds
924  C4Rect rcOut(pVP->GetOutputRect());
925  if (!rcOut.Contains(fX + rcBounds.x, fY + rcBounds.y)) continue;
926  // viewport dialogs: Offset determined by viewport position
927  iOffX = rcOut.x; iOffY = rcOut.y;
928  }
929  // hit test; or special: dragging possible outside active dialog
930  if (rcDlgBounds.Contains(fX-iOffX, fY-iOffY) || (pDlg == pActiveDlg && Mouse.pDragElement && Mouse.pDragElement->GetDlg() == pDlg))
931  {
932  // Okay; do input
933  pDlg->MouseInput(Mouse, iButton, fX - rcDlgBounds.x - iOffX, fY - rcDlgBounds.y - iOffY, dwKeyParam);
934  // CAUTION: pDlg may be invalid now!
935  // set processed-flag manually
936  fProcessed = true;
937  // inactive dialogs get activated by clicks
938  if (Mouse.IsLDown() && pDlg != pActiveDlg)
939  // but not viewport dialogs!
940  if (!pDlg->IsExternalDrawDialog())
941  ActivateDialog(pDlg);
942  // one dlg only; break loop here
943  break;
944  }
945  }
946  }
947  }
948 
949  // check if MouseOver has changed
951  {
952  // send events
955  }
956  // return whether anything processed it
957  return fProcessed || Mouse.pDragElement || (Mouse.pMouseOverElement && Mouse.pMouseOverElement!=this) || pContext;
958  }
const int32_t C4MC_Button_RightDown
const int32_t C4MC_Button_LeftDown
bool IsLDown()
Definition: C4Gui.h:2565
void Input(int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam)
Definition: C4Gui.cpp:463
Element * pMouseOverElement
Definition: C4Gui.h:2555
Element * pDragElement
Definition: C4Gui.h:2556
Element * pPrevMouseOverElement
Definition: C4Gui.h:2555
bool CtxMouseInput(CMouse &rMouse, int32_t iButton, int32_t iScreenX, int32_t iScreenY, DWORD dwKeyParam)
Definition: C4GuiMenu.cpp:441
void MouseInput(CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam) override
virtual void StopDragging(CMouse &rMouse, int32_t iX, int32_t iY, DWORD dwKeyParam)
Definition: C4Gui.cpp:282
virtual void MouseEnter(CMouse &rMouse)
Definition: C4Gui.h:413
virtual void DoDragging(CMouse &rMouse, int32_t iX, int32_t iY, DWORD dwKeyParam)
Definition: C4Gui.cpp:269
virtual void MouseLeave(CMouse &rMouse)
Definition: C4Gui.h:414
void ScreenPos2ClientPos(int32_t &riX, int32_t &riY)
Definition: C4Gui.cpp:218
float GetZoom() const
Definition: C4Gui.h:2631
void ActivateDialog(Dialog *pDlg)
Definition: C4Gui.cpp:647
void MouseInput(CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam) override
bool Contains(int32_t iX, int32_t iY) const
Definition: C4Rect.h:40
C4Rect GetOutputRect()
Definition: C4Viewport.h:67

References AbortContext(), ActivateDialog(), C4MC_Button_LeftDown, C4MC_Button_RightDown, C4Rect::Contains(), C4GUI::ContextMenu::CtxMouseInput(), C4GUI::Element::DoDragging(), fZoom, C4GUI::Element::GetBounds(), C4GUI::Window::GetClientRect(), C4GUI::Element::GetDlg(), C4GUI::Dialog::GetDlg(), C4Viewport::GetOutputRect(), C4GUI::Element::GetPrev(), C4GUI::Dialog::GetViewport(), GetZoom(), C4GUI::CMouse::Input(), IsExclusive(), C4GUI::Dialog::IsExternalDrawDialog(), C4GUI::Dialog::IsFading(), C4GUI::CMouse::IsLDown(), C4GUI::Dialog::IsShown(), C4GUI::Element::IsVisible(), Mouse, C4GUI::Element::MouseEnter(), C4GUI::Window::MouseInput(), C4GUI::Dialog::MouseInput(), C4GUI::Element::MouseLeave(), pActiveDlg, pContext, C4GUI::CMouse::pDragElement, C4GUI::Container::pLast, C4GUI::CMouse::pMouseOverElement, C4GUI::CMouse::pPrevMouseOverElement, C4GUI::Element::rcBounds, C4GUI::Element::ScreenPos2ClientPos(), C4GUI::Element::StopDragging(), C4Rect::x, and C4Rect::y.

Here is the call graph for this function:

◆ MouseLeave()

virtual void C4GUI::Element::MouseLeave ( CMouse rMouse)
inlinevirtualinherited

Reimplemented in C4GUI::ComboBox, C4GUI::ContextButton, C4GUI::ContextMenu::Entry, C4GUI::Tabular, C4GUI::CheckBox, C4GUI::Button, C4GUI::ScrollBar, and C4ScriptGuiWindow.

Definition at line 414 of file C4Gui.h.

414 {}; // called when mouse cursor leaves element region

Referenced by MouseInput(), C4GUI::ScrollBar::MouseLeave(), C4GUI::Button::MouseLeave(), C4GUI::CheckBox::MouseLeave(), C4GUI::Tabular::MouseLeave(), C4GUI::ContextButton::MouseLeave(), C4GUI::ComboBox::MouseLeave(), C4GUI::CMouse::ReleaseElements(), and C4GUI::CMouse::RemoveElement().

Here is the caller graph for this function:

◆ MouseMove()

void C4GUI::Screen::MouseMove ( int32_t  iButton,
int32_t  iX,
int32_t  iY,
DWORD  dwKeyParam,
class C4Viewport pVP 
)

Definition at line 797 of file C4Gui.cpp.

798  {
799  // Special: Pass to MouseControl if dragging and button is not upped
800  if (IsActive() && !::MouseControl.IsDragging())
801  {
802  bool fResult = MouseInput(iButton, iX, iY, dwKeyParam, nullptr, pVP);
803  if (HasMouseFocus()) { SetMouseInGUI(true, true); return; }
804  // non-exclusive GUI: inform mouse-control about GUI-result
805  SetMouseInGUI(fResult, true);
806  // abort if GUI processed it
807  if (fResult) return;
808  }
809  else
810  // no GUI: mouse is not in GUI
811  SetMouseInGUI(false, true);
812  // mouse control enabled?
813  if (!::MouseControl.IsActive())
814  {
815  // enable mouse in GUI, if a mouse-only-dlg is displayed
817  SetMouseInGUI(true, true);
818  return;
819  }
820  // Pass on to mouse controlled viewport
821  ::Viewports.MouseMoveToViewport(iButton, iX, iY, dwKeyParam);
822  }
C4MouseControl MouseControl
Definition: C4Globals.cpp:47
C4ViewportList Viewports
bool HasMouseFocus()
Definition: C4Gui.h:2678
bool IsActive()
Definition: C4Gui.h:2633
void MouseInput(CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam) override
void SetMouseInGUI(bool fInGUI, bool fByMouse)
Definition: C4Gui.cpp:824
int32_t GetMouseControlledDialogCount()
Definition: C4Gui.cpp:999
void MouseMoveToViewport(int32_t button, int32_t x, int32_t y, DWORD key_param)

References GetMouseControlledDialogCount(), HasMouseFocus(), IsActive(), C4MouseControl::IsActive(), C4MouseControl::IsDragging(), MouseControl, MouseInput(), C4ViewportList::MouseMoveToViewport(), SetMouseInGUI(), and Viewports.

Referenced by C4GUI::MouseMove().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnHotkey()

bool C4GUI::Container::OnHotkey ( uint32_t  cHotkey)
overrideprotectedvirtualinherited

Reimplemented from C4GUI::Element.

Reimplemented in C4GUI::CheckBox, and C4GUI::Button.

Definition at line 212 of file C4GuiContainers.cpp.

213  {
214  if (!IsVisible()) return false;
215  // check all nested elements
216  for (Element *pEl = pFirst; pEl; pEl=pEl->pNext)
217  if (pEl->fVisible)
218  if (pEl->OnHotkey(cHotkey)) return true;
219  // no match found
220  return false;
221  }

References C4GUI::Element::IsVisible(), C4GUI::Container::pFirst, and C4GUI::Element::pNext.

Here is the call graph for this function:

◆ OnSec1Timer()

void C4GUI::Screen::OnSec1Timer ( )

◆ rbegin()

ReverseIterator C4GUI::Container::rbegin ( )
inlineinherited

Definition at line 826 of file C4Gui.h.

826 { return ReverseIterator(pLast); }

References C4GUI::Container::pLast.

Referenced by C4ScriptGuiWindow::MouseInput(), and C4ScriptGuiWindow::ProcessMouseInput().

Here is the caller graph for this function:

◆ ReaddElement()

void C4GUI::Container::ReaddElement ( Element pChild)
inherited

Definition at line 134 of file C4GuiContainers.cpp.

135  {
136  // safety
137  if (!pChild || pChild->pParent != this) return;
138  // remove from any previous container
139  if (pChild->pPrev) pChild->pPrev->pNext = pChild->pNext; else pFirst = pChild->pNext;
140  if (pChild->pNext) pChild->pNext->pPrev = pChild->pPrev; else pLast = pChild->pPrev;
141  // add to end of list
142  if (pLast) pLast->pNext = pChild; else pFirst = pChild;
143  pChild->pPrev = pLast; pChild->pNext = nullptr; pLast = pChild;
144 
145  assert(pChild->pNext != pChild);
146  assert(pChild->pPrev != pChild);
147  assert(pChild->pParent != pChild);
148  }

References C4GUI::Container::pFirst, C4GUI::Container::pLast, C4GUI::Element::pNext, C4GUI::Element::pParent, and C4GUI::Element::pPrev.

Referenced by C4GUI::ListBox::SortElements().

Here is the caller graph for this function:

◆ RecheckActiveDialog()

void C4GUI::Screen::RecheckActiveDialog ( )

Definition at line 683 of file C4Gui.cpp.

684  {
685  Dialog *pNewTop = GetTopDialog();
686  if (pActiveDlg == pNewTop) return;
688  // do not set yet if it's fading
689  if (pActiveDlg && pActiveDlg->IsFading()) pActiveDlg = nullptr;
690  }

References GetTopDialog(), C4GUI::Dialog::IsFading(), Mouse, pActiveDlg, and C4GUI::CMouse::ReleaseElements().

Referenced by C4GUI::Dialog::Draw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RecheckMouseInput()

bool C4GUI::Screen::RecheckMouseInput ( )

Definition at line 960 of file C4Gui.cpp.

961  {
962  return MouseInput(C4MC_Button_None, Mouse.x, Mouse.y, Mouse.dwKeys, nullptr, nullptr);
963  }
const int32_t C4MC_Button_None
DWORD dwKeys
Definition: C4Gui.h:2538

References C4MC_Button_None, C4GUI::CMouse::dwKeys, Mouse, MouseInput(), C4GUI::CMouse::x, and C4GUI::CMouse::y.

Here is the call graph for this function:

◆ RemoveElement()

void C4GUI::Screen::RemoveElement ( Element pChild)
overridevirtual

Reimplemented from C4GUI::Container.

Definition at line 556 of file C4Gui.cpp.

557  {
558  // inherited
559  Window::RemoveElement(pChild);
560  // clear ptrs
561  if (pActiveDlg == pChild) { pActiveDlg = nullptr; Mouse.ResetElements(); }
562  Mouse.RemoveElement(pChild);
563  if (pContext)
564  {
565  if (pContext == pChild) pContext=nullptr;
566  else pContext->RemoveElement(pChild);
567  }
568  }
void ResetElements()
Definition: C4Gui.h:2569
void RemoveElement(Element *pChild)
Definition: C4Gui.cpp:534
void RemoveElement(Element *pChild) override
void RemoveElement(Element *pChild) override
Definition: C4GuiMenu.cpp:364

References Mouse, pActiveDlg, pContext, C4GUI::CMouse::RemoveElement(), C4GUI::Container::RemoveElement(), C4GUI::ContextMenu::RemoveElement(), and C4GUI::CMouse::ResetElements().

Referenced by C4GUI::Element::RemoveElement(), C4Menu::TryClose(), C4GUI::ContextMenu::~ContextMenu(), and C4GUI::Element::~Element().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rend()

ReverseIterator C4GUI::Container::rend ( )
inlineinherited

Definition at line 827 of file C4Gui.h.

827 { return ReverseIterator(nullptr); }

Referenced by C4ScriptGuiWindow::MouseInput(), and C4ScriptGuiWindow::ProcessMouseInput().

Here is the caller graph for this function:

◆ Render()

void C4GUI::Screen::Render ( bool  fDoBG)

Definition at line 730 of file C4Gui.cpp.

731  {
732  // get output cgo
733  C4TargetFacet cgo;
735  // draw to it
736  Draw(cgo, fDoBG);
737  }
C4FullScreen FullScreen
Definition: C4Globals.cpp:46
void Draw(C4TargetFacet &cgo) override
void Set(const C4Facet &cpy)
Definition: C4Facet.h:182
C4Surface * pSurface
Definition: C4Window.h:275

References Draw(), FullScreen, C4Window::pSurface, C4GUI::Element::rcBounds, and C4TargetFacet::Set().

Referenced by C4GraphicsSystem::Execute().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RenderMouse()

void C4GUI::Screen::RenderMouse ( C4TargetFacet cgo)

Definition at line 739 of file C4Gui.cpp.

740  {
741  // draw mouse cursor
742  // All tool tips hidden during keyboard input. Immediate tooltips hidden if mouse was moving recently.
744  }
bool IsActiveInput()
Definition: C4Gui.h:2581
@ TTST_Immediate
Definition: C4Gui.h:2550
void Draw(C4TargetFacet &cgo, TooltipShowState draw_tool_tips)
Definition: C4Gui.cpp:485
bool IsMouseStill()
Definition: C4Gui.h:2579

References C4GUI::CMouse::Draw(), C4GUI::CMouse::IsActiveInput(), C4GUI::CMouse::IsMouseStill(), Mouse, C4GUI::CMouse::TTST_All, C4GUI::CMouse::TTST_Immediate, and C4GUI::CMouse::TTST_None.

Referenced by Draw(), and C4Viewport::DrawOverlay().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ScreenPos2ClientPos()

void C4GUI::Element::ScreenPos2ClientPos ( int32_t &  riX,
int32_t &  riY 
)
inherited

Definition at line 218 of file C4Gui.cpp.

219  {
220  // apply all parent offsets
221  Container *pCont = pParent;
222  while (pCont)
223  {
224  pCont->ApplyElementOffset(riX, riY);
225  pCont = pCont->GetParent();
226  }
227  // apply own offset
228  riX -= rcBounds.x; riY -= rcBounds.y;
229  }
virtual void ApplyElementOffset(int32_t &riX, int32_t &riY)
Definition: C4Gui.h:840

References C4GUI::Container::ApplyElementOffset(), C4GUI::Element::GetParent(), C4GUI::Element::pParent, C4GUI::Element::rcBounds, C4Rect::x, and C4Rect::y.

Referenced by MouseInput(), and C4GUI::CMouse::ReleaseElements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetBounds()

void C4GUI::Element::SetBounds ( const C4Rect rcNewBound)
inlineinherited

Definition at line 446 of file C4Gui.h.

446 { rcBounds=rcNewBound; UpdatePos(); UpdateSize(); }
virtual void UpdateSize()
Definition: C4Gui.cpp:185

References C4GUI::Element::rcBounds, C4GUI::Element::UpdatePos(), and C4GUI::Element::UpdateSize().

Referenced by C4GameOptionButtons::C4GameOptionButtons(), C4GoalDisplay::C4GoalDisplay(), C4StartupModsListEntry::C4StartupModsListEntry(), C4StartupNetDlg::C4StartupNetDlg(), C4StartupNetListEntry::C4StartupNetListEntry(), C4GUI::ContextButton::ContextButton(), C4GUI::ListBox::ContractToElementHeight(), C4GUI::Control::Control(), C4GUI::Dialog::Dialog(), C4ChatDlg::DoPlacement(), C4StartupNetListEntry::Execute(), C4GUI::FullscreenDialog::FullscreenDialog(), C4GUI::GroupBox::GroupBox(), C4GUI::HorizontalLine::HorizontalLine(), Init(), C4Menu::InitSize(), C4GUI::LabeledEdit::LabeledEdit(), C4StartupModsListEntry::MakeInfoEntry(), C4Game::OnResolutionChanged(), C4GameLobby::ScenDesc::ScenDesc(), C4StartupScenSelDlg::ScenListItem::ScenListItem(), C4GUI::ScrollWindow::ScrollWindow(), C4GUI::InputDialog::SetCustomEdit(), C4GUI::Tabular::SetGfx(), C4GoalDisplay::SetGoals(), C4StartupNetListEntry::SetReference(), C4StartupNetListEntry::SetRefQuery(), C4GUI::Tabular::Sheet::Sheet(), C4GUI::TextWindow::TextWindow(), C4ScoreboardDlg::Update(), C4GUI::ListBox::UpdateElementPositions(), C4Menu::UpdateElementPositions(), C4GUI::ScrollWindow::UpdateOwnPos(), C4ChatControl::UpdateSize(), C4ChatDlg::UpdateSize(), C4GUI::TextWindow::UpdateSize(), and C4GUI::Dialog::UpdateSize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetContextHandler()

void C4GUI::Element::SetContextHandler ( ContextHandler pNewHd)
inlineinherited

Definition at line 465 of file C4Gui.h.

466  {
468  if ((pContextHandler = pNewHd)) pNewHd->Ref();
469  }

References C4GUI::ContextHandler::DeRef(), C4GUI::Element::pContextHandler, and C4GUI::ContextHandler::Ref().

Referenced by C4StartupMainDlg::C4StartupMainDlg(), C4GUI::ContextButton::ContextButton(), C4GUI::Edit::Edit(), and C4GameLobby::MainDlg::MainDlg().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetDragTarget()

void C4GUI::Element::SetDragTarget ( Window pToWindow)
inlineinherited

Definition at line 464 of file C4Gui.h.

464 { pDragTarget = pToWindow; }

References C4GUI::Element::pDragTarget.

Referenced by C4GUI::Dialog::SetTitle().

Here is the caller graph for this function:

◆ SetExclusive()

void C4GUI::Screen::SetExclusive ( bool  fToState)
inline

Definition at line 2669 of file C4Gui.h.

void SetOwnedMouse(bool fToVal)
Definition: C4Gui.h:2576

References fExclusive, Mouse, C4GUI::CMouse::SetOwnedMouse(), and UpdateMouseFocus().

Referenced by C4Game::Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetMouseInGUI()

void C4GUI::Screen::SetMouseInGUI ( bool  fInGUI,
bool  fByMouse 
)

Definition at line 824 of file C4Gui.cpp.

825  {
826  // inform mouse control and GUI
827  Mouse.SetOwnedMouse(fInGUI);
828  // initial movement to ensure mouse control pos is correct
829  if (!::MouseControl.IsMouseOwned() && !fInGUI && !fByMouse)
830  {
833  }
834  ::MouseControl.SetOwnedMouse(!fInGUI);
835  }
C4GUIScreen * pGUI
Definition: C4Gui.cpp:1191
void SetOwnedMouse(bool fToVal)
float GetZoom()
Definition: C4Gui.h:2831

References C4MC_Button_None, C4GUI::CMouse::dwKeys, C4GUI::GetZoom(), C4MouseControl::IsMouseOwned(), Mouse, MouseControl, C4ViewportList::MouseMoveToViewport(), pGUI, C4GUI::CMouse::SetOwnedMouse(), C4MouseControl::SetOwnedMouse(), Viewports, C4GUI::CMouse::x, and C4GUI::CMouse::y.

Referenced by C4GraphicsSystem::Execute(), and MouseMove().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetPos()

void C4GUI::Window::SetPos ( int32_t  iXPos,
int32_t  iYPos 
)
inlineinherited

Definition at line 860 of file C4Gui.h.

861  { rcBounds.x=iXPos; rcBounds.y=iYPos; UpdatePos(); }

References C4GUI::Element::rcBounds, C4GUI::Element::UpdatePos(), C4Rect::x, and C4Rect::y.

Referenced by C4ScoreboardDlg::DoPlacement(), C4Menu::InitLocation(), C4StartupPlrSelDlg::OnNewBtn(), C4StartupPlrSelDlg::OnPropertyBtn(), C4Menu::SetLocation(), and ShowDialog().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetPreferredDlgRect()

void C4GUI::Screen::SetPreferredDlgRect ( const C4Rect rtNewPref)
inline

Definition at line 2651 of file C4Gui.h.

2651 { PreferredDlgRect = rtNewPref; }

References PreferredDlgRect.

Referenced by Init(), C4ViewportList::RecalculateViewports(), C4Viewport::SetOutputSize(), and C4MouseControl::UpdateClip().

Here is the caller graph for this function:

◆ SetToolTip()

void C4GUI::Element::SetToolTip ( const char *  szNewTooltip,
bool  is_immediate = false 
)
inherited

Definition at line 409 of file C4Gui.cpp.

410  {
411  // store tooltip
412  if (szNewTooltip) ToolTip.Copy(szNewTooltip); else ToolTip.Clear();
413  // store immediate flag
414  is_immediate_tooltip = is_immediate;
415  }
void Copy()
Definition: StdBuf.h:467
void Clear()
Definition: StdBuf.h:466

References StdStrBuf::Clear(), and StdStrBuf::Copy().

Referenced by C4GUI::ContextMenu::AddItem(), C4GameOverDlg::C4GameOverDlg(), C4LeagueSignupDialog::C4LeagueSignupDialog(), C4MenuItem::C4MenuItem(), C4StartupAboutDlg::C4StartupAboutDlg(), C4StartupLegalDlg::C4StartupLegalDlg(), C4StartupMainDlg::C4StartupMainDlg(), C4StartupModsDlg::C4StartupModsDlg(), C4StartupNetDlg::C4StartupNetDlg(), C4StartupOptionsDlg::C4StartupOptionsDlg(), C4StartupPlrPropertiesDlg::C4StartupPlrPropertiesDlg(), C4StartupPlrSelDlg::C4StartupPlrSelDlg(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4MapFolderData::CreateGUIElements(), C4GUI::InfoDialog::CreateSubComponents(), C4GUI::FullscreenDialog::FullscreenDialog(), C4GUI::IconButton::IconButton(), C4GUI::InputDialog::InputDialog(), C4GameLobby::MainDlg::MainDlg(), C4GUI::ProgressDialog::ProgressDialog(), C4StartupScenSelDlg::ScenListItem::ScenListItem(), C4GUI::InputDialog::SetCustomEdit(), C4GUI::FullscreenDialog::SetTitle(), C4GUI::Dialog::SetTitle(), C4ChatControl::ChatSheet::NickItem::Update(), and C4GameLobby::MainDlg::UpdateRightTab().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetVisibility()

void C4GUI::Container::SetVisibility ( bool  fToValue)
overridevirtualinherited

Reimplemented from C4GUI::Element.

Reimplemented in C4StartupNetListEntry, and C4StartupModsListEntry.

Definition at line 247 of file C4GuiContainers.cpp.

248  {
249  // inherited
250  Element::SetVisibility(fToValue);
251  // remove focus from contained elements
252  if (!fToValue)
253  {
254  Dialog *pDlg = GetDlg();
255  if (pDlg)
256  {
257  Control *pFocus = pDlg->GetFocus();
258  if (pFocus)
259  {
260  if (IsParentOf(pFocus))
261  {
262  pDlg->SetFocus(nullptr, false);
263  }
264  }
265  }
266  }
267  }
C4GameControl Control
bool IsParentOf(Element *pEl) override
virtual void SetVisibility(bool fToValue)
Definition: C4Gui.cpp:207

References C4GUI::Element::GetDlg(), C4GUI::Dialog::GetFocus(), C4GUI::Container::IsParentOf(), C4GUI::Dialog::SetFocus(), and C4GUI::Element::SetVisibility().

Referenced by C4GUI::Tabular::AddCustomSheet(), C4LeagueSignupDialog::C4LeagueSignupDialog(), C4Menu::C4Menu(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4Menu::Draw(), C4Menu::InitLocation(), C4StartupModsDownloader::OnConfirmInstallation(), C4StartupModsListEntry::SetVisibility(), and C4StartupNetListEntry::SetVisibility().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowDialog()

void C4GUI::Screen::ShowDialog ( Dialog pDlg,
bool  fFade 
)

Definition at line 611 of file C4Gui.cpp.

612  {
613  assert(pDlg);
614  // do place console mode dialogs
615  if (!Application.isEditor || pDlg->IsViewportDialog())
616  // exclusive or free dlg: center pos
617  // evaluate own placement proc first
618  if (!pDlg->DoPlacement(this, PreferredDlgRect))
619  {
620  if (pDlg->IsFreePlaceDialog())
621  pDlg->SetPos((GetWidth() - pDlg->GetWidth()) / 2, (GetHeight() - pDlg->GetHeight()) / 2 + pDlg->IsBottomPlacementDialog()*GetHeight()/3);
622  else if (IsExclusive())
623  pDlg->SetPos((GetWidth() - pDlg->GetWidth()) / 2, (GetHeight() - pDlg->GetHeight()) / 2);
624  else
625  // non-exclusive mode at preferred viewport pos
626  pDlg->SetPos(PreferredDlgRect.x+30, PreferredDlgRect.y+30);
627  }
628  // add to local component list at correct ordering
629  int32_t iNewZ = pDlg->GetZOrdering(); Element *pEl; Dialog *pOtherDlg;
630  for (pEl = GetFirst(); pEl; pEl = pEl->GetNext())
631  if ((pOtherDlg = pEl->GetDlg()))
632  if (pOtherDlg->GetZOrdering() > iNewZ)
633  break;
634  InsertElement(pDlg, pEl);
635  // set as active, if not fading and on top
636  if (!fFade && !pEl)
637  // but not viewport dialogs!
638  if (!pDlg->IsExternalDrawDialog())
639  pActiveDlg = pDlg;
640  // show it
641  pDlg->fOK = false;
642  pDlg->fShow = true;
643  // mouse focus might have changed
645  }
void InsertElement(Element *pChild, Element *pInsertBefore)
bool fOK
Definition: C4Gui.h:2083
int32_t GetWidth()
Definition: C4Gui.h:443
int32_t GetHeight()
Definition: C4Gui.h:444

References Application, C4GUI::Dialog::DoPlacement(), C4GUI::Dialog::fOK, C4GUI::Dialog::fShow, C4GUI::Element::GetDlg(), C4GUI::Container::GetFirst(), C4GUI::Element::GetHeight(), C4GUI::Element::GetNext(), C4GUI::Element::GetWidth(), C4GUI::Dialog::GetZOrdering(), C4GUI::Container::InsertElement(), C4GUI::Dialog::IsBottomPlacementDialog(), C4Application::isEditor, IsExclusive(), C4GUI::Dialog::IsExternalDrawDialog(), C4GUI::Dialog::IsFreePlaceDialog(), C4GUI::Dialog::IsViewportDialog(), pActiveDlg, PreferredDlgRect, C4GUI::Window::SetPos(), UpdateMouseFocus(), C4Rect::x, and C4Rect::y.

Referenced by C4GUI::Dialog::FadeIn(), and C4GUI::Dialog::Show().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowErrorMessage()

bool C4GUI::Screen::ShowErrorMessage ( const char *  szMessage)

Definition at line 1046 of file C4GuiDialogs.cpp.

1047  {
1048  return ShowMessage(szMessage, LoadResStr("IDS_DLG_ERROR"), Ico_Error);
1049  }
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
bool ShowMessage(const char *szMessage, const char *szCaption, Icons icoIcon, int32_t *piConfigDontShowAgainSetting=nullptr)
@ Ico_Error
Definition: C4Gui.h:652

References C4GUI::Ico_Error, LoadResStr(), and ShowMessage().

Referenced by C4StartupNetDlg::DoOK(), C4Network2::LeagueShowError(), C4StartupPlrPropertiesDlg::OnClosed(), C4ChatControl::OnConnectBtn(), C4StartupMainDlg::OnEditorBtn(), and C4FileSelDlg::UserClose().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowMessage()

bool C4GUI::Screen::ShowMessage ( const char *  szMessage,
const char *  szCaption,
Icons  icoIcon,
int32_t *  piConfigDontShowAgainSetting = nullptr 
)

Definition at line 1034 of file C4GuiDialogs.cpp.

1035  {
1036  // always log messages
1037  LogSilentF("[Msg] %s: %s", szCaption, szMessage);
1038  if (piConfigDontShowAgainSetting && *piConfigDontShowAgainSetting) return true;
1039 #ifdef USE_CONSOLE
1040  // skip in console mode
1041  return true;
1042 #endif
1043  return ShowRemoveDlg(new MessageDialog(szMessage, szCaption, MessageDialog::btnOK, icoIcon, MessageDialog::dsRegular, piConfigDontShowAgainSetting));
1044  }
bool LogSilentF(const char *strMessage,...)
Definition: C4Log.cpp:272
bool ShowRemoveDlg(Dialog *pDlg)

References C4GUI::MessageDialog::btnOK, C4GUI::MessageDialog::dsRegular, LogSilentF(), and ShowRemoveDlg().

Referenced by C4StartupPlrSelDlg::CheckPlayerName(), C4StartupScenSelDlg::DoOK(), C4Startup::DoStartup(), C4Network2IRCClient::Join(), C4StartupPlrPropertiesDlg::OnClosed(), C4StartupPlrSelDlg::OnDelBtnConfirm(), C4StartupMainDlg::OnTODO(), C4StartupOptionsDlg::SaveConfig(), ShowErrorMessage(), and C4StartupPlrSelDlg::PlayerListItem::UpdateCore().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowMessageModal()

bool C4GUI::Screen::ShowMessageModal ( const char *  szMessage,
const char *  szCaption,
DWORD  dwButtons,
Icons  icoIcon,
int32_t *  piConfigDontShowAgainSetting = nullptr 
)

Definition at line 1051 of file C4GuiDialogs.cpp.

1052  {
1053  // always log messages
1054  LogSilentF("[Modal] %s: %s", szCaption, szMessage);
1055  // skip if user doesn't want to see it
1056  if (piConfigDontShowAgainSetting && *piConfigDontShowAgainSetting) return true;
1057  // create message dlg and show modal
1058  return ShowModalDlg(new MessageDialog(szMessage, szCaption, dwButtons, icoIcon, MessageDialog::dsRegular, piConfigDontShowAgainSetting));
1059  }
bool ShowModalDlg(Dialog *pDlg, bool fDestruct=true)

References C4GUI::MessageDialog::dsRegular, LogSilentF(), and ShowModalDlg().

Referenced by C4StartupScenSelDlg::DeleteConfirm(), C4StartupModsDlg::DoOK(), C4StartupNetDlg::DoOK(), C4StartupNetDlg::DoRefresh(), C4DownloadDlg::DownloadFile(), C4Network2::InitLeague(), C4Network2::LeagueEnd(), C4Network2::LeaguePlrAuth(), C4Network2::LeagueStart(), C4ScenarioListLoader::Entry::RenameTo(), C4PlayerInfoList::RestoreSavegameInfos(), C4ScenarioListLoader::Entry::SetTitleInGroup(), C4GameLobby::MainDlg::Start(), C4StartupPlrPropertiesDlg::UserClose(), and C4LeagueSignupDialog::UserClose().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowModalDlg()

bool C4GUI::Screen::ShowModalDlg ( Dialog pDlg,
bool  fDestruct = true 
)

Definition at line 1071 of file C4GuiDialogs.cpp.

1072  {
1073 #ifdef USE_CONSOLE
1074  // no modal dialogs in console build
1075  // (there's most likely no way to close them!)
1076  if (fDestruct) delete pDlg;
1077  return true;
1078 #endif
1079  // safety
1080  if (!pDlg) return false;
1081  // show it
1082  if (!pDlg->Show(this, true)) { delete pDlg; return false; }
1083  // wait until it is closed
1084  bool fResult = pDlg->DoModal();
1085  if (fDestruct) delete pDlg;
1086  // return result
1087  return fResult;
1088  }

References C4GUI::Dialog::DoModal(), and C4GUI::Dialog::Show().

Referenced by C4StartupPlrPropertiesDlg::OnClrChangeCustom(), C4StartupMainDlg::OnShown(), C4Network2::QueryClientPassword(), C4DefinitionSelDlg::SelectDefinitions(), C4PortraitSelDlg::SelectPortrait(), ShowMessageModal(), and C4LeagueSignupDialog::ShowModal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowProgressDlg()

ProgressDialog * C4GUI::Screen::ShowProgressDlg ( const char *  szMessage,
const char *  szCaption,
int32_t  iMaxProgress = 100,
int32_t  iInitialProgress = 0,
Icons  icoIcon = Ico_Wait 
)

Definition at line 1061 of file C4GuiDialogs.cpp.

1062  {
1063  // create progress dlg
1064  ProgressDialog *pDlg = new ProgressDialog(szMessage, szCaption, iMaxProgress, iInitialProgress, icoIcon);
1065  // show it
1066  if (!pDlg->Show(this, true)) { delete pDlg; return nullptr; }
1067  // return dlg pointer
1068  return pDlg;
1069  }

References C4GUI::Dialog::Show().

Here is the call graph for this function:

◆ ShowRemoveDlg()

bool C4GUI::Screen::ShowRemoveDlg ( Dialog pDlg)

Definition at line 1090 of file C4GuiDialogs.cpp.

1091  {
1092  // safety
1093  if (!pDlg) return false;
1094  // mark removal when done
1095  pDlg->SetDelOnClose();
1096  // show it
1097  if (!pDlg->Show(this, true)) { delete pDlg; return false; }
1098  // done, success
1099  return true;
1100  }

References C4GUI::Dialog::SetDelOnClose(), and C4GUI::Dialog::Show().

Referenced by C4Scoreboard::DoDlgShow(), C4Startup::DoStartup(), C4StartupScenSelDlg::KeyCheat(), C4StartupScenSelDlg::KeyDelete(), C4GameOptionButtons::OnBtnComment(), C4GameOptionButtons::OnBtnPassword(), C4StartupPlrSelDlg::OnDelBtn(), C4StartupPlrSelDlg::OnNewBtn(), C4StartupPlrSelDlg::OnPropertyBtn(), C4FullScreen::ShowAbortDlg(), ShowMessage(), C4MessageInput::StartTypeIn(), C4Network2ClientListDlg::Toggle(), and C4ChartDialog::Toggle().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartDragging()

void C4GUI::Element::StartDragging ( CMouse rMouse,
int32_t  iX,
int32_t  iY,
DWORD  dwKeyParam 
)
virtualinherited

Definition at line 259 of file C4Gui.cpp.

260  {
261  // set flag
262  fDragging = true;
263  // set drag start pos
264  iDragX = iX; iDragY = iY;
265  // mark drag in mouse
266  rMouse.pDragElement = this;
267  }
bool fDragging
Definition: C4Gui.h:380

References C4GUI::Element::fDragging, C4GUI::Element::iDragX, C4GUI::Element::iDragY, and C4GUI::CMouse::pDragElement.

Referenced by C4MenuItem::MouseInput(), and C4GUI::Element::MouseInput().

Here is the caller graph for this function:

◆ StopDragging()

void C4GUI::Element::StopDragging ( CMouse rMouse,
int32_t  iX,
int32_t  iY,
DWORD  dwKeyParam 
)
virtualinherited

Definition at line 282 of file C4Gui.cpp.

283  {
284  // move element pos
285  DoDragging(rMouse, iX, iY, dwKeyParam);
286  }

References C4GUI::Element::DoDragging().

Referenced by MouseInput(), and C4GUI::CMouse::ReleaseElements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateGamepadGUIControlEnabled()

void C4GUI::Screen::UpdateGamepadGUIControlEnabled ( )

Definition at line 1049 of file C4Gui.cpp.

1050  {
1051  // Gamepad is always kept open now.
1052  }

◆ UpdateMouseFocus()

void C4GUI::Screen::UpdateMouseFocus ( )

Definition at line 965 of file C4Gui.cpp.

966  {
967  // when exclusive mode has changed: Make sure mouse clip is correct
969  }

References MouseControl, and C4MouseControl::UpdateClip().

Referenced by CloseDialog(), SetExclusive(), and ShowDialog().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateOwnPos()

void C4GUI::Window::UpdateOwnPos ( )
overridevirtualinherited

Reimplemented from C4GUI::Element.

Reimplemented in C4StartupScenSelDlg::ScenListItem, C4Menu, C4GUI::FullscreenDialog, C4GUI::CheckBox, and C4GUI::ScrollWindow.

Definition at line 324 of file C4GuiContainers.cpp.

325  {
327  // set client rect
328  int32_t iMarginL=GetMarginLeft(), iMarginT=GetMarginTop();
329  rcClientRect.Set(rcBounds.x + iMarginL, rcBounds.y + iMarginT, std::max<int32_t>(rcBounds.Wdt - iMarginL - GetMarginRight(), 0), std::max<int32_t>(rcBounds.Hgt - iMarginT - GetMarginBottom(), 0));
330  }
virtual void UpdateOwnPos()
Definition: C4Gui.h:434
virtual int32_t GetMarginRight()
Definition: C4Gui.h:875
virtual int32_t GetMarginTop()
Definition: C4Gui.h:873
virtual int32_t GetMarginLeft()
Definition: C4Gui.h:874
virtual int32_t GetMarginBottom()
Definition: C4Gui.h:876
void Set(int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt)
Definition: C4Rect.cpp:86

References C4GUI::Window::GetMarginBottom(), C4GUI::Window::GetMarginLeft(), C4GUI::Window::GetMarginRight(), C4GUI::Window::GetMarginTop(), C4Rect::Hgt, C4GUI::Element::rcBounds, C4GUI::Window::rcClientRect, C4Rect::Set(), C4GUI::Element::UpdateOwnPos(), C4Rect::Wdt, C4Rect::x, and C4Rect::y.

Referenced by C4GameOverDlg::C4GameOverDlg(), C4GUI::Edit::Edit(), C4GUI::ListBox::ListBox(), C4GUI::Dialog::SetFrameDeco(), C4GUI::GroupBox::SetMargin(), C4GUI::Tabular::SetSheetMargin(), C4GUI::GroupBox::SetTitle(), C4GUI::Tabular::Tabular(), C4GUI::TextWindow::TextWindow(), C4FileSelDlg::DefaultListItem::UpdateOwnPos(), C4GUI::FullscreenDialog::UpdateOwnPos(), and C4GUI::Window::Window().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdatePos()

void C4GUI::Element::UpdatePos ( )
protectedvirtualinherited

Reimplemented in C4GUI::Dialog.

Definition at line 193 of file C4Gui.cpp.

194  {
195  // update own fields
196  UpdateOwnPos();
197  // notify container
198  if (pParent) pParent->ElementPosChanged(this);
199  }
virtual void ElementPosChanged(Element *pOfElement)
Definition: C4Gui.h:754

References C4GUI::Container::ElementPosChanged(), C4GUI::Element::pParent, and C4GUI::Element::UpdateOwnPos().

Referenced by C4GUI::Element::DoDragging(), C4GUI::ContextMenu::Open(), C4GUI::ProgressBar::ProgressBar(), C4GUI::Element::SetBounds(), C4GUI::Window::SetPos(), and C4GUI::Dialog::UpdatePos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateSize()

void C4GUI::Element::UpdateSize ( )
protectedvirtualinherited

Reimplemented in C4GUI::Dialog, C4GUI::TextWindow, C4GUI::Tabular, C4GUI::ListBox, C4GUI::MultilineLabel, C4ChatDlg, and C4ChatControl.

Definition at line 185 of file C4Gui.cpp.

186  {
187  // update own fields
188  UpdateOwnPos();
189  // notify container
190  if (pParent) pParent->ElementSizeChanged(this);
191  }
virtual void ElementSizeChanged(Element *pOfElement)
Definition: C4Gui.h:753

References C4GUI::Container::ElementSizeChanged(), C4GUI::Element::pParent, and C4GUI::Element::UpdateOwnPos().

Referenced by C4FileSelDlg::DefaultListItem::DefaultListItem(), C4GUI::Element::SetBounds(), C4GUI::Label::SetX0(), C4GUI::MultilineLabel::UpdateHeight(), C4GUI::ListBox::UpdateSize(), C4GUI::Tabular::UpdateSize(), C4GUI::TextWindow::UpdateSize(), and C4GUI::Dialog::UpdateSize().

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ ContextMenu

friend class ContextMenu
friend

Definition at line 2689 of file C4Gui.h.

◆ Dialog

friend class Dialog
friend

Definition at line 2689 of file C4Gui.h.

Member Data Documentation

◆ fDragging

bool C4GUI::Element::fDragging {false}
protectedinherited

Definition at line 380 of file C4Gui.h.

Referenced by C4GUI::Element::StartDragging().

◆ fExclusive

bool C4GUI::Screen::fExclusive {true}
protected

Definition at line 2595 of file C4Gui.h.

Referenced by Clear(), IsExclusive(), and SetExclusive().

◆ fVisible

◆ fZoom

float C4GUI::Screen::fZoom {1.0f}
protected

Definition at line 2597 of file C4Gui.h.

Referenced by Clear(), GetZoom(), Init(), and MouseInput().

◆ iDragX

int32_t C4GUI::Element::iDragX
protectedinherited

Definition at line 379 of file C4Gui.h.

Referenced by C4GUI::Element::DoDragging(), and C4GUI::Element::StartDragging().

◆ iDragY

int32_t C4GUI::Element::iDragY
protectedinherited

Definition at line 379 of file C4Gui.h.

Referenced by C4GUI::Element::DoDragging(), and C4GUI::Element::StartDragging().

◆ Mouse

◆ pActiveDlg

◆ pContext

ContextMenu* C4GUI::Screen::pContext {nullptr}
protected

◆ pContextHandler

ContextHandler* C4GUI::Element::pContextHandler {nullptr}
protectedinherited

◆ pDragTarget

Window* C4GUI::Element::pDragTarget {nullptr}
protectedinherited

◆ pFirst

◆ pLast

◆ pNext

◆ pParent

◆ pPrev

◆ PreferredDlgRect

C4Rect C4GUI::Screen::PreferredDlgRect
protected

Definition at line 2596 of file C4Gui.h.

Referenced by GetPreferredDlgRect(), SetPreferredDlgRect(), and ShowDialog().

◆ pScreen

Screen * C4GUI::Screen::pScreen
staticprotected

Definition at line 2599 of file C4Gui.h.

Referenced by GetScreenS(), Screen(), and ~Screen().

◆ rcBounds

C4Rect C4GUI::Element::rcBounds
protectedinherited

Definition at line 385 of file C4Gui.h.

Referenced by C4Chart::C4Chart(), C4GameOptionButtons::C4GameOptionButtons(), C4GoalDisplay::C4GoalDisplay(), C4StartupMainDlg::C4StartupMainDlg(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4GUI::Element::ClientPos2ScreenPos(), C4GUI::ContextMenu::ContextMenu(), C4GUI::Dialog::CreateConsoleWindow(), C4GUI::ContextMenu::CtxMouseInput(), C4FileSelDlg::DefaultListItem::DefaultListItem(), C4GUI::Dialog::Dialog(), C4GUI::Element::DoContext(), C4GUI::Element::DoDragging(), C4ScoreboardDlg::DoPlacement(), C4GUI::Dialog::Draw(), C4ScriptGuiWindow::Draw(), C4GUI::Element::Draw3DFrame(), C4GUI::Element::DrawBar(), C4ScriptGuiWindow::DrawChildren(), C4GUI::Label::DrawElement(), C4GUI::WoodenLabel::DrawElement(), C4GUI::MultilineLabel::DrawElement(), C4GUI::ProgressBar::DrawElement(), C4GUI::HorizontalLine::DrawElement(), C4GUI::Picture::DrawElement(), C4GUI::OverlayPicture::DrawElement(), C4GUI::ScrollBar::DrawElement(), C4GUI::GroupBox::DrawElement(), C4GUI::PaintBox::DrawElement(), C4GUI::Button::DrawElement(), C4GUI::IconButton::DrawElement(), C4GUI::ArrowButton::DrawElement(), C4GUI::FacetButton::DrawElement(), C4GUI::Edit::DrawElement(), C4GUI::CheckBox::DrawElement(), C4GUI::ListBox::DrawElement(), C4GUI::Tabular::DrawElement(), C4GUI::TextWindow::DrawElement(), C4GUI::ContextMenu::Entry::DrawElement(), C4GUI::ContextMenu::DrawElement(), C4GUI::ContextButton::DrawElement(), C4GUI::ComboBox::DrawElement(), C4GUI::Dialog::DrawElement(), C4MenuItem::DrawElement(), C4Menu::DrawElement(), C4StartupMainDlg::DrawElement(), C4StartupNetListEntry::DrawElement(), C4StartupPlrPropertiesDlg::DrawElement(), C4Chart::DrawElement(), C4GUI::Element::DrawHBarByVGfx(), C4GUI::Element::DrawHVBar(), C4GUI::Element::DrawVBar(), C4GUI::Element::Element(), C4GUI::ContextMenu::Entry::Entry(), C4GUI::Element::GetBounds(), C4GUI::Element::GetClientRect(), C4ScriptGuiWindow::GetClippingRect(), C4GUI::Element::GetHeight(), C4GUI::WoodenLabel::GetLeftIndent(), C4GUI::Tabular::GetMarginBottom(), C4GUI::Tabular::GetMarginLeft(), C4GUI::Tabular::GetMarginRight(), C4GUI::Tabular::GetMarginTop(), C4StartupPlrSelDlg::GetMarginTop(), C4StartupScenSelDlg::GetMarginTop(), C4GUI::Element::GetWidth(), C4GUI::ScrollBar::HasPin(), C4Menu::InitLocation(), C4Menu::InitSize(), C4GUI::ScrollWindow::IsScrollingNecessary(), C4GUI::Label::Label(), C4GUI::LabeledEdit::LabeledEdit(), C4GUI::Window::MouseInput(), C4GUI::CheckBox::MouseInput(), C4GUI::Tabular::MouseInput(), C4GUI::ContextMenu::MouseInput(), C4ScriptGuiWindow::MouseInput(), MouseInput(), C4GUI::MultilineLabel::MultilineLabel(), C4ChatControl::ChatSheet::NickItem::NickItem(), C4ScriptGuiWindow::OnMouseIn(), C4GUI::ContextMenu::Open(), C4GUI::Picture::Picture(), C4ScriptGuiWindow::ProcessMouseInput(), C4GUI::ProgressBar::ProgressBar(), Render(), C4GameLobby::ScenDesc::ScenDesc(), C4GUI::Element::ScreenPos2ClientPos(), C4GUI::ScrollBar::ScrollBar(), C4GUI::Element::SetBounds(), C4GUI::Dialog::SetClientSize(), C4GUI::Tabular::SetGfx(), C4GUI::Window::SetPos(), C4GUI::Label::SetText(), C4GUI::Dialog::SetTitle(), C4GUI::Label::SetX0(), C4GUI::Tabular::Sheet::Sheet(), C4GUI::ScrollWindow::Update(), C4ScoreboardDlg::Update(), C4GUI::MultilineLabel::UpdateHeight(), C4ScriptGuiWindow::UpdateLayout(), C4ScriptGuiWindow::UpdateLayoutGrid(), C4ScriptGuiWindow::UpdateLayoutTightGrid(), C4ScriptGuiWindow::UpdateLayoutVertical(), C4GUI::Label::UpdateOwnPos(), C4GUI::Window::UpdateOwnPos(), C4GUI::Dialog::UpdatePos(), C4GUI::MultilineLabel::UpdateSize(), C4GUI::Dialog::UpdateSize(), and C4GUI::WoodenLabel::WoodenLabel().

◆ rcClientRect


The documentation for this class was generated from the following files: