OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
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 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
 
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 2584 of file C4Gui.h.

Constructor & Destructor Documentation

C4GUI::Screen::Screen ( )

Definition at line 570 of file C4Gui.cpp.

References pActiveDlg, and pScreen.

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

Definition at line 598 of file C4Gui.cpp.

References pScreen.

599  {
600  // clear singleton
601  if (this == pScreen) pScreen = nullptr;
602  }
static Screen * pScreen
Definition: C4Gui.h:2596

Member Function Documentation

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

Definition at line 2654 of file C4Gui.h.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 647 of file C4Gui.cpp.

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().

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 AbortContext(bool fByUser)
Definition: C4Gui.h:2654
bool IsExclusive()
Definition: C4Gui.h:2667
void ReleaseElements()
Definition: C4Gui.cpp:519
void MakeLastElement(Element *pChild)
CMouse Mouse
Definition: C4Gui.h:2587
Dialog * pActiveDlg
Definition: C4Gui.h:2590

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 118 of file C4GuiContainers.cpp.

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(), C4StartupMainDlg::C4StartupMainDlg(), 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(), C4GameLobby::ScenDesc::ScenDesc(), C4StartupScenSelDlg::ScenListItem::ScenListItem(), C4GUI::ScrollWindow::ScrollWindow(), C4GUI::InputDialog::SetCustomEdit(), C4GoalDisplay::SetGoals(), C4GUI::Dialog::SetTitle(), C4GUI::FullscreenDialog::SetTitle(), and C4GUI::TextWindow::TextWindow().

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 * pLast
Definition: C4Gui.h:750
Element * pFirst
Definition: C4Gui.h:750
Element * pPrev
Definition: C4Gui.h:377
Container * pParent
Definition: C4Gui.h:376
Element * pNext
Definition: C4Gui.h:377

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented in C4GUI::ListBox.

Definition at line 756 of file C4Gui.h.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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.

References C4Rect::x, and C4Rect::y.

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

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

Here is the caller graph for this function:

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.

References C4Rect::x, and C4Rect::y.

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

869  { 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

Here is the caller graph for this function:

Iterator C4GUI::Container::begin ( )
inlineinherited

Definition at line 824 of file C4Gui.h.

Referenced by C4ScriptGuiWindow::ClearPointers().

824 { return Iterator(pFirst); }
Element * pFirst
Definition: C4Gui.h:750

Here is the caller graph for this function:

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

Definition at line 779 of file C4Gui.cpp.

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

Referenced by C4FullScreen::CharIn(), and FullScreenWinProc().

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  }
bool HasKeyboardFocus()
Definition: C4Gui.h:2668
void ResetActiveInput()
Definition: C4Gui.h:2577
bool IsVisible()
Definition: C4Gui.cpp:201
bool IsExclusive()
Definition: C4Gui.h:2667
virtual bool CharIn(const char *c)
Definition: C4GuiMenu.cpp:453
ContextMenu * pContext
Definition: C4Gui.h:2591
CMouse Mouse
Definition: C4Gui.h:2587
Dialog * pActiveDlg
Definition: C4Gui.h:2590
virtual bool CharIn(const char *c)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented in C4StartupScenSelDlg::ScenListItem.

Definition at line 407 of file C4Gui.h.

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

407 { return false; }

Here is the caller graph for this function:

void C4GUI::Screen::Clear ( )

Definition at line 588 of file C4Gui.cpp.

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

Referenced by C4Game::Clear().

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

Here is the call graph for this function:

Here is the caller graph for this function:

void C4GUI::Container::ClearChildren ( )
inherited

Definition at line 68 of file C4GuiContainers.cpp.

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().

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  }
Element * pLast
Definition: C4Gui.h:750
Element * pFirst
Definition: C4Gui.h:750
Element * pPrev
Definition: C4Gui.h:377
Container * pParent
Definition: C4Gui.h:376
virtual bool IsOwnPtrElement()
Definition: C4Gui.h:401
Element * pNext
Definition: C4Gui.h:377

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 231 of file C4Gui.cpp.

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().

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  }
int32_t y
Definition: C4Rect.h:30
C4Rect rcBounds
Definition: C4Gui.h:385
Container * pParent
Definition: C4Gui.h:376
int32_t x
Definition: C4Rect.h:30
friend class Container
Definition: C4Gui.h:472
virtual void ApplyInvElementOffset(int32_t &riX, int32_t &riY)
Definition: C4Gui.h:841

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 704 of file C4Gui.cpp.

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

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

705  {
706  while (pActiveDlg) pActiveDlg->Close(fWithOK);
707  }
void Close(bool fOK)
Dialog * pActiveDlg
Definition: C4Gui.h:2590

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 663 of file C4Gui.cpp.

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().

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  }
Dialog * GetTopDialog()
Definition: C4Gui.cpp:692
void AbortContext(bool fByUser)
Definition: C4Gui.h:2654
void UpdateMouseFocus()
Definition: C4Gui.cpp:965
void ReleaseElements()
Definition: C4Gui.cpp:519
bool IsFading()
Definition: C4Gui.h:2151
C4GraphicsSystem GraphicsSystem
Definition: C4Globals.cpp:51
CMouse Mouse
Definition: C4Gui.h:2587
Dialog * pActiveDlg
Definition: C4Gui.h:2590

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4GUI::Element::DoContext ( )
inherited

Definition at line 417 of file C4Gui.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 971 of file C4Gui.cpp.

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

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

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  }
void AbortContext(bool fByUser)
Definition: C4Gui.h:2654
int32_t Wdt
Definition: C4Rect.h:30
ContextMenu * pContext
Definition: C4Gui.h:2591
C4Rect & GetBounds()
Definition: C4Gui.h:445
int32_t Hgt
Definition: C4Rect.h:30

Here is the call graph for this function:

Here is the caller graph for this function:

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.

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().

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 y
Definition: C4Rect.h:30
C4Rect rcBounds
Definition: C4Gui.h:385
int32_t x
Definition: C4Rect.h:30
Window * pDragTarget
Definition: C4Gui.h:378
virtual void UpdatePos()
Definition: C4Gui.cpp:193
int32_t iDragX
Definition: C4Gui.h:379

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from C4GUI::Container.

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

