OpenClonk
C4GUI::ListBox Class Reference

#include <C4Gui.h>

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

Public Types

typedef int32_t(* SortFunction) (const Element *pEl1, const Element *pEl2, void *par)
 

Public Member Functions

 ListBox (const C4Rect &rtBounds, int32_t iMultiColItemWidth=0)
 
 ~ListBox () override
 
void MouseInput (CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam) override
 
void RemoveElement (Element *pChild) override
 
bool AddElement (Element *pChild, int32_t iIndent=0)
 
bool InsertElement (Element *pChild, Element *pInsertBefore, int32_t iIndent=0)
 
void ElementSizeChanged (Element *pOfElement) override
 
void ElementPosChanged (Element *pOfElement) override
 
int32_t GetItemWidth ()
 
void SelectionChanged (bool fByUser)
 
void SetSelectionChangeCallbackFn (BaseCallbackHandler *pToHandler)
 
void SetSelectionDblClickFn (BaseCallbackHandler *pToHandler)
 
void ScrollToBottom ()
 
void ScrollItemInView (Element *pItem)
 
void FreezeScrolling ()
 
void UnFreezeScrolling ()
 
void SetDecoration (bool fDrawBG, ScrollBarFacets *pToGfx, bool fAutoScroll, bool fDrawBorder=false)
 
void SetSelectionDiabled (bool fToVal=true)
 
ElementGetFirst ()
 
ElementGetLast ()
 
int32_t GetMarginTop () override
 
int32_t GetMarginLeft () override
 
int32_t GetMarginRight () override
 
int32_t GetMarginBottom () override
 
ElementGetSelectedItem ()
 
bool IsScrollingActive ()
 
bool IsScrollingNecessary ()
 
void SelectEntry (Element *pNewSel, bool fByUser)
 
void SelectFirstEntry (bool fByUser)
 
void SelectNone (bool fByUser)
 
bool IsMultiColumn () const
 
int32_t ContractToElementHeight ()
 
void UpdateElementPositions ()
 
void UpdateElementPosition (Element *pOfElement, int32_t iIndent)
 
void UpdateSize () override
 
bool IsSelectedChild (Element *pChild) override
 
void SortElements (SortFunction SortFunc, void *par)
 
bool HasFocus ()
 
bool HasDrawFocus ()
 
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 ()
 
void Clear ()
 
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 ()
 
ContainerGetContainer () override
 
ElementGetElementByIndex (int32_t i)
 
int32_t GetElementCount ()
 
void SetVisibility (bool fToValue) override
 
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 ScreenGetScreen ()
 
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 ()
 

Public Attributes

bool fVisible {true}
 

Protected Member Functions

void DrawElement (C4TargetFacet &cgo) override
 
bool IsFocused (Control *pCtrl) override
 
bool IsFocusOnClick () override
 
ControlIsFocusElement () override
 
void OnGetFocus (bool fByMouse) override
 
bool CharIn (const char *c) override
 
void AfterElementRemoval () override
 
void UpdateColumnCount ()
 
void DisableFocus ()
 
virtual void OnLooseFocus ()
 
void Draw (C4TargetFacet &cgo) override
 
bool OnHotkey (uint32_t cHotkey) override
 
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

int32_t iMultiColItemWidth
 
int32_t iColCount
 
ScrollWindowpClientWindow
 
ElementpSelectedItem
 
BaseCallbackHandlerpSelectionChangeHandler
 
BaseCallbackHandlerpSelectionDblClickHandler
 
bool fDrawBackground
 
bool fDrawBorder
 
bool fSelectionDisabled
 
C4Rect rcClientRect
 
ElementpFirst
 
ElementpLast
 
ContainerpParent {nullptr}
 
ElementpPrev
 
ElementpNext
 
WindowpDragTarget {nullptr}
 
int32_t iDragX
 
int32_t iDragY
 
bool fDragging {false}
 
ContextHandlerpContextHandler {nullptr}
 
C4Rect rcBounds
 

Detailed Description

Definition at line 1491 of file C4Gui.h.

Member Typedef Documentation

◆ SortFunction

typedef int32_t(* C4GUI::ListBox::SortFunction) (const Element *pEl1, const Element *pEl2, void *par)

Definition at line 1596 of file C4Gui.h.

Constructor & Destructor Documentation

◆ ListBox()

C4GUI::ListBox::ListBox ( const C4Rect rtBounds,
int32_t  iMultiColItemWidth = 0 
)

Definition at line 32 of file C4GuiListBox.cpp.

34  {
35  // calc client rect
36  UpdateOwnPos();
37  // create content scroll window
38  pClientWindow = new ScrollWindow(this);
39  // calc column count
41  // create key bindings
42  pKeyContext = new C4KeyBinding(C4KeyCodeEx(K_MENU), "GUIListBoxContext", KEYSCOPE_Gui,
43  new ControlKeyCB<ListBox>(*this, &ListBox::KeyContext), C4CustomKey::PRIO_Ctrl);
45  keys.emplace_back(K_UP);
47  pKeyUp = new C4KeyBinding(keys, "GUIListBoxUp", KEYSCOPE_Gui,
48  new ControlKeyCB<ListBox>(*this, &ListBox::KeyUp), C4CustomKey::PRIO_Ctrl);
49  keys.clear();
50  keys.emplace_back(K_DOWN);
52  pKeyDown = new C4KeyBinding(keys, "GUIListBoxDown", KEYSCOPE_Gui,
53  new ControlKeyCB<ListBox>(*this, &ListBox::KeyDown), C4CustomKey::PRIO_Ctrl);
54  keys.clear();
55  keys.emplace_back(K_LEFT);
57  pKeyLeft = new C4KeyBinding(keys, "GUIListBoxLeft", KEYSCOPE_Gui,
58  new ControlKeyCB<ListBox>(*this, &ListBox::KeyLeft), C4CustomKey::PRIO_Ctrl);
59  keys.clear();
60  keys.emplace_back(K_RIGHT);
62  pKeyRight = new C4KeyBinding(keys, "GUIListBoxRight", KEYSCOPE_Gui,
63  new ControlKeyCB<ListBox>(*this, &ListBox::KeyRight), C4CustomKey::PRIO_Ctrl);
64  pKeyPageUp = new C4KeyBinding(C4KeyCodeEx(K_PAGEUP), "GUIListBoxPageUp", KEYSCOPE_Gui,
65  new ControlKeyCB<ListBox>(*this, &ListBox::KeyPageUp), C4CustomKey::PRIO_Ctrl);
66  pKeyPageDown = new C4KeyBinding(C4KeyCodeEx(K_PAGEDOWN), "GUIListBoxPageDown", KEYSCOPE_Gui,
67  new ControlKeyCB<ListBox>(*this, &ListBox::KeyPageDown), C4CustomKey::PRIO_Ctrl);
68  pKeyHome = new C4KeyBinding(C4KeyCodeEx(K_HOME), "GUIListBoxHome", KEYSCOPE_Gui,
69  new ControlKeyCB<ListBox>(*this, &ListBox::KeyHome), C4CustomKey::PRIO_Ctrl);
70  pKeyEnd = new C4KeyBinding(C4KeyCodeEx(K_END), "GUIListBoxEnd", KEYSCOPE_Gui,
71  new ControlKeyCB<ListBox>(*this, &ListBox::KeyEnd), C4CustomKey::PRIO_Ctrl);
72  // "activate" current item
73  keys.clear();
74  keys.emplace_back(K_RETURN);
75  keys.emplace_back(K_RETURN, KEYS_Alt);
77  {
78  ControllerKeys::Ok(keys);
79  }
80  pKeyActivate = new C4KeyBinding(keys, "GUIListActivate", KEYSCOPE_Gui,
81  new ControlKeyCB<ListBox>(*this, &ListBox::KeyActivate), C4CustomKey::PRIO_Ctrl);
82  }
C4Config Config
Definition: C4Config.cpp:930
@ KEYSCOPE_Gui
@ KEYS_Alt
int32_t GamepadGuiControl
Definition: C4Config.h:233
C4ConfigControls Controls
Definition: C4Config.h:263
std::vector< C4KeyCodeEx > CodeList
friend class ScrollWindow
Definition: C4Gui.h:844
Control(const C4Rect &rtBounds)
BaseCallbackHandler * pSelectionChangeHandler
Definition: C4Gui.h:1512
ScrollWindow * pClientWindow
Definition: C4Gui.h:1510
bool fDrawBackground
Definition: C4Gui.h:1513
Element * pSelectedItem
Definition: C4Gui.h:1511
bool fDrawBorder
Definition: C4Gui.h:1514
void UpdateColumnCount()
int32_t iColCount
Definition: C4Gui.h:1509
BaseCallbackHandler * pSelectionDblClickHandler
Definition: C4Gui.h:1512
int32_t iMultiColItemWidth
Definition: C4Gui.h:1508
bool fSelectionDisabled
Definition: C4Gui.h:1515
void UpdateOwnPos() override
void Ok(T &keys)
void Left(T &keys)
void Down(T &keys)
void Up(T &keys)
void Right(T &keys)