Definition at line 293 of file C4GuiContainers.cpp.

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().

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  }
void ApplyZoom(float &X, float &Y)
Definition: C4Draw.cpp:784
bool GetPrimaryClipper(int &rX1, int &rY1, int &rX2, int &rY2)
Definition: C4Draw.cpp:722
bool IsVisible()
Definition: C4Gui.cpp:201
virtual bool IsComponentOutsideClientArea()
Definition: C4Gui.h:870
Definition: C4Rect.h:27
C4Rect rcClientRect
Definition: C4Gui.h:851
int32_t Wdt
Definition: C4Rect.h:30
int32_t y
Definition: C4Rect.h:30
C4Rect & GetClientRect() override
Definition: C4Gui.h:864
C4Draw * pDraw
Definition: C4Draw.cpp:42
bool SetPrimaryClipper(int iX1, int iY1, int iX2, int iY2)
Definition: C4Draw.cpp:217
C4Rect & GetBounds()
Definition: C4Gui.h:445
int32_t x
Definition: C4Rect.h:30
float TargetX
Definition: C4Facet.h:165
virtual void DrawElement(C4TargetFacet &cgo)
Definition: C4Gui.h:388
int32_t Hgt
Definition: C4Rect.h:30
float TargetY
Definition: C4Facet.h:165
bool SubPrimaryClipper(int iX1, int iY1, int iX2, int iY2)
Definition: C4Draw.cpp:196
void Draw(C4TargetFacet &cgo) override

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 746 of file C4Gui.cpp.

References Application, C4GUI::Window::Draw(), C4GUI::ContextMenu::Draw(), C4Draw::DrawBoxDw(), C4Facet::DrawFullScreen(), C4LoaderScreen::fctBackground, 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.

Referenced by Render().

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  {
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  }
C4FacetSurface fctBackground
bool IsVisible()
Definition: C4Gui.cpp:201
friend class Dialog
Definition: C4Gui.h:2686
C4GraphicsResource GraphicsResource
C4GraphicsSystem GraphicsSystem
Definition: C4Globals.cpp:51
void DrawBoxDw(C4Surface *sfcDest, int iX1, int iY1, int iX2, int iY2, DWORD dwClr)
Definition: C4Draw.cpp:846
void RenderMouse(C4TargetFacet &cgo)
Definition: C4Gui.cpp:739
C4Draw * pDraw
Definition: C4Draw.cpp:42
void Draw(C4TargetFacet &cgo) override
Definition: C4GuiMenu.cpp:460
C4LoaderScreen * pLoaderScreen
ContextMenu * pContext
Definition: C4Gui.h:2591
void DrawFullScreen(C4Facet &cgo)
Definition: C4Facet.cpp:184
void Draw(C4TargetFacet &cgo) override
float Hgt
Definition: C4Facet.h:118
Dialog * GetFullscreenDialog(bool fIncludeFading)
Definition: C4Gui.cpp:1037
C4Surface * Surface
Definition: C4Facet.h:117
float Wdt
Definition: C4Facet.h:118
C4Application Application
Definition: C4Globals.cpp:44

Here is the call graph for this function:

Here is the caller graph for this function:

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.

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().

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
void DrawLineDw(C4Surface *sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr, float width=1.0f)
Definition: C4Draw.cpp:614
int32_t Wdt
Definition: C4Rect.h:30
#define C4GUI_BorderColor1
Definition: C4Gui.h:85
int32_t y
Definition: C4Rect.h:30
C4Rect rcBounds
Definition: C4Gui.h:385
C4Draw * pDraw
Definition: C4Draw.cpp:42
int32_t x
Definition: C4Rect.h:30
float TargetX
Definition: C4Facet.h:165
#define C4GUI_BorderColor3
Definition: C4Gui.h:87
int32_t Hgt
Definition: C4Rect.h:30
C4Surface * Surface
Definition: C4Facet.h:117
float TargetY
Definition: C4Facet.h:165
uint32_t DWORD

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 308 of file C4Gui.cpp.

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

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

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  }
int32_t Wdt
Definition: C4Rect.h:30
int32_t y
Definition: C4Rect.h:30
C4Rect rcBounds
Definition: C4Gui.h:385
int32_t x
Definition: C4Rect.h:30
float TargetX
Definition: C4Facet.h:165
int32_t Hgt
Definition: C4Rect.h:30
C4Surface * Surface
Definition: C4Facet.h:117
float TargetY
Definition: C4Facet.h:165

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 365 of file C4Gui.cpp.

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().

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 DrawHVBar(C4TargetFacet &cgo, DynBarFacet &rFacets, C4DrawTransform &trf, int32_t iMiddleLength)
Definition: C4Gui.cpp:375
int32_t Wdt
Definition: C4Rect.h:30
int32_t y
Definition: C4Rect.h:30
C4Rect rcBounds
Definition: C4Gui.h:385
int32_t x
Definition: C4Rect.h:30
float TargetX
Definition: C4Facet.h:165
void SetRotate(float iAngle, float fOffX, float fOffY)
int32_t Hgt
Definition: C4Rect.h:30
float TargetY
Definition: C4Facet.h:165

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 375 of file C4Gui.cpp.

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().

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
int32_t y
Definition: C4Rect.h:30
C4Rect rcBounds
Definition: C4Gui.h:385
int32_t x
Definition: C4Rect.h:30
float TargetX
Definition: C4Facet.h:165
C4Surface * Surface
Definition: C4Facet.h:117
float TargetY
Definition: C4Facet.h:165

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 1009 of file C4Gui.cpp.

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 C4MouseControl::Draw(), C4Menu::Draw(), and C4GUI::CMouse::Draw().

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  }
const char * getData() const
Definition: StdBuf.h:442
#define C4GUI_ToolTipColor
Definition: C4Gui.h:74
float Y
Definition: C4Facet.h:118
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:567
#define C4GUI_ToolTipFrameColor
Definition: C4Gui.h:73
bool GetTextExtent(const char *szText, int32_t &rsx, int32_t &rsy, bool fCheckMarkup=true)
#define C4GUI_ToolTipBGColor
Definition: C4Gui.h:72
C4GraphicsResource GraphicsResource
void DrawFrameDw(C4Surface *sfcDest, int x1, int y1, int x2, int y2, DWORD dwClr, float width=1.0f)
Definition: C4Draw.cpp:641
C4GraphicsSystem GraphicsSystem
Definition: C4Globals.cpp:51
void DrawBoxDw(C4Surface *sfcDest, int iX1, int iY1, int iX2, int iY2, DWORD dwClr)
Definition: C4Draw.cpp:846
C4Draw * pDraw
Definition: C4Draw.cpp:42
#define C4GUI_MaxToolTipWdt
Definition: C4Gui.h:140
std::tuple< std::string, int > BreakMessage(const char *szMsg, int iWdt, bool fCheckMarkup, float fZoom=1.0f)
float TargetX
Definition: C4Facet.h:165
float Hgt
Definition: C4Facet.h:118
const int ALeft
Definition: C4Surface.h:41
C4Surface * Surface
Definition: C4Facet.h:117
float TargetY
Definition: C4Facet.h:165
float Wdt
Definition: C4Facet.h:118
float X
Definition: C4Facet.h:118

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 359 of file C4Gui.cpp.

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

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

360  {
361  C4DrawTransform trf(1);
362  DrawHVBar(cgo, rFacets, trf, rcBounds.Hgt);
363  }
void DrawHVBar(C4TargetFacet &cgo, DynBarFacet &rFacets, C4DrawTransform &trf, int32_t iMiddleLength)
Definition: C4Gui.cpp:375
C4Rect rcBounds
Definition: C4Gui.h:385
int32_t Hgt
Definition: C4Rect.h:30

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from C4GUI::Container.

Definition at line 604 of file C4Gui.cpp.

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

605  {
606  // redraw fullscreen BG if dlgs are dragged around in shared mode
607  if (!IsExclusive())
609  }
bool IsExclusive()
Definition: C4Gui.h:2667
C4GraphicsSystem GraphicsSystem
Definition: C4Globals.cpp:51

Here is the call graph for this function:

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.

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().

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

Here is the caller graph for this function:

Iterator C4GUI::Container::end ( )
inlineinherited

Definition at line 825 of file C4Gui.h.

Referenced by C4ScriptGuiWindow::ClearPointers().

825 { return Iterator(nullptr); }

Here is the caller graph for this function:

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

Definition at line 445 of file C4Gui.h.

References C4GUI::Element::rcBounds.

Referenced by C4GUI::ListBox::AddElement(), C4Menu::AdjustPosition(), C4GameOverDlg::C4GameOverDlg(), 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(), C4Menu::UpdateElementPositions(), C4GUI::ListBox::UpdateElementPositions(), C4GUI::ScrollWindow::UpdateOwnPos(), C4Menu::UpdateScrollBar(), and C4GUI::TextWindow::UpdateSize().

445 { return rcBounds; }
C4Rect rcBounds
Definition: C4Gui.h:385

Here is the caller graph for this function:

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

Reimplemented from C4GUI::Element.

Definition at line 864 of file C4Gui.h.

References C4GUI::Window::rcClientRect.

Referenced by C4GameOverDlg::C4GameOverDlg(), C4LeagueSignupDialog::C4LeagueSignupDialog(), C4StartupMainDlg::C4StartupMainDlg(), 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().

864 { return rcClientRect; }
C4Rect rcClientRect
Definition: C4Gui.h:851

Here is the caller graph for this function:

C4Rect C4GUI::Element::GetContainedClientRect ( )
inlineinherited

Definition at line 448 of file C4Gui.h.

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

Referenced by C4GUI::Tabular::AddSheet(), C4ChartDialog::C4ChartDialog(), C4Network2ClientListDlg::C4Network2ClientListDlg(), C4Network2StartWaitDlg::C4Network2StartWaitDlg(), C4StartupAboutDlg::C4StartupAboutDlg(), 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(), C4StartupScenSelDlg::ScenListItem::UpdateOwnPos(), C4GUI::ScrollWindow::UpdateOwnPos(), C4ChatControl::UpdateSize(), C4ChatDlg::UpdateSize(), C4GUI::Tabular::UpdateSize(), and C4GUI::TextWindow::UpdateSize().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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
ContextHandler * C4GUI::Element::GetContextHandler ( )
virtualinherited

Reimplemented in C4GUI::Dialog.

Definition at line 429 of file C4Gui.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

int32_t C4GUI::Screen::GetContextMenuIndex ( )
inline

Definition at line 2655 of file C4Gui.h.

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

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

2655 { return pContext ? pContext->GetMenuIndex() : 0; } // get current context-menu (lowest level)
int32_t GetMenuIndex()
Definition: C4Gui.h:1883
ContextMenu * pContext
Definition: C4Gui.h:2591

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 720 of file C4Gui.cpp.

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

Referenced by DialogWinProc().

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  }
friend class Dialog
Definition: C4Gui.h:2686
Element * pLast
Definition: C4Gui.h:750
Element * GetPrev() const
Definition: C4Gui.h:450

Here is the call graph for this function:

Here is the caller graph for this function:

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
Dialog * C4GUI::Element::GetDlg ( )
virtualinherited

Reimplemented in C4GUI::Dialog.

Definition at line 288 of file C4Gui.cpp.

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().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 223 of file C4GuiContainers.cpp.

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

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

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  }
Element * pFirst
Definition: C4Gui.h:750
Element * pNext
Definition: C4Gui.h:377

Here is the caller graph for this function:

int32_t C4GUI::Container::GetElementCount ( )
inherited

Definition at line 232 of file C4GuiContainers.cpp.

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

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

233  {
234  int32_t cnt=0;
235  for (Element *pEl = pFirst; pEl; pEl=pEl->pNext) ++cnt;
236  return cnt;
237  }
Element * pFirst
Definition: C4Gui.h:750
Element * pNext
Definition: C4Gui.h:377

Here is the caller graph for this function:

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

Reimplemented from C4GUI::Element.

Definition at line 773 of file C4Gui.h.

References C4GUI::Container::pFirst.

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

773 { return pFirst; }
Element * pFirst
Definition: C4Gui.h:750

Here is the caller graph for this function:

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

Reimplemented from C4GUI::Element.

Definition at line 204 of file C4GuiContainers.cpp.

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

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

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  }
Element * pLast
Definition: C4Gui.h:750
Element * pFirst
Definition: C4Gui.h:750

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 1037 of file C4Gui.cpp.

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().

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  }
friend class Dialog
Definition: C4Gui.h:2686
Element * GetFirst()
Definition: C4Gui.h:829
Element * GetNext() const
Definition: C4Gui.h:449

Here is the call graph for this function:

Here is the caller graph for this function:

int32_t C4GUI::Element::GetHeight ( )
inlineinherited

Definition at line 444 of file C4Gui.h.

References C4Rect::Hgt.

Referenced by ShowDialog().

444 { return rcBounds.Hgt; }
C4Rect rcBounds
Definition: C4Gui.h:385
int32_t Hgt
Definition: C4Rect.h:30

Here is the caller graph for this function:

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

Definition at line 830 of file C4Gui.h.

References C4GUI::Container::pLast.

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

830 { return pLast; }
Element * pLast
Definition: C4Gui.h:750

Here is the caller graph for this function:

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

Definition at line 774 of file C4Gui.h.

References C4GUI::Container::pLast.

774 { return pLast; }
Element * pLast
Definition: C4Gui.h:750
int32_t C4GUI::Screen::GetLastContextMenuIndex ( )
inline