References Config, C4Config::Controls, ControllerKeys::Down(), C4ConfigControls::GamepadGuiControl, KEYS_Alt, KEYSCOPE_Gui, ControllerKeys::Left(), ControllerKeys::Ok(), pClientWindow, C4CustomKey::PRIO_Ctrl, ControllerKeys::Right(), C4GUI::Container::ScrollWindow, ControllerKeys::Up(), UpdateColumnCount(), and C4GUI::Window::UpdateOwnPos().

Here is the call graph for this function:

◆ ~ListBox()

C4GUI::ListBox::~ListBox ( )
override

Definition at line 84 of file C4GuiListBox.cpp.

85  {
86  delete pKeyActivate;
87  delete pKeyEnd;
88  delete pKeyHome;
89  delete pKeyPageDown;
90  delete pKeyPageUp;
91  delete pKeyRight;
92  delete pKeyLeft;
93  delete pKeyDown;
94  delete pKeyUp;
95  delete pKeyContext;
98  }

References C4GUI::BaseCallbackHandler::DeRef(), pSelectionChangeHandler, and pSelectionDblClickHandler.

Here is the call graph for this function:

Member Function Documentation

◆ AddElement() [1/2]

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

Definition at line 118 of file C4GuiContainers.cpp.

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

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

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

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

◆ AddElement() [2/2]

bool C4GUI::ListBox::AddElement ( Element pChild,
int32_t  iIndent = 0 
)

Definition at line 488 of file C4GuiListBox.cpp.

489  {
490  // fail if no client window is present
491  if (!pClientWindow) return false;
492  // add to scroll window
493  pClientWindow->AddElement(pChild);
494  // resize to horizontal list extents
495  C4Rect &rcChildBounds = pChild->GetBounds();
496  rcChildBounds.x = iIndent;
497  rcChildBounds.Wdt = GetItemWidth() - iIndent ;
498  // reposition to end of list
499  if (pChild->GetPrev())
500  {
501  if (iMultiColItemWidth)
502  {
503  rcChildBounds.y = pChild->GetPrev()->GetBounds().y;
504  int32_t col = pChild->GetPrev()->GetBounds().x / iMultiColItemWidth + 1;
505  if (col >= iColCount)
506  {
507  col = 0;
508  int32_t cnt = iColCount;
509  int32_t iPrevLineHgt = 0;
510  Element *pPrevChild = pChild->GetPrev();
511  while (cnt-- && pPrevChild)
512  {
513  iPrevLineHgt = std::max<int32_t>(iPrevLineHgt, pPrevChild->GetBounds().Hgt);
514  pPrevChild = pPrevChild->GetPrev();
515  }
516  rcChildBounds.y += iPrevLineHgt;
517  }
518  rcChildBounds.x = col * iMultiColItemWidth;
519  }
520  else
521  {
522  rcChildBounds.y = pChild->GetPrev()->GetBounds().y + pChild->GetPrev()->GetBounds().Hgt + pChild->GetListItemTopSpacing();
523  }
524  }
525  else
526  rcChildBounds.y = 0;
527  pChild->UpdateOwnPos();
528  // update scrolling
529  pClientWindow->SetClientHeight(rcChildBounds.y+rcChildBounds.Hgt);
530  // success
531  return true;
532  }
friend class Element
Definition: C4Gui.h:844
void AddElement(Element *pChild)
int32_t GetItemWidth()
Definition: C4Gui.h:1546
void SetClientHeight(int32_t iToHgt)
Definition: C4Gui.h:973
Definition: C4Rect.h:28
int32_t y
Definition: C4Rect.h:30
int32_t Hgt
Definition: C4Rect.h:30
int32_t Wdt
Definition: C4Rect.h:30
int32_t x
Definition: C4Rect.h:30

References C4GUI::Container::AddElement(), C4GUI::Element::GetBounds(), GetItemWidth(), C4GUI::Element::GetListItemTopSpacing(), C4GUI::Element::GetPrev(), C4Rect::Hgt, iColCount, iMultiColItemWidth, pClientWindow, C4GUI::ScrollWindow::SetClientHeight(), C4GUI::Element::UpdateOwnPos(), C4Rect::Wdt, C4Rect::x, and C4Rect::y.

Here is the call graph for this function:

◆ AfterElementRemoval()

void C4GUI::ListBox::AfterElementRemoval ( )
inlineoverrideprotectedvirtual

Reimplemented from C4GUI::Container.

Definition at line 1529 of file C4Gui.h.

1530  { Container::AfterElementRemoval(); UpdateElementPositions(); } // called by ScrollWindow to parent after an element has been removed
virtual void AfterElementRemoval()
Definition: C4Gui.h:756
void UpdateElementPositions()

References C4GUI::Container::AfterElementRemoval(), and UpdateElementPositions().

Here is the call graph for this function:

◆ ApplyElementOffset()

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

Reimplemented from C4GUI::Container.

Reimplemented in C4GUI::Dialog.

Definition at line 866 of file C4Gui.h.

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

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

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

Here is the caller graph for this function:

◆ ApplyInvElementOffset()

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

Reimplemented from C4GUI::Container.

Reimplemented in C4GUI::Dialog.

Definition at line 868 of file C4Gui.h.

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

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

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

Here is the caller graph for this function:

◆ begin()

Iterator C4GUI::Container::begin ( )
inlineinherited

Definition at line 824 of file C4Gui.h.

824 { return Iterator(pFirst); }

References C4GUI::Container::pFirst.

Referenced by C4ScriptGuiWindow::ClearPointers().

Here is the caller graph for this function:

◆ CharIn()

bool C4GUI::ListBox::CharIn ( const char *  c)
overrideprotectedvirtual

Reimplemented from C4GUI::Control.

Definition at line 598 of file C4GuiListBox.cpp.

599  {
600  // Jump to first/next entry beginning with typed letter
601  Element *pSel = GetSelectedItem();
602  Element *pStartCheck = pSel;
603  if (pSel) pSel = pSel->GetNext();
604  if (!pSel)
605  {
606  pSel = GetFirst();
607  if (!pSel) return false;
608  }
609  while (pSel != pStartCheck && !pSel->CheckNameHotkey(c))
610  if (!(pSel = pSel->GetNext()))
611  if (pStartCheck)
612  // list end reached while another entry had been selected before: Re-check start of list
613  pSel = GetFirst();
614  // ok, change selection - might do nothing if list was cycled, which is OK
615  if (pSel)
616  {
617  SelectEntry(pSel, true);
618  return true;
619  }
620  return Control::CharIn(c);
621  }
virtual bool CharIn(const char *)
Definition: C4Gui.h:1051
Element * GetSelectedItem()
Definition: C4Gui.h:1581
Element * GetFirst()
Definition: C4Gui.h:1572
void SelectEntry(Element *pNewSel, bool fByUser)

References C4GUI::Control::CharIn(), C4GUI::Element::CheckNameHotkey(), GetFirst(), C4GUI::Element::GetNext(), GetSelectedItem(), and SelectEntry().

Here is the call graph for this function:

◆ CheckNameHotkey()

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

Reimplemented in C4StartupScenSelDlg::ScenListItem.

Definition at line 407 of file C4Gui.h.

407 { return false; }

Referenced by CharIn().

Here is the caller graph for this function:

◆ Clear()

void C4GUI::Container::Clear ( )
inherited

Definition at line 63 of file C4GuiContainers.cpp.

64  {
65  ClearChildren();
66  }

References C4GUI::Container::ClearChildren().

Referenced by C4GUI::Screen::Clear(), C4GUI::ComboBox_FillCB::ClearEntries(), C4StartupNetListEntry::ClearRef(), C4GUI::Container::~Container(), and C4GUI::ContextMenu::~ContextMenu().

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

◆ ClearChildren()

void C4GUI::Container::ClearChildren ( )
inherited

Definition at line 68 of file C4GuiContainers.cpp.

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

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

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

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

◆ ClientPos2ScreenPos()

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

Definition at line 231 of file C4Gui.cpp.

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

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

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

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