Definition at line 2656 of file C4Gui.h.

References C4GUI::ContextMenu::GetLastMenuIndex().

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented in C4StartupNetListEntry.

Definition at line 461 of file C4Gui.h.

References C4GUI_DefaultListSpacing.

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

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

Here is the caller graph for this function:

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

Definition at line 462 of file C4Gui.h.

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

462 { return false; }

Here is the caller graph for this function:

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

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

Definition at line 876 of file C4Gui.h.

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

876 { return 0; }

Here is the caller graph for this function:

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

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

Definition at line 874 of file C4Gui.h.

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

874 { return 0; }

Here is the caller graph for this function:

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

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

Definition at line 875 of file C4Gui.h.

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

875 { return 0; }

Here is the caller graph for this function:

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

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

Definition at line 873 of file C4Gui.h.

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

873 { return 0; }

Here is the caller graph for this function:

int32_t C4GUI::Screen::GetMouseControlledDialogCount ( )

Definition at line 999 of file C4Gui.cpp.

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

Referenced by MouseMove().

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  }
friend class Dialog
Definition: C4Gui.h:2686
int iResult
Definition: C4GroupMain.cpp:39
Element * GetFirst()
Definition: C4Gui.h:829
Element * GetNext() const
Definition: C4Gui.h:449

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 171 of file C4GuiContainers.cpp.

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().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 440 of file C4Gui.h.

References StdStrBuf::getData().

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

Here is the call graph for this function:

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

Definition at line 2600 of file C4Gui.h.

References PreferredDlgRect.

Referenced by C4ScoreboardDlg::Update().

2600 { return PreferredDlgRect; }
C4Rect PreferredDlgRect
Definition: C4Gui.h:2593

Here is the caller graph for this function:

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

Definition at line 450 of file C4Gui.h.

References C4GUI::Element::pPrev.

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

450 { return pPrev; }
Element * pPrev
Definition: C4Gui.h:377

Here is the caller graph for this function:

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

Reimplemented from C4GUI::Element.

Definition at line 2625 of file C4Gui.h.

2625 { return this; }; // return contained screen
static Screen* C4GUI::Screen::GetScreenS ( )
inlinestatic

Definition at line 2626 of file C4Gui.h.

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().

2626 { return pScreen; } // get global screen
static Screen * pScreen
Definition: C4Gui.h:2596

Here is the caller graph for this function:

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

Definition at line 423 of file C4Gui.cpp.

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().

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

Here is the call graph for this function:

Here is the caller graph for this function:

Dialog * C4GUI::Screen::GetTopDialog ( )

Definition at line 692 of file C4Gui.cpp.

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

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

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  }
friend class Dialog
Definition: C4Gui.h:2686
Element * pLast
Definition: C4Gui.h:750
Element * GetPrev() const
Definition: C4Gui.h:450

Here is the call graph for this function:

Here is the caller graph for this function:

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.

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

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

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
Definition: C4Rect.h:27
C4Rect GetContainedClientRect()
Definition: C4Gui.h:448
int32_t Wdt
Definition: C4Rect.h:30
int32_t y
Definition: C4Rect.h:30
int32_t x
Definition: C4Rect.h:30
virtual C4Rect & GetClientRect()
Definition: C4Gui.h:447
int32_t Hgt
Definition: C4Rect.h:30

Here is the call graph for this function:

Here is the caller graph for this function:

int32_t C4GUI::Element::GetWidth ( )
inlineinherited

Definition at line 443 of file C4Gui.h.

References C4Rect::Wdt.

Referenced by ShowDialog().

443 { return rcBounds.Wdt; }
int32_t Wdt
Definition: C4Rect.h:30
C4Rect rcBounds
Definition: C4Gui.h:385

Here is the caller graph for this function:

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

Definition at line 2628 of file C4Gui.h.

References fZoom.

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

2628 { return fZoom; }; // get GUI zoom
float fZoom
Definition: C4Gui.h:2594

Here is the caller graph for this function:

bool C4GUI::Screen::HasContext ( )
inline

Definition at line 2657 of file C4Gui.h.

References pContext.

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

2657 { return !!pContext; }
ContextMenu * pContext
Definition: C4Gui.h:2591

Here is the caller graph for this function:

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

Definition at line 1032 of file C4Gui.cpp.

References GetFullscreenDialog().

Referenced by C4GraphicsSystem::Execute().

1033  {
1034  return !!GetFullscreenDialog(fIncludeFading);
1035  }
Dialog * GetFullscreenDialog(bool fIncludeFading)
Definition: C4Gui.cpp:1037

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4GUI::Screen::HasKeyboardFocus ( )
inline

Definition at line 2668 of file C4Gui.h.

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

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

2669  {
2670  // always hook keyboard in exclusive mode; only on exclusive top dialogs in shared mode
2671  if (IsExclusive()) return true;
2672  Dialog *pDlg = GetTopDialog();
2673  return pDlg && pDlg->IsExclusiveDialog();
2674  }
Dialog * GetTopDialog()
Definition: C4Gui.cpp:692
friend class Dialog
Definition: C4Gui.h:2686
bool IsExclusive()
Definition: C4Gui.h:2667

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4GUI::Screen::HasMouseFocus ( )
inline

Definition at line 2675 of file C4Gui.h.

References HasKeyboardFocus().

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

2676  { return HasKeyboardFocus(); }
bool HasKeyboardFocus()
Definition: C4Gui.h:2668

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 578 of file C4Gui.cpp.

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

Referenced by C4Game::PreInit().

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  }
float fZoom
Definition: C4Gui.h:2594
int32_t y
Definition: C4Gui.h:2532
Definition: C4Rect.h:27
void SetPreferredDlgRect(const C4Rect &rtNewPref)
Definition: C4Gui.h:2648
void SetBounds(const C4Rect &rcNewBound)
Definition: C4Gui.h:446
int32_t x
Definition: C4Gui.h:2532
CMouse Mouse
Definition: C4Gui.h:2587

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 150 of file C4GuiContainers.cpp.

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().

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  }
Element * pFirst
Definition: C4Gui.h:750
void AddElement(Element *pChild)
Element * pPrev
Definition: C4Gui.h:377
Container * pParent
Definition: C4Gui.h:376
Element * pNext
Definition: C4Gui.h:377

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4GUI::Screen::IsActive ( )
inline

Definition at line 2630 of file C4Gui.h.

References GetTopDialog().

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

2630 { return !!GetTopDialog(); } // return whether GUI is active
Dialog * GetTopDialog()
Definition: C4Gui.cpp:692

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Definition at line 870 of file C4Gui.h.

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

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

Here is the caller graph for this function:

bool C4GUI::Screen::IsExclusive ( )
inline

Definition at line 2667 of file C4Gui.h.

References fExclusive.

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

2667 { return fExclusive; }
bool fExclusive
Definition: C4Gui.h:2592

Here is the caller graph for this function:

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

Reimplemented in C4GUI::Dialog, and C4Menu.

Definition at line 402 of file C4Gui.h.

402 { return false; }
virtual bool C4GUI::Container::IsFocused ( Control pCtrl)
inlinevirtualinherited

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

Definition at line 836 of file C4Gui.h.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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.

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

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

Here is the caller graph for this function:

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

Definition at line 441 of file C4Gui.h.

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

441 { return is_immediate_tooltip; }

Here is the caller graph for this function:

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

Definition at line 435 of file C4Gui.cpp.

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().

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  }
virtual class Dialog * GetDlg()
Definition: C4Gui.cpp:288

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Definition at line 403 of file C4Gui.h.

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

403 { return false; }

Here is the caller graph for this function:

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

Reimplemented in C4Menu.

Definition at line 401 of file C4Gui.h.

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

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

Here is the caller graph for this function:

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

Reimplemented from C4GUI::Element.

Definition at line 239 of file C4GuiContainers.cpp.

References C4GUI::Element::GetParent().

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

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  }

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Definition at line 837 of file C4Gui.h.

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

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

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
Container * pParent
Definition: C4Gui.h:376

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4GUI::Element::IsVisible ( )
inherited

Definition at line 201 of file C4Gui.cpp.

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

Referenced by C4GUI::Dialog::AdvanceFocus(), CharIn(), C4GUI::ControlKeyDlgCB< TargetClass >::CheckCondition(), C4ScriptGuiWindow::Draw(), C4GUI::Container::Draw(), C4GUI::Window::Draw(), 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().

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4GUI::Screen::KeyAny ( )

Definition at line 771 of file C4Gui.cpp.

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

Referenced by C4Game::DoKeyboardInput().

772  {
773  // mark keystroke in mouse
775  // key not yet processed
776  return false;
777  }
void ResetActiveInput()
Definition: C4Gui.h:2577
CMouse Mouse
Definition: C4Gui.h:2587

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 106 of file C4GuiContainers.cpp.

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

Referenced by ActivateDialog().

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  }
Element * pLast
Definition: C4Gui.h:750
Element * pFirst
Definition: C4Gui.h:750
Element * pPrev
Definition: C4Gui.h:377
Element * pNext
Definition: C4Gui.h:377

Here is the caller graph for this function:

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

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

Definition at line 413 of file C4Gui.h.

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

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

Here is the caller graph for this function:

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.

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, C4Rect::x, C4GUI::CMouse::x, and C4Rect::y.

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

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  }
bool IsVisible()
Definition: C4Gui.cpp:201
Element * pLast
Definition: C4Gui.h:750
Definition: C4Rect.h:27
C4Rect rcClientRect
Definition: C4Gui.h:851
int32_t y
Definition: C4Rect.h:30
C4Rect rcBounds
Definition: C4Gui.h:385
C4Rect & GetClientRect() override
Definition: C4Gui.h:864
virtual void MouseInput(CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam)
Definition: C4Gui.cpp:244
C4Rect & GetBounds()
Definition: C4Gui.h:445
int32_t x
Definition: C4Rect.h:30
Element * GetPrev() const
Definition: C4Gui.h:450

Here is the call graph for this function:

Here is the caller graph for this function:

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.

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.

Referenced by DialogWinProc(), MouseMove(), and RecheckMouseInput().

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  }
bool Contains(int32_t iX, int32_t iY) const
Definition: C4Rect.h:40
const int32_t C4MC_Button_LeftDown
void AbortContext(bool fByUser)
Definition: C4Gui.h:2654
Element * pDragElement
Definition: C4Gui.h:2553
float fZoom
Definition: C4Gui.h:2594
bool IsVisible()
Definition: C4Gui.cpp:201
friend class Dialog
Definition: C4Gui.h:2686
void MouseInput(CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam) override
Element * pLast
Definition: C4Gui.h:750
Definition: C4Rect.h:27
virtual void StopDragging(CMouse &rMouse, int32_t iX, int32_t iY, DWORD dwKeyParam)
Definition: C4Gui.cpp:282
bool IsExclusive()
Definition: C4Gui.h:2667
bool IsLDown()
Definition: C4Gui.h:2562
bool IsFading()
Definition: C4Gui.h:2151
int32_t y
Definition: C4Rect.h:30
Element * pPrevMouseOverElement
Definition: C4Gui.h:2552
C4Rect rcBounds
Definition: C4Gui.h:385
C4Rect & GetClientRect() override
Definition: C4Gui.h:864
C4Rect GetOutputRect()
Definition: C4Viewport.h:64
float GetZoom() const
Definition: C4Gui.h:2628
ContextMenu * pContext
Definition: C4Gui.h:2591
C4Rect & GetBounds()
Definition: C4Gui.h:445
const int32_t C4MC_Button_RightDown
virtual class Dialog * GetDlg()
Definition: C4Gui.cpp:288
int32_t x
Definition: C4Rect.h:30
void Input(int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam)
Definition: C4Gui.cpp:463
void MouseInput(CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam) override
void ScreenPos2ClientPos(int32_t &riX, int32_t &riY)
Definition: C4Gui.cpp:218
Element * GetPrev() const
Definition: C4Gui.h:450
virtual void DoDragging(CMouse &rMouse, int32_t iX, int32_t iY, DWORD dwKeyParam)
Definition: C4Gui.cpp:269
CMouse Mouse
Definition: C4Gui.h:2587
Dialog * pActiveDlg
Definition: C4Gui.h:2590
Element * pMouseOverElement
Definition: C4Gui.h:2552
bool CtxMouseInput(CMouse &rMouse, int32_t iButton, int32_t iScreenX, int32_t iScreenY, DWORD dwKeyParam)
Definition: C4GuiMenu.cpp:441
virtual void MouseEnter(CMouse &rMouse)
Definition: C4Gui.h:413
virtual void MouseLeave(CMouse &rMouse)
Definition: C4Gui.h:414
void ActivateDialog(Dialog *pDlg)
Definition: C4Gui.cpp:647

Here is the call graph for this function:

Here is the caller graph for this function:

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.

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().

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

Here is the caller graph for this function:

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.

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

Referenced by C4GUI::MouseMove().

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  }
void MouseMoveToViewport(int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam)
bool IsActive()
Definition: C4Gui.h:2630
C4MouseControl MouseControl
Definition: C4Globals.cpp:47
bool MouseInput(int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam, Dialog *pDlg, class C4Viewport *pVP)
Definition: C4Gui.cpp:837
int32_t GetMouseControlledDialogCount()
Definition: C4Gui.cpp:999
C4ViewportList Viewports
Definition: C4Viewport.cpp:841
bool HasMouseFocus()
Definition: C4Gui.h:2675
void SetMouseInGUI(bool fInGUI, bool fByMouse)
Definition: C4Gui.cpp:824

Here is the call graph for this function:

Here is the caller graph for this function:

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.

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

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  }
bool IsVisible()
Definition: C4Gui.cpp:201
Element * pFirst
Definition: C4Gui.h:750
Element * pNext
Definition: C4Gui.h:377

Here is the call graph for this function:

void C4GUI::Screen::OnSec1Timer ( )
ReverseIterator C4GUI::Container::rbegin ( )
inlineinherited

Definition at line 826 of file C4Gui.h.

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

826 { return ReverseIterator(pLast); }
Element * pLast
Definition: C4Gui.h:750

Here is the caller graph for this function:

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

Definition at line 134 of file C4GuiContainers.cpp.

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

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

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  }
Element * pLast
Definition: C4Gui.h:750
Element * pFirst
Definition: C4Gui.h:750
Element * pPrev
Definition: C4Gui.h:377
Element * pNext
Definition: C4Gui.h:377

Here is the caller graph for this function:

void C4GUI::Screen::RecheckActiveDialog ( )

Definition at line 683 of file C4Gui.cpp.

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

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

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  }
Dialog * GetTopDialog()
Definition: C4Gui.cpp:692
friend class Dialog
Definition: C4Gui.h:2686
void ReleaseElements()
Definition: C4Gui.cpp:519
bool IsFading()
Definition: C4Gui.h:2151
CMouse Mouse
Definition: C4Gui.h:2587
Dialog * pActiveDlg
Definition: C4Gui.h:2590

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4GUI::Screen::RecheckMouseInput ( )

Definition at line 960 of file C4Gui.cpp.

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

961  {
962  return MouseInput(C4MC_Button_None, Mouse.x, Mouse.y, Mouse.dwKeys, nullptr, nullptr);
963  }
int32_t y
Definition: C4Gui.h:2532
bool MouseInput(int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam, Dialog *pDlg, class C4Viewport *pVP)
Definition: C4Gui.cpp:837
DWORD dwKeys
Definition: C4Gui.h:2535
const int32_t C4MC_Button_None
int32_t x
Definition: C4Gui.h:2532
CMouse Mouse
Definition: C4Gui.h:2587

Here is the call graph for this function:

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

Reimplemented from C4GUI::Container.

Definition at line 556 of file C4Gui.cpp.

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

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

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  }
ContextMenu * pContext
Definition: C4Gui.h:2591
void RemoveElement(Element *pChild) override
void ResetElements()
Definition: C4Gui.h:2566
void RemoveElement(Element *pChild) override
Definition: C4GuiMenu.cpp:364
void RemoveElement(Element *pChild)
Definition: C4Gui.cpp:534
CMouse Mouse
Definition: C4Gui.h:2587
Dialog * pActiveDlg
Definition: C4Gui.h:2590

Here is the call graph for this function:

Here is the caller graph for this function:

ReverseIterator C4GUI::Container::rend ( )
inlineinherited

Definition at line 827 of file C4Gui.h.

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

827 { return ReverseIterator(nullptr); }

Here is the caller graph for this function:

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

Definition at line 730 of file C4Gui.cpp.

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

Referenced by C4GraphicsSystem::Execute().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 739 of file C4Gui.cpp.

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().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 218 of file C4Gui.cpp.

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().

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  }
int32_t y
Definition: C4Rect.h:30
virtual void ApplyElementOffset(int32_t &riX, int32_t &riY)
Definition: C4Gui.h:840
C4Rect rcBounds
Definition: C4Gui.h:385
Container * pParent
Definition: C4Gui.h:376
int32_t x
Definition: C4Rect.h:30
friend class Container
Definition: C4Gui.h:472

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 446 of file C4Gui.h.

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

Referenced by C4GameOptionButtons::C4GameOptionButtons(), C4GoalDisplay::C4GoalDisplay(), 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(), 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(), C4Menu::UpdateElementPositions(), C4GUI::ListBox::UpdateElementPositions(), C4GUI::ScrollWindow::UpdateOwnPos(), C4ChatControl::UpdateSize(), C4ChatDlg::UpdateSize(), C4GUI::TextWindow::UpdateSize(), and C4GUI::Dialog::UpdateSize().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 465 of file C4Gui.h.

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

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

466  {
468  if ((pContextHandler = pNewHd)) pNewHd->Ref();
469  }
ContextHandler * pContextHandler
Definition: C4Gui.h:381

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 464 of file C4Gui.h.

References C4GUI::Element::pDragTarget.

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

464 { pDragTarget = pToWindow; }
Window * pDragTarget
Definition: C4Gui.h:378

Here is the caller graph for this function:

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

Definition at line 2666 of file C4Gui.h.

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

Referenced by C4Game::Init().

void UpdateMouseFocus()
Definition: C4Gui.cpp:965
void SetOwnedMouse(bool fToVal)
Definition: C4Gui.h:2573
CMouse Mouse
Definition: C4Gui.h:2587
bool fExclusive
Definition: C4Gui.h:2592

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 824 of file C4Gui.cpp.

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

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

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  }
int32_t y
Definition: C4Gui.h:2532
void MouseMoveToViewport(int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam)
C4MouseControl MouseControl
Definition: C4Globals.cpp:47
void SetOwnedMouse(bool fToVal)
float GetZoom()
Definition: C4Gui.h:2828
C4GUIScreen * pGUI
Definition: C4Gui.cpp:1191
DWORD dwKeys
Definition: C4Gui.h:2535
void SetOwnedMouse(bool fToVal)
Definition: C4Gui.h:2573
C4ViewportList Viewports
Definition: C4Viewport.cpp:841
const int32_t C4MC_Button_None
int32_t x
Definition: C4Gui.h:2532
CMouse Mouse
Definition: C4Gui.h:2587

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 860 of file C4Gui.h.

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().

861  { rcBounds.x=iXPos; rcBounds.y=iYPos; UpdatePos(); }
int32_t y
Definition: C4Rect.h:30
C4Rect rcBounds
Definition: C4Gui.h:385
int32_t x
Definition: C4Rect.h:30
virtual void UpdatePos()
Definition: C4Gui.cpp:193

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 2648 of file C4Gui.h.

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

2648 { PreferredDlgRect = rtNewPref; }
C4Rect PreferredDlgRect
Definition: C4Gui.h:2593