◆ ContractToElementHeight()

int32_t C4GUI::ListBox::ContractToElementHeight ( )

Definition at line 186 of file C4GuiListBox.cpp.

187  {
188  if (!pClientWindow) return 0;
189  // calc superfluous bottom space
190  int32_t iExtraSpace = pClientWindow->GetBounds().Hgt - pClientWindow->GetClientRect().Hgt;
191  if (iExtraSpace <= 0) return 0;
192  // contract by it
193  C4Rect rcNewBounds = GetBounds();
194  rcNewBounds.Hgt -= iExtraSpace;
195  SetBounds(rcNewBounds);
196  return iExtraSpace;
197  }
void SetBounds(const C4Rect &rcNewBound)
Definition: C4Gui.h:446
C4Rect & GetBounds()
Definition: C4Gui.h:445
C4Rect & GetClientRect() override
Definition: C4Gui.h:864

References C4GUI::Element::GetBounds(), C4GUI::Window::GetClientRect(), C4Rect::Hgt, pClientWindow, and C4GUI::Element::SetBounds().

Referenced by C4Network2ClientListDlg::C4Network2ClientListDlg().

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

◆ DisableFocus()

void C4GUI::Control::DisableFocus ( )
protectedinherited

Definition at line 765 of file C4GuiContainers.cpp.

766  {
767  // has it any focus at all?
768  if (!HasFocus()) return;
769  // then de-focus it
770  Dialog *pDlg=GetDlg();
771  if (!pDlg) return;
772  pDlg->AdvanceFocus(true);
773  }
bool HasFocus()
Definition: C4Gui.h:1067
friend class Dialog
Definition: C4Gui.h:1070
virtual class Dialog * GetDlg()
Definition: C4Gui.cpp:288

References C4GUI::Dialog::AdvanceFocus(), C4GUI::Element::GetDlg(), and C4GUI::Control::HasFocus().

Referenced by C4GUI::CheckBox::SetEnabled().

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

◆ DoContext()

bool C4GUI::Element::DoContext ( )
inherited

Definition at line 417 of file C4Gui.cpp.

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

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

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

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

◆ DoDragging()

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

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

Definition at line 269 of file C4Gui.cpp.

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

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

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

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

◆ Draw()

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

Reimplemented from C4GUI::Container.

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

Definition at line 293 of file C4GuiContainers.cpp.

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

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

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

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

◆ Draw3DFrame()

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

Definition at line 291 of file C4Gui.cpp.

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

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(), DrawElement(), C4GUI::Tabular::DrawElement(), C4GUI::TextWindow::DrawElement(), C4GUI::ContextMenu::DrawElement(), C4GUI::ComboBox::DrawElement(), and C4GUI::Dialog::DrawElement().

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

◆ DrawBar()

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

Definition at line 308 of file C4Gui.cpp.

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

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

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

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

◆ DrawElement()

void C4GUI::ListBox::DrawElement ( C4TargetFacet cgo)
overrideprotectedvirtual

Reimplemented from C4GUI::Element.

Definition at line 100 of file C4GuiListBox.cpp.

101  {
102  if (fDrawBackground)
104  if (fDrawBorder) Draw3DFrame(cgo);
105  // listbox bg: mark selected item
106  if (!pClientWindow) return;
107  if (pSelectedItem)
108  {
109  C4Rect rcSelArea = pSelectedItem->GetBounds();
110  rcSelArea.x += GetClientRect().x;
111  rcSelArea.y += GetClientRect().y + pClientWindow->GetClientRect().y;
112  // clip
113  if (rcSelArea.y < GetClientRect().y)
114  {
115  rcSelArea.Hgt -= GetClientRect().y - rcSelArea.y;
116  rcSelArea.y = GetClientRect().y;
117  }
118  rcSelArea.Hgt = std::min(rcSelArea.Hgt, GetClientRect().y + GetClientRect().Hgt - rcSelArea.y);
119  // draw
120  if (rcSelArea.Hgt>=0)
121  pDraw->DrawBoxDw(cgo.Surface, rcSelArea.x+cgo.TargetX, rcSelArea.y+cgo.TargetY,
122  rcSelArea.x+rcSelArea.Wdt+cgo.TargetX-1, rcSelArea.y+rcSelArea.Hgt+cgo.TargetY-1,
124  }
125  // draw delimeter bars
126  Element *pCurr = pClientWindow->GetFirst();
127  if (!pCurr) return;
128  while ((pCurr = pCurr->GetNext()))
129  if (pCurr->GetListItemTopSpacingBar())
130  {
131  int32_t iYSpace = pCurr->GetListItemTopSpacing();
132  int32_t iY = pCurr->GetBounds().y + GetClientRect().y + pClientWindow->GetClientRect().y - iYSpace/2;
133  int32_t iX0 = pCurr->GetBounds().x + GetClientRect().x + C4GUI_ListBoxBarIndent;
134  int32_t iX1 = iX0 + pClientWindow->GetClientRect().Wdt - 2*C4GUI_ListBoxBarIndent;
135  // clip
136  if (iY < GetClientRect().y || iY >= GetClientRect().y+GetClientRect().Hgt) continue;
137  // draw
138  pDraw->DrawLineDw(cgo.Surface, (float)(iX0+cgo.TargetX), (float)(iY+cgo.TargetY), (float)(iX1+cgo.TargetX), (float)(iY+cgo.TargetY), C4GUI_ListBoxBarColor);
139  }
140  }
#define C4GUI_ListBoxBarColor
Definition: C4Gui.h:68
#define C4GUI_ListBoxInactSelColor
Definition: C4Gui.h:63
#define C4GUI_ListBoxSelColor
Definition: C4Gui.h:62
#define C4GUI_ListBoxBarIndent
Definition: C4Gui.h:124
void DrawBoxDw(C4Surface *sfcDest, int iX1, int iY1, int iX2, int iY2, DWORD dwClr)
Definition: C4Draw.cpp:840
Element * GetFirst()
Definition: C4Gui.h:829
virtual int32_t GetListItemTopSpacing()
Definition: C4Gui.h:461
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)
Definition: C4Gui.cpp:291

References C4GUI_ListBoxBarColor, C4GUI_ListBoxBarIndent, C4GUI_ListBoxInactSelColor, C4GUI_ListBoxSelColor, C4GUI::Element::Draw3DFrame(), C4Draw::DrawBoxDw(), C4Draw::DrawLineDw(), fDrawBackground, fDrawBorder, C4GUI::Element::GetBounds(), C4GUI::Window::GetClientRect(), C4GUI::Container::GetFirst(), C4GUI::Element::GetListItemTopSpacing(), C4GUI::Element::GetListItemTopSpacingBar(), C4GUI::Element::GetNext(), C4GUI::Control::HasDrawFocus(), C4Rect::Hgt, pClientWindow, pDraw, pSelectedItem, C4GUI::Element::rcBounds, C4Facet::Surface, C4TargetFacet::TargetX, C4TargetFacet::TargetY, C4Rect::Wdt, C4Rect::x, and C4Rect::y.

Here is the call graph for this function:

◆ DrawHBarByVGfx()

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

Definition at line 365 of file C4Gui.cpp.

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

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

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

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

◆ DrawHVBar()

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

Definition at line 375 of file C4Gui.cpp.

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

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

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

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

◆ DrawVBar()

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

Definition at line 359 of file C4Gui.cpp.

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

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

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

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

◆ ElementPosChanged()

void C4GUI::ListBox::ElementPosChanged ( Element pOfElement)
overridevirtual

Reimplemented from C4GUI::Container.

Definition at line 564 of file C4GuiListBox.cpp.

565  {
566  // inherited
567  if (pOfElement->GetParent() == this)
568  Control::ElementSizeChanged(pOfElement);
569  // update positions of all list items
571  }
virtual void ElementSizeChanged(Element *pOfElement)
Definition: C4Gui.h:753

References C4GUI::Container::ElementSizeChanged(), C4GUI::Element::GetParent(), and UpdateElementPositions().

Here is the call graph for this function:

◆ ElementSizeChanged()

void C4GUI::ListBox::ElementSizeChanged ( Element pOfElement)
overridevirtual

Reimplemented from C4GUI::Container.

Definition at line 551 of file C4GuiListBox.cpp.

552  {
553  // inherited
554  if (pOfElement->GetParent() == this)
555  {
556  Control::ElementSizeChanged(pOfElement);
557  // update col count if list element container was resized
559  }
560  // update positions of all list items
562  }

References C4GUI::Container::ElementSizeChanged(), C4GUI::Element::GetParent(), UpdateColumnCount(), and UpdateElementPositions().