Here is the caller graph for this function:

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

Definition at line 409 of file C4Gui.cpp.

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

Referenced by C4GUI::ContextMenu::AddItem(), C4LeagueSignupDialog::C4LeagueSignupDialog(), C4MenuItem::C4MenuItem(), C4StartupMainDlg::C4StartupMainDlg(), C4StartupNetDlg::C4StartupNetDlg(), C4StartupOptionsDlg::C4StartupOptionsDlg(), C4StartupPlrPropertiesDlg::C4StartupPlrPropertiesDlg(), C4StartupPlrSelDlg::C4StartupPlrSelDlg(), C4StartupScenSelDlg::C4StartupScenSelDlg(), 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::Dialog::SetTitle(), C4GUI::FullscreenDialog::SetTitle(), C4ChatControl::ChatSheet::NickItem::Update(), and C4GameLobby::MainDlg::UpdateRightTab().

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 Clear()
Definition: StdBuf.h:466
void Copy()
Definition: StdBuf.h:467

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from C4GUI::Element.

Reimplemented in C4StartupNetListEntry.

Definition at line 247 of file C4GuiContainers.cpp.

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(), C4StartupNetDlg::C4StartupNetDlg(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4Menu::Draw(), C4Menu::InitLocation(), and C4StartupNetListEntry::SetVisibility().

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  }
bool IsParentOf(Element *pEl) override
virtual void SetVisibility(bool fToValue)
Definition: C4Gui.cpp:207
C4GameControl Control
virtual class Dialog * GetDlg()
Definition: C4Gui.cpp:288

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 611 of file C4Gui.cpp.

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().

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 UpdateMouseFocus()
Definition: C4Gui.cpp:965
friend class Dialog
Definition: C4Gui.h:2686
bool fOK
Definition: C4Gui.h:2082
bool IsExclusive()
Definition: C4Gui.h:2667
int32_t GetHeight()
Definition: C4Gui.h:444
int32_t y
Definition: C4Rect.h:30
Element * GetFirst()
Definition: C4Gui.h:829
void InsertElement(Element *pChild, Element *pInsertBefore)
int32_t GetWidth()
Definition: C4Gui.h:443
int32_t x
Definition: C4Rect.h:30
Element * GetNext() const
Definition: C4Gui.h:449
C4Rect PreferredDlgRect
Definition: C4Gui.h:2593
Dialog * pActiveDlg
Definition: C4Gui.h:2590
C4Application Application
Definition: C4Globals.cpp:44

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 1040 of file C4GuiDialogs.cpp.

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

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

1041  {
1042  return ShowMessage(szMessage, LoadResStr("IDS_DLG_ERROR"), Ico_Error);
1043  }
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
bool ShowMessage(const char *szMessage, const char *szCaption, Icons icoIcon, int32_t *piConfigDontShowAgainSetting=nullptr)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 1028 of file C4GuiDialogs.cpp.

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().

1029  {
1030  // always log messages
1031  LogSilentF("[Msg] %s: %s", szCaption, szMessage);
1032  if (piConfigDontShowAgainSetting && *piConfigDontShowAgainSetting) return true;
1033 #ifdef USE_CONSOLE
1034  // skip in console mode
1035  return true;
1036 #endif
1037  return ShowRemoveDlg(new MessageDialog(szMessage, szCaption, MessageDialog::btnOK, icoIcon, MessageDialog::dsRegular, piConfigDontShowAgainSetting));
1038  }
bool ShowRemoveDlg(Dialog *pDlg)
bool LogSilentF(const char *strMessage,...)
Definition: C4Log.cpp:260

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 1045 of file C4GuiDialogs.cpp.

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

Referenced by C4StartupScenSelDlg::DeleteConfirm(), C4StartupNetDlg::DoOK(), C4StartupScenSelDlg::DoOK(), C4StartupNetDlg::DoRefresh(), C4DownloadDlg::DownloadFile(), C4Network2::InitLeague(), C4Network2::LeagueEnd(), C4Network2::LeaguePlrAuth(), C4Network2::LeagueStart(), C4ChatControl::OnConnectBtn(), C4ScenarioListLoader::Entry::RenameTo(), C4PlayerInfoList::RestoreSavegameInfos(), C4ScenarioListLoader::Entry::SetTitleInGroup(), C4LeagueSignupDialog::UserClose(), and C4ChatControl::UserQueryQuit().

1046  {
1047  // always log messages
1048  LogSilentF("[Modal] %s: %s", szCaption, szMessage);
1049  // skip if user doesn't want to see it
1050  if (piConfigDontShowAgainSetting && *piConfigDontShowAgainSetting) return true;
1051  // create message dlg and show modal
1052  return ShowModalDlg(new MessageDialog(szMessage, szCaption, dwButtons, icoIcon, MessageDialog::dsRegular, piConfigDontShowAgainSetting));
1053  }
bool LogSilentF(const char *strMessage,...)
Definition: C4Log.cpp:260
bool ShowModalDlg(Dialog *pDlg, bool fDestruct=true)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 1065 of file C4GuiDialogs.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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 1055 of file C4GuiDialogs.cpp.

References C4GUI::Dialog::Show().

1056  {
1057  // create progress dlg
1058  ProgressDialog *pDlg = new ProgressDialog(szMessage, szCaption, iMaxProgress, iInitialProgress, icoIcon);
1059  // show it
1060  if (!pDlg->Show(this, true)) { delete pDlg; return nullptr; }
1061  // return dlg pointer
1062  return pDlg;
1063  }

Here is the call graph for this function:

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

Definition at line 1084 of file C4GuiDialogs.cpp.

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().

1085  {
1086  // safety
1087  if (!pDlg) return false;
1088  // mark removal when done
1089  pDlg->SetDelOnClose();
1090  // show it
1091  if (!pDlg->Show(this, true)) { delete pDlg; return false; }
1092  // done, success
1093  return true;
1094  }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 259 of file C4Gui.cpp.

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

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

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  }
int32_t iDragY
Definition: C4Gui.h:379
bool fDragging
Definition: C4Gui.h:380
int32_t iDragX
Definition: C4Gui.h:379

Here is the caller graph for this function:

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

Definition at line 282 of file C4Gui.cpp.

References C4GUI::Element::DoDragging().

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

283  {
284  // move element pos
285  DoDragging(rMouse, iX, iY, dwKeyParam);
286  }
virtual void DoDragging(CMouse &rMouse, int32_t iX, int32_t iY, DWORD dwKeyParam)
Definition: C4Gui.cpp:269

Here is the call graph for this function:

Here is the caller graph for this function:

void C4GUI::Screen::UpdateGamepadGUIControlEnabled ( )

Definition at line 1049 of file C4Gui.cpp.

1050  {
1051  // Gamepad is always kept open now.
1052  }
void C4GUI::Screen::UpdateMouseFocus ( )

Definition at line 965 of file C4Gui.cpp.

References MouseControl, and C4MouseControl::UpdateClip().

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

966  {
967  // when exclusive mode has changed: Make sure mouse clip is correct
969  }
C4MouseControl MouseControl
Definition: C4Globals.cpp:47

Here is the call graph for this function:

Here is the caller graph for this function:

void C4GUI::Window::UpdateOwnPos ( )
overridevirtualinherited

Reimplemented from C4GUI::Element.

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

Definition at line 324 of file C4GuiContainers.cpp.

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().

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  }
C4Rect rcClientRect
Definition: C4Gui.h:851
virtual int32_t GetMarginTop()
Definition: C4Gui.h:873
int32_t Wdt
Definition: C4Rect.h:30
int32_t y
Definition: C4Rect.h:30
C4Rect rcBounds
Definition: C4Gui.h:385
virtual int32_t GetMarginRight()
Definition: C4Gui.h:875
virtual int32_t GetMarginLeft()
Definition: C4Gui.h:874
int32_t x
Definition: C4Rect.h:30
void Set(int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt)
Definition: C4Rect.cpp:86
virtual void UpdateOwnPos()
Definition: C4Gui.h:434
int32_t Hgt
Definition: C4Rect.h:30
virtual int32_t GetMarginBottom()
Definition: C4Gui.h:876

Here is the call graph for this function:

Here is the caller graph for this function:

void C4GUI::Element::UpdatePos ( )
protectedvirtualinherited

Reimplemented in C4GUI::Dialog.

Definition at line 193 of file C4Gui.cpp.

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().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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.

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().

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
Container * pParent
Definition: C4Gui.h:376
virtual void UpdateOwnPos()
Definition: C4Gui.h:434

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class ContextMenu
friend

Definition at line 2686 of file C4Gui.h.

friend class Dialog
friend

Definition at line 2686 of file C4Gui.h.

Member Data Documentation

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

Definition at line 380 of file C4Gui.h.

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

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

Definition at line 2592 of file C4Gui.h.

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

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

Definition at line 2594 of file C4Gui.h.

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

int32_t C4GUI::Element::iDragX
protectedinherited

Definition at line 379 of file C4Gui.h.

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

int32_t C4GUI::Element::iDragY
protectedinherited

Definition at line 379 of file C4Gui.h.

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

ContextMenu* C4GUI::Screen::pContext {nullptr}
protected
ContextHandler* C4GUI::Element::pContextHandler {nullptr}
protectedinherited
Window* C4GUI::Element::pDragTarget {nullptr}
protectedinherited
C4Rect C4GUI::Screen::PreferredDlgRect
protected

Definition at line 2593 of file C4Gui.h.

Referenced by GetPreferredDlgRect(), and ShowDialog().

Screen * C4GUI::Screen::pScreen
staticprotected

Definition at line 2596 of file C4Gui.h.

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

C4Rect C4GUI::Element::rcBounds
protectedinherited

Definition at line 385 of file C4Gui.h.

Referenced by C4Chart::C4Chart(), C4StartupMainDlg::C4StartupMainDlg(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4GUI::Element::ClientPos2ScreenPos(), C4GUI::ContextMenu::ContextMenu(), C4GUI::Dialog::CreateConsoleWindow(), C4GUI::ContextMenu::CtxMouseInput(), C4FileSelDlg::DefaultListItem::DefaultListItem(), C4GUI::Element::DoContext(), C4GUI::Element::DoDragging(), C4ScoreboardDlg::DoPlacement(), C4ScriptGuiWindow::Draw(), C4GUI::Element::Draw3DFrame(), C4GUI::Element::DrawBar(), C4ScriptGuiWindow::DrawChildren(), C4StartupMainDlg::DrawElement(), C4MenuItem::DrawElement(), C4StartupNetListEntry::DrawElement(), C4Chart::DrawElement(), C4StartupPlrPropertiesDlg::DrawElement(), C4Menu::DrawElement(), 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::Element::DrawHBarByVGfx(), C4GUI::Element::DrawHVBar(), C4GUI::Element::DrawVBar(), C4GUI::Element::Element(), C4GUI::ContextMenu::Entry::Entry(), C4GUI::Element::GetBounds(), C4GUI::Element::GetClientRect(), C4ScriptGuiWindow::GetClippingRect(), C4GUI::WoodenLabel::GetLeftIndent(), C4GUI::Tabular::GetMarginBottom(), C4GUI::Tabular::GetMarginLeft(), C4GUI::Tabular::GetMarginRight(), C4StartupPlrSelDlg::GetMarginTop(), C4StartupScenSelDlg::GetMarginTop(), C4GUI::Tabular::GetMarginTop(), C4GUI::ScrollBar::HasPin(), C4Menu::InitLocation(), C4Menu::InitSize(), C4GUI::ScrollWindow::IsScrollingNecessary(), C4GUI::Label::Label(), C4ScriptGuiWindow::MouseInput(), C4GUI::Window::MouseInput(), C4GUI::CheckBox::MouseInput(), C4GUI::Tabular::MouseInput(), C4GUI::ContextMenu::MouseInput(), MouseInput(), C4GUI::MultilineLabel::MultilineLabel(), C4ChatControl::ChatSheet::NickItem::NickItem(), C4ScriptGuiWindow::OnMouseIn(), C4GUI::ContextMenu::Open(), C4GUI::Picture::Picture(), C4ScriptGuiWindow::ProcessMouseInput(), C4GUI::ProgressBar::ProgressBar(), Render(), C4GUI::Element::ScreenPos2ClientPos(), C4GUI::ScrollBar::ScrollBar(), C4GUI::Tabular::SetGfx(), C4GUI::Window::SetPos(), C4GUI::Label::SetText(), C4GUI::Label::SetX0(), C4ScoreboardDlg::Update(), C4GUI::ScrollWindow::Update(), C4GUI::MultilineLabel::UpdateHeight(), C4ScriptGuiWindow::UpdateLayout(), C4ScriptGuiWindow::UpdateLayoutGrid(), C4ScriptGuiWindow::UpdateLayoutTightGrid(), C4ScriptGuiWindow::UpdateLayoutVertical(), C4GUI::Label::UpdateOwnPos(), C4GUI::Window::UpdateOwnPos(), C4GUI::MultilineLabel::UpdateSize(), and C4GUI::WoodenLabel::WoodenLabel().


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