Here is the call graph for this function:

◆ end()

Iterator C4GUI::Container::end ( )
inlineinherited

Definition at line 825 of file C4Gui.h.

825 { return Iterator(nullptr); }

Referenced by C4ScriptGuiWindow::ClearPointers().

Here is the caller graph for this function:

◆ FreezeScrolling()

void C4GUI::ListBox::FreezeScrolling ( )
inline

Definition at line 1563 of file C4Gui.h.

1563 { pClientWindow->Freeze(); }

References C4GUI::ScrollWindow::Freeze(), and pClientWindow.

Here is the call graph for this function:

◆ GetBounds()

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

Definition at line 445 of file C4Gui.h.

445 { return rcBounds; }

References C4GUI::Element::rcBounds.

Referenced by AddElement(), C4Menu::AdjustPosition(), C4GameOverDlg::C4GameOverDlg(), C4StartupModsDlg::C4StartupModsDlg(), C4StartupModsListEntry::C4StartupModsListEntry(), C4StartupNetDlg::C4StartupNetDlg(), C4StartupNetListEntry::C4StartupNetListEntry(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4GUI::ContextMenu::CheckOpenSubmenu(), ContractToElementHeight(), C4MapFolderData::CreateGUIElements(), C4GUI::Screen::DoContext(), C4GUI::Window::Draw(), DrawElement(), C4GUI::ContextMenu::DrawElement(), C4GUI::TextWindow::ElementPosChanged(), C4GUI::TextWindow::ElementSizeChanged(), C4GUI::Dialog::GetMarginTop(), C4GUI::ScrollBar::GetMaxScroll(), C4GUI::GetScreenHgt(), C4GUI::GetScreenWdt(), C4Menu::InitSize(), InsertElement(), C4GUI::ScrollWindow::IsRangeInView(), C4StartupPlrSelDlg::PlayerListItem::Load(), C4GUI::Window::MouseInput(), C4GUI::ScrollBar::MouseInput(), MouseInput(), C4GUI::Screen::MouseInput(), C4StartupPlrSelDlg::OnNewBtn(), C4GUI::ScrollBar::OnPosChanged(), C4StartupPlrSelDlg::OnPropertyBtn(), C4StartupScenSelDlg::ScenListItem::ScenListItem(), C4GUI::ScrollWindow::ScrollBy(), 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(), UpdateElementPosition(), UpdateElementPositions(), C4Menu::UpdateElementPositions(), C4GUI::ScrollWindow::UpdateOwnPos(), C4Menu::UpdateScrollBar(), and C4GUI::TextWindow::UpdateSize().

Here is the caller graph for this function:

◆ GetClientRect()

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

Reimplemented from C4GUI::Element.

Definition at line 864 of file C4Gui.h.

864 { return rcClientRect; }

References C4GUI::Window::rcClientRect.

Referenced by C4GameOverDlg::C4GameOverDlg(), C4LeagueSignupDialog::C4LeagueSignupDialog(), C4StartupMainDlg::C4StartupMainDlg(), C4StartupModsDlg::C4StartupModsDlg(), C4StartupNetDlg::C4StartupNetDlg(), C4StartupOptionsDlg::C4StartupOptionsDlg(), C4StartupPlrColorPickerDlg::C4StartupPlrColorPickerDlg(), C4StartupPlrPropertiesDlg::C4StartupPlrPropertiesDlg(), C4StartupPlrSelDlg::C4StartupPlrSelDlg(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4GUI::ContextMenu::CheckOpenSubmenu(), ContractToElementHeight(), C4MapFolderData::CreateGUIElements(), C4GUI::InfoDialog::CreateSubComponents(), C4GUI::Window::Draw(), DrawElement(), C4GUI::ContextMenu::DrawElement(), C4GUI::FullscreenDialog::FullscreenDialog(), GetItemWidth(), C4FileSelDlg::InitElements(), C4GUI::InputDialog::InputDialog(), C4GUI::LabeledEdit::LabeledEdit(), C4GameLobby::MainDlg::MainDlg(), C4GUI::MessageDialog::MessageDialog(), C4GUI::Window::MouseInput(), C4GUI::ContextMenu::MouseInput(), C4GUI::Screen::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(), UpdateColumnCount(), and C4GUI::TextWindow::UpdateSize().

Here is the caller graph for this function:

◆ GetContainedClientRect()

C4Rect C4GUI::Element::GetContainedClientRect ( )
inlineinherited

Definition at line 448 of file C4Gui.h.

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

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

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

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

◆ GetContainer()

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

Reimplemented from C4GUI::Element.

Definition at line 831 of file C4Gui.h.

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

◆ GetContextHandler()

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

Reimplemented in C4GUI::Dialog.

Definition at line 429 of file C4Gui.cpp.

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

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

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

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

◆ GetDialogWindow()

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

Reimplemented in C4GUI::Dialog.

Definition at line 404 of file C4Gui.h.

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

◆ GetDlg()

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

Reimplemented in C4GUI::Dialog.

Definition at line 288 of file C4Gui.cpp.

288 { if (pParent) return pParent->GetDlg (); return nullptr; }

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(), C4GUI::Screen::MouseInput(), C4ChatControl::OnConnectBtn(), C4GUI::RenameEdit::OnFinishInput(), C4GUI::Label::OnHotkey(), C4ChatControl::OnLoginDataEnter(), C4GUI::CloseButton::OnPress(), C4GUI::CloseIconButton::OnPress(), C4GUI::RenameEdit::RenameEdit(), C4GUI::Container::SetVisibility(), and C4GUI::Screen::ShowDialog().

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

◆ GetElementByIndex()

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

Definition at line 223 of file C4GuiContainers.cpp.

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

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

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

Here is the caller graph for this function:

◆ GetElementCount()

int32_t C4GUI::Container::GetElementCount ( )
inherited

Definition at line 232 of file C4GuiContainers.cpp.

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

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

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

Here is the caller graph for this function:

◆ GetFirst()

Element* C4GUI::ListBox::GetFirst ( )
inline

Definition at line 1572 of file C4Gui.h.

1572 { return pClientWindow ? pClientWindow->GetFirst() : nullptr; }

References C4GUI::Container::GetFirst(), and pClientWindow.

Referenced by C4StartupPlrSelDlg::C4StartupPlrSelDlg(), CharIn(), C4StartupNetDlg::DoRefresh(), C4StartupNetListEntry::GetNextLower(), C4FileSelDlg::GetSelection(), C4StartupPlrSelDlg::OnItemCheckChange(), SelectFirstEntry(), and C4FileSelDlg::SetSelection().

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

◆ GetFirstContained()

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

Reimplemented from C4GUI::Element.

Definition at line 773 of file C4Gui.h.

773 { return pFirst; }

References C4GUI::Container::pFirst.

Referenced by OnGetFocus().

Here is the caller graph for this function:

◆ GetFirstNestedElement()

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

Reimplemented from C4GUI::Element.

Definition at line 204 of file C4GuiContainers.cpp.

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

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

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

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

◆ GetHeight()

int32_t C4GUI::Element::GetHeight ( )
inlineinherited

Definition at line 444 of file C4Gui.h.

444 { return rcBounds.Hgt; }

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

Referenced by C4GUI::Screen::ShowDialog().

Here is the caller graph for this function:

◆ GetItemWidth()

int32_t C4GUI::ListBox::GetItemWidth ( )
inline

Definition at line 1546 of file C4Gui.h.

References C4GUI::Window::GetClientRect(), iMultiColItemWidth, pClientWindow, and C4Rect::Wdt.

Referenced by AddElement(), InsertElement(), and UpdateElementPosition().

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

◆ GetLast()

Element* C4GUI::ListBox::GetLast ( )
inline

Definition at line 1573 of file C4Gui.h.

1573 { return pClientWindow ? pClientWindow->GetLast() : nullptr; }
Element * GetLast()
Definition: C4Gui.h:830

References C4GUI::Container::GetLast(), and pClientWindow.

Here is the call graph for this function:

◆ GetLastContained()

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

Definition at line 774 of file C4Gui.h.

774 { return pLast; }

References C4GUI::Container::pLast.

◆ GetListItemTopSpacing()

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

Reimplemented in C4StartupNetListEntry, and C4StartupModsListEntry.

Definition at line 461 of file C4Gui.h.

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

References C4GUI_DefaultListSpacing.

Referenced by AddElement(), DrawElement(), and UpdateElementPositions().

Here is the caller graph for this function:

◆ GetListItemTopSpacingBar()

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

Definition at line 462 of file C4Gui.h.

462 { return false; }

Referenced by DrawElement().

Here is the caller graph for this function:

◆ GetMarginBottom()

int32_t C4GUI::ListBox::GetMarginBottom ( )
inlineoverridevirtual

Reimplemented from C4GUI::Window.

Definition at line 1579 of file C4Gui.h.

1579 { return 3; }

◆ GetMarginLeft()

int32_t C4GUI::ListBox::GetMarginLeft ( )
inlineoverridevirtual

Reimplemented from C4GUI::Window.

Definition at line 1577 of file C4Gui.h.

1577 { return 3; }

Referenced by MouseInput().

Here is the caller graph for this function:

◆ GetMarginRight()

int32_t C4GUI::ListBox::GetMarginRight ( )
inlineoverridevirtual

Reimplemented from C4GUI::Window.

Definition at line 1578 of file C4Gui.h.

1578 { return 3; }

◆ GetMarginTop()

int32_t C4GUI::ListBox::GetMarginTop ( )
inlineoverridevirtual

Reimplemented from C4GUI::Window.

Definition at line 1576 of file C4Gui.h.

1576 { return 3; }

Referenced by MouseInput().

Here is the caller graph for this function:

◆ GetNext()

◆ GetNextNestedElement()

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

Definition at line 171 of file C4GuiContainers.cpp.

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

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

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

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

◆ GetOwnToolTip()

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

Definition at line 440 of file C4Gui.h.

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

References StdStrBuf::getData().

Here is the call graph for this function:

◆ GetParent()

◆ GetPrev()

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

Definition at line 450 of file C4Gui.h.

450 { return pPrev; }

References C4GUI::Element::pPrev.

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

Here is the caller graph for this function:

◆ GetScreen()

Screen * C4GUI::Element::GetScreen ( )
virtualinherited

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

Definition at line 289 of file C4Gui.cpp.

289 { if (pParent) return pParent->GetScreen(); return nullptr; }
virtual Screen * GetScreen()
Definition: C4Gui.cpp:289

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

Referenced by C4GUI::Dialog::Close(), C4StartupScenSelDlg::DoOK(), C4GUI::Dialog::Draw(), C4GUI::ContextButton::DrawElement(), C4GUI::ComboBox::DrawElement(), C4GUI::Dialog::FadeOut(), C4GUI::Element::GetScreen(), C4GUI::Control::HasDrawFocus(), C4GUI::Dialog::IsActive(), C4StartupScenSelDlg::KeyDelete(), C4GUI::ComboBox::MouseInput(), C4GameOptionButtons::OnBtnComment(), C4GameOptionButtons::OnBtnPassword(), C4StartupPlrPropertiesDlg::OnClosed(), C4StartupPlrPropertiesDlg::OnClrChangeCustom(), C4ChatControl::OnConnectBtn(), C4GUI::CBContextHandler< CBClass >::OnContext(), C4StartupPlrSelDlg::OnDelBtn(), C4StartupPlrSelDlg::OnDelBtnConfirm(), C4StartupPlrSelDlg::OnNewBtn(), C4StartupPlrPropertiesDlg::OnPictureBtn(), C4StartupPlrSelDlg::OnPropertyBtn(), C4StartupMainDlg::OnShown(), C4StartupMainDlg::OnTODO(), C4StartupOptionsDlg::SaveConfig(), C4GUI::Element::SetVisibility(), C4GameLobby::MainDlg::Start(), C4StartupScenSelDlg::StartScenario(), C4ScoreboardDlg::Update(), C4StartupPlrSelDlg::PlayerListItem::UpdateCore(), C4FileSelDlg::UserClose(), C4StartupPlrPropertiesDlg::UserClose(), and C4ChatControl::UserQueryQuit().

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

◆ GetSelectedItem()

Element* C4GUI::ListBox::GetSelectedItem ( )
inline

Definition at line 1581 of file C4Gui.h.

1581 { return pSelectedItem; } // get focused listbox item

References pSelectedItem.

Referenced by CharIn(), C4StartupModsDlg::DoOK(), C4StartupNetDlg::DoOK(), C4StartupPlrSelDlg::GetSelection(), C4PlayerInfoListBox::IsPlayerItemCollapsed(), C4StartupNetDlg::OnReferenceEntryAdd(), and C4FileSelDlg::UpdateSelection().

Here is the caller graph for this function:

◆ GetToolTip()

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

Definition at line 423 of file C4Gui.cpp.

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

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

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

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

◆ GetToprightCornerRect()

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

Definition at line 399 of file C4Gui.cpp.

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

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

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

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

◆ GetWidth()

int32_t C4GUI::Element::GetWidth ( )
inlineinherited

Definition at line 443 of file C4Gui.h.

443 { return rcBounds.Wdt; }

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

Referenced by C4GUI::Screen::ShowDialog().

Here is the caller graph for this function:

◆ HasDrawFocus()

bool C4GUI::Control::HasDrawFocus ( )
inherited

Definition at line 751 of file C4GuiContainers.cpp.

752  {
753  // has focus at all?
754  if (!HasFocus()) return false;
755  // is screen ready and not in context?
756  if (GetScreen() && GetScreen()->HasContext()) return false;
757  // get dlg
758  Dialog *pDlg=GetDlg();
759  // dlg-less control has focus, OK (shouldn't happen)
760  if (!pDlg) return true;
761  // check if dlg is active
762  return pDlg->IsActive(true);
763  }

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

Referenced by C4GUI::Button::DrawElement(), C4GUI::IconButton::DrawElement(), C4GUI::ArrowButton::DrawElement(), C4GUI::FacetButton::DrawElement(), C4GUI::Edit::DrawElement(), C4GUI::CheckBox::DrawElement(), DrawElement(), C4GUI::Tabular::DrawElement(), C4GUI::ContextButton::DrawElement(), and C4GUI::ComboBox::DrawElement().

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

◆ HasFocus()

bool C4GUI::Control::HasFocus ( )
inlineinherited

Definition at line 1067 of file C4Gui.h.

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

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

Referenced by C4GUI::Control::DisableFocus(), C4GUI::Control::HasDrawFocus(), IsFocused(), and C4GUI::Control::MouseInput().

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

◆ InsertElement() [1/2]

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

Definition at line 150 of file C4GuiContainers.cpp.

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

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

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

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

◆ InsertElement() [2/2]

bool C4GUI::ListBox::InsertElement ( Element pChild,
Element pInsertBefore,
int32_t  iIndent = 0 
)

Definition at line 534 of file C4GuiListBox.cpp.

535  {
536  // fail if no client window is present
537  if (!pClientWindow) return false;
538  // add to scroll window
539  pClientWindow->InsertElement(pChild, pInsertBefore);
540  // resize to horizontal list extents
541  C4Rect &rcChildBounds = pChild->GetBounds();
542  rcChildBounds.x = iIndent;
543  rcChildBounds.Wdt = GetItemWidth() - iIndent ;
544  pChild->UpdateOwnPos();
545  // update all element positions (and scrolling)
547  // done, success
548  return true;
549  }
void InsertElement(Element *pChild, Element *pInsertBefore)

References C4GUI::Element::GetBounds(), GetItemWidth(), C4GUI::Container::InsertElement(), pClientWindow, UpdateElementPositions(), C4GUI::Element::UpdateOwnPos(), C4Rect::Wdt, and C4Rect::x.

Referenced by C4StartupModsListEntry::C4StartupModsListEntry(), C4StartupNetListEntry::C4StartupNetListEntry(), C4StartupScenSelDlg::ScenListItem::ScenListItem(), C4Network2ResDlg::Update(), and C4Network2ClientListBox::Update().

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

◆ IsComponentOutsideClientArea()

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

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

Definition at line 870 of file C4Gui.h.

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

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

Here is the caller graph for this function:

◆ IsExternalDrawDialog()

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

Reimplemented in C4Menu, and C4GUI::Dialog.

Definition at line 402 of file C4Gui.h.

402 { return false; }

◆ IsFocused()

bool C4GUI::ListBox::IsFocused ( Control pCtrl)
inlineoverrideprotectedvirtual

Reimplemented from C4GUI::Container.

Definition at line 1519 of file C4Gui.h.

1520  {
1521  // subcontrol also counts as focused if the list has focus and the subcontrol is selected
1522  return Control::IsFocused(pCtrl) || (HasFocus() && pSelectedItem == pCtrl);
1523  }

References C4GUI::Control::HasFocus(), C4GUI::Container::IsFocused(), and pSelectedItem.

Here is the call graph for this function:

◆ IsFocusElement()

Control* C4GUI::ListBox::IsFocusElement ( )
inlineoverrideprotectedvirtual

Reimplemented from C4GUI::Control.

Definition at line 1525 of file C4Gui.h.

1525 { return this; }; // this control can gain focus

◆ IsFocusOnClick()

bool C4GUI::ListBox::IsFocusOnClick ( )
inlineoverrideprotectedvirtual

Reimplemented from C4GUI::Control.

Definition at line 1524 of file C4Gui.h.

1524 { return true; } // list boxes do get focus on click

◆ IsImmediateToolTip()

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

Definition at line 441 of file C4Gui.h.

441 { return is_immediate_tooltip; }

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

Here is the caller graph for this function:

◆ IsInActiveDlg()

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

Definition at line 435 of file C4Gui.cpp.

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

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

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

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

◆ IsMenu()

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

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

Definition at line 403 of file C4Gui.h.

403 { return false; }

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

Here is the caller graph for this function:

◆ IsMultiColumn()

bool C4GUI::ListBox::IsMultiColumn ( ) const
inline

Definition at line 1587 of file C4Gui.h.

1587 { return iColCount > 1; }

References iColCount.

◆ IsOwnPtrElement()

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

Reimplemented in C4Menu.

Definition at line 401 of file C4Gui.h.

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

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

Here is the caller graph for this function:

◆ IsParentOf()

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

Reimplemented from C4GUI::Element.

Definition at line 239 of file C4GuiContainers.cpp.

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

References C4GUI::Element::GetParent().

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

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

◆ IsScrollingActive()

bool C4GUI::ListBox::IsScrollingActive ( )
inline

Definition at line 1582 of file C4Gui.h.

bool IsScrollingActive()
Definition: C4Gui.h:992

References C4GUI::ScrollWindow::IsScrollingActive(), and pClientWindow.

Here is the call graph for this function:

◆ IsScrollingNecessary()

bool C4GUI::ListBox::IsScrollingNecessary ( )
inline

Definition at line 1583 of file C4Gui.h.

bool IsScrollingNecessary()
Definition: C4Gui.h:993

References C4GUI::ScrollWindow::IsScrollingNecessary(), and pClientWindow.

Here is the call graph for this function:

◆ IsSelectedChild()

bool C4GUI::ListBox::IsSelectedChild ( Element pChild)
inlineoverridevirtual

Reimplemented from C4GUI::Container.

Definition at line 1594 of file C4Gui.h.

1594 { return pChild == pSelectedItem || (pSelectedItem && pSelectedItem->IsParentOf(pChild)); }
virtual bool IsParentOf(Element *pEl)
Definition: C4Gui.h:454

References C4GUI::Element::IsParentOf(), and pSelectedItem.

Here is the call graph for this function:

◆ IsVisible()

bool C4GUI::Element::IsVisible ( )
inherited

◆ MakeLastElement()

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

Definition at line 106 of file C4GuiContainers.cpp.

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

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

Referenced by C4GUI::Screen::ActivateDialog().

Here is the caller graph for this function:

◆ MouseEnter()

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

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

Definition at line 413 of file C4Gui.h.

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

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

Here is the caller graph for this function:

◆ MouseInput()

void C4GUI::ListBox::MouseInput ( CMouse rMouse,
int32_t  iButton,
int32_t  iX,
int32_t  iY,
DWORD  dwKeyParam 
)
overridevirtual

Reimplemented from C4GUI::Control.

Definition at line 142 of file C4GuiListBox.cpp.

143  {
144  // inherited
145  Control::MouseInput(rMouse, iButton, iX, iY, dwKeyParam);
146  // safety
147  if (pClientWindow)
148  {
149  // check list area bounds
150  if (pClientWindow->GetBounds().Contains(iX, iY))
151  // left btn down: select item (regardless of key states)
152  if (iButton == C4MC_Button_LeftDown || iButton == C4MC_Button_LeftDouble)
153  {
154  // reset selection
155  Element *pPrevSelectedItem = pSelectedItem;
156  pSelectedItem = nullptr;
157  // get client component the mouse is over
158  iX -= GetMarginLeft(); iY -= GetMarginTop();
159  iY += pClientWindow->GetScrollY();
160  for (Element *pCurr = pClientWindow->GetFirst(); pCurr; pCurr = pCurr->GetNext())
161  if (pCurr->GetBounds().Contains(iX, iY))
162  pSelectedItem = pCurr;
163  // selection change sound
164  if (pSelectedItem != pPrevSelectedItem) SelectionChanged(true);
165  // item double-clicked? Callback
166  if (iButton == C4MC_Button_LeftDouble && pSelectedItem)
168  }
169  }
170  }
const int32_t C4MC_Button_LeftDown
const int32_t C4MC_Button_LeftDouble
virtual void DoCall(class Element *pElement)=0
void MouseInput(CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam) override
Element * GetNext() const
Definition: C4Gui.h:449
void SelectionChanged(bool fByUser)
int32_t GetMarginTop() override
Definition: C4Gui.h:1576
int32_t GetMarginLeft() override
Definition: C4Gui.h:1577
int32_t GetScrollY()
Definition: C4Gui.h:987
bool Contains(int32_t iX, int32_t iY) const
Definition: C4Rect.h:40

References C4MC_Button_LeftDouble, C4MC_Button_LeftDown, C4Rect::Contains(), C4GUI::BaseCallbackHandler::DoCall(), C4GUI::Element::GetBounds(), C4GUI::Container::GetFirst(), GetMarginLeft(), GetMarginTop(), C4GUI::Element::GetNext(), C4GUI::ScrollWindow::GetScrollY(), C4GUI::Control::MouseInput(), pClientWindow, pSelectedItem, pSelectionDblClickHandler, and SelectionChanged().

Here is the call graph for this function:

◆ MouseLeave()

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

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

Definition at line 414 of file C4Gui.h.

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

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

Here is the caller graph for this function:

◆ OnGetFocus()

void C4GUI::ListBox::OnGetFocus ( bool  fByMouse)
overrideprotectedvirtual

Reimplemented from C4GUI::Control.

Definition at line 199 of file C4GuiListBox.cpp.

200  {
201  // inherited (tooltip)
202  Control::OnGetFocus(fByMouse);
203  // select list item if none is selected (only for keyboard; mouse will select with left-click anyway)
204  if (!pSelectedItem && pClientWindow && !fByMouse)
205  {
207  SelectionChanged(false);
208  }
209  }
Element * GetFirstContained() override
Definition: C4Gui.h:773
virtual void OnGetFocus(bool fByMouse)
Definition: C4Gui.h:1056

References C4GUI::Container::GetFirstContained(), C4GUI::Control::OnGetFocus(), pClientWindow, pSelectedItem, and SelectionChanged().

Here is the call graph for this function:

◆ OnHotkey()

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

Reimplemented from C4GUI::Element.

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

Definition at line 212 of file C4GuiContainers.cpp.

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

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

Here is the call graph for this function:

◆ OnLooseFocus()

virtual void C4GUI::Control::OnLooseFocus ( )
inlineprotectedvirtualinherited

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

Definition at line 1057 of file C4Gui.h.

1057 {}; // callback when control looses focus

Referenced by C4GUI::Edit::OnLooseFocus(), and C4GUI::Dialog::SetFocus().

Here is the caller graph for this function:

◆ rbegin()

ReverseIterator C4GUI::Container::rbegin ( )
inlineinherited

Definition at line 826 of file C4Gui.h.

826 { return ReverseIterator(pLast); }

References C4GUI::Container::pLast.

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

Here is the caller graph for this function:

◆ ReaddElement()

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

Definition at line 134 of file C4GuiContainers.cpp.

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

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

Referenced by SortElements().

Here is the caller graph for this function:

◆ RemoveElement()

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

Reimplemented from C4GUI::Container.

Definition at line 475 of file C4GuiListBox.cpp.

476  {
477  // inherited
478  Control::RemoveElement(pChild);
479  // clear selection var
480  if (pChild == pSelectedItem)
481  {
482  pSelectedItem = nullptr;
483  SelectionChanged(false);
484  }
485  // position update in AfterElementRemoval
486  }
void RemoveElement(Element *pChild) override

References pSelectedItem, C4GUI::Container::RemoveElement(), and SelectionChanged().

Here is the call graph for this function:

◆ rend()

ReverseIterator C4GUI::Container::rend ( )
inlineinherited

Definition at line 827 of file C4Gui.h.

827 { return ReverseIterator(nullptr); }

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

Here is the caller graph for this function:

◆ ScreenPos2ClientPos()

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

Definition at line 218 of file C4Gui.cpp.

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

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

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

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

◆ ScrollItemInView()

void C4GUI::ListBox::ScrollItemInView ( Element pItem)

Definition at line 397 of file C4GuiListBox.cpp.

398  {
399  // safety
400  if (!pItem) return;
401  // scroll covered range into view
402  pClientWindow->ScrollRangeInView(pItem->GetBounds().y, pItem->GetBounds().Hgt);
403  }
void ScrollRangeInView(int32_t iY, int32_t iHgt)

References C4GUI::Element::GetBounds(), C4Rect::Hgt, pClientWindow, C4GUI::ScrollWindow::ScrollRangeInView(), and C4Rect::y.

Referenced by SelectionChanged().

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

◆ ScrollToBottom()

void C4GUI::ListBox::ScrollToBottom ( )
inline

Definition at line 1560 of file C4Gui.h.

References pClientWindow, and C4GUI::ScrollWindow::ScrollToBottom().

Here is the call graph for this function:

◆ SelectEntry()

void C4GUI::ListBox::SelectEntry ( Element pNewSel,
bool  fByUser 
)

Definition at line 590 of file C4GuiListBox.cpp.

591  {
592  assert(!pNewSel || pNewSel->GetParent() == pClientWindow);
593  if (pSelectedItem == pNewSel) return;
594  pSelectedItem = pNewSel;
595  SelectionChanged(fByUser);
596  }

References C4GUI::Element::GetParent(), pClientWindow, pSelectedItem, and SelectionChanged().

Referenced by CharIn(), C4StartupScenSelDlg::DeleteConfirm(), SelectFirstEntry(), SelectNone(), and C4StartupPlrSelDlg::SetSelection().

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

◆ SelectFirstEntry()

void C4GUI::ListBox::SelectFirstEntry ( bool  fByUser)
inline

Definition at line 1585 of file C4Gui.h.

1585 { SelectEntry(GetFirst(), fByUser); }

References GetFirst(), and SelectEntry().

Here is the call graph for this function:

◆ SelectionChanged()

void C4GUI::ListBox::SelectionChanged ( bool  fByUser)

Definition at line 573 of file C4GuiListBox.cpp.

574  {
575  // selections disabled?
576  if (fSelectionDisabled) { pSelectedItem = nullptr; return; }
577  // any selection?
578  if (pSelectedItem)
579  {
580  // effect
581  if (fByUser) GUISound("UI::Select");
582  }
583  // callback (caution: May do periluous things...)
585  // let's hope it wasn't perilous enough to delete this,
586  // because scrolling the item into view must be done AFTER the callback, as the callback might resize
588  }
void ScrollItemInView(Element *pItem)
void GUISound(const char *szSound)
Definition: C4Gui.cpp:1175

References C4GUI::BaseCallbackHandler::DoCall(), fSelectionDisabled, C4GUI::GUISound(), pSelectedItem, pSelectionChangeHandler, and ScrollItemInView().

Referenced by MouseInput(), OnGetFocus(), RemoveElement(), and SelectEntry().

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

◆ SelectNone()

void C4GUI::ListBox::SelectNone ( bool  fByUser)
inline

Definition at line 1586 of file C4Gui.h.

1586 { SelectEntry(nullptr, fByUser); }

References SelectEntry().

Referenced by C4StartupScenSelDlg::DoRefresh().

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

◆ SetBounds()

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

Definition at line 446 of file C4Gui.h.

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

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

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

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

◆ SetContextHandler()

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

Definition at line 465 of file C4Gui.h.

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

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

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

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

◆ SetDecoration()

void C4GUI::ListBox::SetDecoration ( bool  fDrawBG,
ScrollBarFacets pToGfx,
bool  fAutoScroll,
bool  fDrawBorder = false 
)
inline

Definition at line 1567 of file C4Gui.h.

1568  { fDrawBackground=fDrawBG; this->fDrawBorder=fDrawBorder; if (pClientWindow) pClientWindow->SetDecoration(pToGfx, fAutoScroll); }
void SetDecoration(ScrollBarFacets *pToGfx, bool fAutoScroll)
Definition: C4Gui.h:977

References fDrawBackground, fDrawBorder, pClientWindow, and C4GUI::ScrollWindow::SetDecoration().

Referenced by C4GameOverDlg::C4GameOverDlg(), C4Network2ClientListDlg::C4Network2ClientListDlg(), C4StartupModsDlg::C4StartupModsDlg(), C4StartupNetDlg::C4StartupNetDlg(), C4StartupPlrSelDlg::C4StartupPlrSelDlg(), and C4StartupScenSelDlg::C4StartupScenSelDlg().

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

◆ SetDragTarget()

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

Definition at line 464 of file C4Gui.h.

464 { pDragTarget = pToWindow; }

References C4GUI::Element::pDragTarget.

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

Here is the caller graph for this function:

◆ SetPos()

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

Definition at line 860 of file C4Gui.h.

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

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

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

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

◆ SetSelectionChangeCallbackFn()

void C4GUI::ListBox::SetSelectionChangeCallbackFn ( BaseCallbackHandler pToHandler)
inline

Definition at line 1549 of file C4Gui.h.

1550  {
1552  if ((pSelectionChangeHandler = pToHandler)) pToHandler->Ref();
1553  }

References C4GUI::BaseCallbackHandler::DeRef(), pSelectionChangeHandler, and C4GUI::BaseCallbackHandler::Ref().

Referenced by C4PlayerInfoListBox::C4PlayerInfoListBox(), C4StartupModsDlg::C4StartupModsDlg(), C4StartupNetDlg::C4StartupNetDlg(), C4StartupPlrSelDlg::C4StartupPlrSelDlg(), C4StartupScenSelDlg::C4StartupScenSelDlg(), and C4FileSelDlg::InitElements().

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

◆ SetSelectionDblClickFn()

void C4GUI::ListBox::SetSelectionDblClickFn ( BaseCallbackHandler pToHandler)
inline

Definition at line 1554 of file C4Gui.h.

References C4GUI::BaseCallbackHandler::DeRef(), pSelectionDblClickHandler, and C4GUI::BaseCallbackHandler::Ref().

Referenced by C4StartupModsDlg::C4StartupModsDlg(), C4StartupNetDlg::C4StartupNetDlg(), C4StartupPlrSelDlg::C4StartupPlrSelDlg(), C4StartupScenSelDlg::C4StartupScenSelDlg(), and C4FileSelDlg::InitElements().

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

◆ SetSelectionDiabled()

void C4GUI::ListBox::SetSelectionDiabled ( bool  fToVal = true)
inline

Definition at line 1569 of file C4Gui.h.

1569 { fSelectionDisabled = fToVal; }

References fSelectionDisabled.

Referenced by C4GameOverDlg::C4GameOverDlg(), and C4Network2ClientListDlg::C4Network2ClientListDlg().

Here is the caller graph for this function:

◆ SetToolTip()

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

Definition at line 409 of file C4Gui.cpp.

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

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

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

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

◆ SetVisibility()

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

Reimplemented from C4GUI::Element.

Reimplemented in C4StartupNetListEntry, and C4StartupModsListEntry.

Definition at line 247 of file C4GuiContainers.cpp.

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

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

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

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

◆ SortElements()

void C4GUI::ListBox::SortElements ( SortFunction  SortFunc,
void *  par 
)

Definition at line 635 of file C4GuiListBox.cpp.

636  {
637  // sort list items:
638  // create an array of all list items, sort it, and reorder them afterwards
639  if (!pClientWindow) return;
640  int32_t iElemCount = pClientWindow->GetElementCount();
641  if (iElemCount <= 1) return;
642  Element **ppElements = new Element *[iElemCount];
643  try
644  {
645  int32_t i=0;
646  for (Element *pEl = pClientWindow->GetFirst(); pEl; pEl = pEl->GetNext())
647  ppElements[i++] = pEl;
648  std::sort(ppElements, ppElements+iElemCount, SortCompareElements(SortFunc, par));
649  for (i=0; i<iElemCount; ++i)
650  pClientWindow->ReaddElement(ppElements[i]);
651  }
652  catch (...)
653  {
654  delete [] ppElements;
655  throw;
656  }
657  delete [] ppElements;
659  }
void ReaddElement(Element *pChild)

References C4GUI::Container::GetElementCount(), C4GUI::Container::GetFirst(), C4GUI::Element::GetNext(), pClientWindow, C4GUI::Container::ReaddElement(), and UpdateElementPositions().

Here is the call graph for this function:

◆ StartDragging()

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

Definition at line 259 of file C4Gui.cpp.

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

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

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

Here is the caller graph for this function:

◆ StopDragging()

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

Definition at line 282 of file C4Gui.cpp.

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

References C4GUI::Element::DoDragging().

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

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

◆ UnFreezeScrolling()

void C4GUI::ListBox::UnFreezeScrolling ( )
inline

Definition at line 1564 of file C4Gui.h.

1564 { pClientWindow->UnFreeze(); }
void UnFreeze()
Definition: C4Gui.h:970

References pClientWindow, and C4GUI::ScrollWindow::UnFreeze().

Here is the call graph for this function:

◆ UpdateColumnCount()

void C4GUI::ListBox::UpdateColumnCount ( )
protected

Definition at line 172 of file C4GuiListBox.cpp.

173  {
175  {
176  // multicoloumn-listbox
177  iColCount = std::max<int32_t>(pClientWindow->GetClientRect().Wdt / iMultiColItemWidth, 1);
178  }
179  else
180  {
181  // regular 1-col-listbox
182  iColCount = 1;
183  }
184  }

References C4GUI::Window::GetClientRect(), iColCount, iMultiColItemWidth, pClientWindow, and C4Rect::Wdt.

Referenced by ElementSizeChanged(), and ListBox().

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

◆ UpdateElementPosition()

void C4GUI::ListBox::UpdateElementPosition ( Element pOfElement,
int32_t  iIndent 
)

Definition at line 464 of file C4GuiListBox.cpp.

465  {
466  // resize it
467  C4Rect &rcChildBounds = pOfElement->GetBounds();
468  rcChildBounds.x = iIndent;
469  rcChildBounds.Wdt = GetItemWidth() - iIndent ;
470  pOfElement->UpdateOwnPos();
471  // re-stack elements
473  }

References C4GUI::Element::GetBounds(), GetItemWidth(), UpdateElementPositions(), C4GUI::Element::UpdateOwnPos(), C4Rect::Wdt, and C4Rect::x.

Here is the call graph for this function:

◆ UpdateElementPositions()

void C4GUI::ListBox::UpdateElementPositions ( )

Definition at line 405 of file C4GuiListBox.cpp.

406  {
407  // safety
408  if (!pClientWindow) return;
409  // first item at zero offset
410  Element *pCurr = pClientWindow->GetFirst();
411  int iOverallHgt;
412  if (pCurr)
413  {
414  if (!iMultiColItemWidth)
415  {
416  // Single column box: All stacked vertically
417  if (pCurr->GetBounds().y)
418  {
419  pCurr->GetBounds().y = 0;
420  pCurr->UpdateOwnPos();
421  }
422  if(pCurr->fVisible) iOverallHgt = pCurr->GetBounds().Hgt;
423  else iOverallHgt = 0;
424  // others stacked under it
425  while ((pCurr = pCurr->GetNext()))
426  {
427  if(!pCurr->fVisible) continue; //Do not reserve space for hidden elements
428  int32_t iYSpace = pCurr->GetListItemTopSpacing();
429  int32_t iNewY = iOverallHgt + iYSpace;
430  iOverallHgt += pCurr->GetBounds().Hgt + iYSpace;
431  if (iNewY != pCurr->GetBounds().y)
432  {
433  pCurr->GetBounds().y = iNewY;
434  pCurr->UpdateOwnPos();
435  }
436  }
437  }
438  else
439  {
440  // Multi column box: Keep element size; reposition horizontally+vertically
441  int32_t y=0, iLineHgt=0, col=0;
442  for (; pCurr; pCurr=pCurr->GetNext())
443  {
444  const C4Rect &rcCurrBounds = pCurr->GetBounds();
445  iLineHgt = std::max<int32_t>(rcCurrBounds.Hgt, iLineHgt);
446  int32_t x = col * iMultiColItemWidth;
447  if (rcCurrBounds.x != x || rcCurrBounds.y != y || rcCurrBounds.Wdt != iMultiColItemWidth)
448  pCurr->SetBounds(C4Rect(x,y,iMultiColItemWidth,rcCurrBounds.Hgt));
449  if (++col >= iColCount)
450  {
451  col = 0;
452  y += iLineHgt;
453  }
454  }
455  iOverallHgt = y + iLineHgt;
456  }
457  }
458  else
459  iOverallHgt = 0;
460  // update scrolling
461  pClientWindow->SetClientHeight(iOverallHgt);
462  }

References C4GUI::Element::fVisible, C4GUI::Element::GetBounds(), C4GUI::Container::GetFirst(), C4GUI::Element::GetListItemTopSpacing(), C4GUI::Element::GetNext(), C4Rect::Hgt, iColCount, iMultiColItemWidth, pClientWindow, C4GUI::Element::SetBounds(), C4GUI::ScrollWindow::SetClientHeight(), C4GUI::Element::UpdateOwnPos(), C4Rect::Wdt, C4Rect::x, and C4Rect::y.

Referenced by AfterElementRemoval(), C4StartupModsDlg::C4StartupModsDlg(), C4StartupNetDlg::C4StartupNetDlg(), C4StartupPlrSelDlg::C4StartupPlrSelDlg(), ElementPosChanged(), ElementSizeChanged(), InsertElement(), SortElements(), UpdateElementPosition(), and UpdateSize().

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

◆ UpdateOwnPos()

void C4GUI::Window::UpdateOwnPos ( )
overridevirtualinherited

Reimplemented from C4GUI::Element.

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

Definition at line 324 of file C4GuiContainers.cpp.

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

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

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

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

◆ UpdatePos()

void C4GUI::Element::UpdatePos ( )
protectedvirtualinherited

Reimplemented in C4GUI::Dialog.

Definition at line 193 of file C4Gui.cpp.

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

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

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

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

◆ UpdateSize()

void C4GUI::ListBox::UpdateSize ( )
inlineoverridevirtual

Reimplemented from C4GUI::Element.

Definition at line 1592 of file C4Gui.h.

References pClientWindow, UpdateElementPositions(), and C4GUI::Element::UpdateSize().

Here is the call graph for this function:

Member Data Documentation

◆ fDragging

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

Definition at line 380 of file C4Gui.h.

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

◆ fDrawBackground

bool C4GUI::ListBox::fDrawBackground
protected

Definition at line 1513 of file C4Gui.h.

Referenced by DrawElement(), and SetDecoration().

◆ fDrawBorder

bool C4GUI::ListBox::fDrawBorder
protected

Definition at line 1514 of file C4Gui.h.

Referenced by DrawElement(), and SetDecoration().

◆ fSelectionDisabled

bool C4GUI::ListBox::fSelectionDisabled
protected

Definition at line 1515 of file C4Gui.h.

Referenced by SelectionChanged(), and SetSelectionDiabled().

◆ fVisible

◆ iColCount

int32_t C4GUI::ListBox::iColCount
protected

Definition at line 1509 of file C4Gui.h.

Referenced by AddElement(), IsMultiColumn(), UpdateColumnCount(), and UpdateElementPositions().

◆ iDragX

int32_t C4GUI::Element::iDragX
protectedinherited

Definition at line 379 of file C4Gui.h.

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

◆ iDragY

int32_t C4GUI::Element::iDragY
protectedinherited

Definition at line 379 of file C4Gui.h.

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

◆ iMultiColItemWidth

int32_t C4GUI::ListBox::iMultiColItemWidth
protected

Definition at line 1508 of file C4Gui.h.

Referenced by AddElement(), GetItemWidth(), UpdateColumnCount(), and UpdateElementPositions().

◆ pClientWindow

◆ pContextHandler

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

◆ pDragTarget

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

◆ pFirst

◆ pLast

◆ pNext

◆ pParent

◆ pPrev

◆ pSelectedItem

Element* C4GUI::ListBox::pSelectedItem
protected

◆ pSelectionChangeHandler

BaseCallbackHandler* C4GUI::ListBox::pSelectionChangeHandler
protected

Definition at line 1512 of file C4Gui.h.

Referenced by SelectionChanged(), SetSelectionChangeCallbackFn(), and ~ListBox().

◆ pSelectionDblClickHandler

BaseCallbackHandler * C4GUI::ListBox::pSelectionDblClickHandler
protected

Definition at line 1512 of file C4Gui.h.

Referenced by MouseInput(), SetSelectionDblClickFn(), and ~ListBox().

◆ rcBounds

C4Rect C4GUI::Element::rcBounds
protectedinherited

Definition at line 385 of file C4Gui.h.

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

◆ rcClientRect


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