OpenClonk
C4GUI::RenameEdit Class Referenceabstract

#include <C4Gui.h>

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

Public Types

enum  RenameResult { RR_Invalid =0 , RR_Accepted , RR_Deleted }
 
enum  InputResult { IR_None =0 , IR_CloseDlg , IR_CloseEdit , IR_Abort }
 

Public Member Functions

 RenameEdit (Label *pLabel)
 
 ~RenameEdit () override
 
void Abort ()
 
bool InsertText (const char *szText, bool fUser)
 
void ClearText ()
 
void DeleteSelection ()
 
bool SetText (const char *szText, bool fUser)
 
void SetPasswordMask (char cNewPasswordMask)
 
void MouseInput (CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam) override
 
const char * GetText ()
 
void SelectAll ()
 
bool GetCurrentWord (char *szTargetBuf, int32_t iMaxTargetBufLen)
 
void SetFont (CStdFont *pToFont)
 
void SetColors (uint32_t dwNewBGClr, uint32_t dwNewFontClr, uint32_t dwNewBorderColor)
 
void SetMaxText (int32_t iTo)
 
bool HasFocus ()
 
bool HasDrawFocus ()
 
void SetPos (int32_t iXPos, int32_t iYPos)
 
void UpdateOwnPos () override
 
C4Rect & GetClientRect () 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 RemoveElement (Element *pChild) override
 
void MakeLastElement (Element *pChild)
 
void AddElement (Element *pChild)
 
void ReaddElement (Element *pChild)
 
void InsertElement (Element *pChild, Element *pInsertBefore)
 
Element * GetNextNestedElement (Element *pPrevElement, bool fBackwards)
 
Element * GetFirstContained () override
 
virtual Element * GetLastContained ()
 
Element * GetFirstNestedElement (bool fBackwards) override
 
Iterator begin ()
 
Iterator end ()
 
ReverseIterator rbegin ()
 
ReverseIterator rend ()
 
Element * GetFirst ()
 
Element * GetLast ()
 
Container * GetContainer () override
 
Element * GetElementByIndex (int32_t i)
 
int32_t GetElementCount ()
 
void SetVisibility (bool fToValue) override
 
virtual bool IsFocused (Control *pCtrl)
 
virtual bool IsSelectedChild (Element *pChild)
 
bool IsParentOf (Element *pEl) override
 
virtual void MouseEnter (CMouse &rMouse)
 
virtual void MouseLeave (CMouse &rMouse)
 
virtual void StartDragging (CMouse &rMouse, int32_t iX, int32_t iY, DWORD dwKeyParam)
 
virtual void StopDragging (CMouse &rMouse, int32_t iX, int32_t iY, DWORD dwKeyParam)
 
bool DoContext ()
 
Container * GetParent ()
 
virtual class Dialog * GetDlg ()
 
virtual Screen * GetScreen ()
 
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 ()
 
C4Rect & GetBounds ()
 
void SetBounds (const C4Rect &rcNewBound)
 
C4Rect GetContainedClientRect ()
 
Element * GetNext () const
 
Element * GetPrev () 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 ContextHandler * GetContextHandler ()
 

Static Public Member Functions

static int32_t GetDefaultEditHeight ()
 
static int32_t GetCustomEditHeight (CStdFont *pUseFont)
 

Public Attributes

bool fVisible {true}
 

Protected Member Functions

bool KeyAbort ()
 
InputResult OnFinishInput (bool fPasting, bool fPastingMore) override
 
void OnLooseFocus () override
 
virtual void OnCancelRename ()
 
virtual RenameResult OnOKRename (const char *szNewName)=0
 
ContextMenu * OnContext (C4GUI::Element *pListItem, int32_t iX, int32_t iY)
 
void OnCtxCopy (C4GUI::Element *pThis)
 
void OnCtxPaste (C4GUI::Element *pThis)
 
void OnCtxCut (C4GUI::Element *pThis)
 
void OnCtxClear (C4GUI::Element *pThis)
 
void OnCtxSelAll (C4GUI::Element *pThis)
 
bool CharIn (const char *c) override
 
void DoDragging (CMouse &rMouse, int32_t iX, int32_t iY, DWORD dwKeyParam) override
 
bool IsFocusOnClick () override
 
void OnGetFocus (bool fByMouse) override
 
void DrawElement (C4TargetFacet &cgo) override
 
virtual void OnAbortInput ()
 
int32_t GetMarginTop () override
 
int32_t GetMarginLeft () override
 
int32_t GetMarginRight () override
 
int32_t GetMarginBottom () override
 
void DisableFocus ()
 
Control * IsFocusElement () override
 
bool KeyContext ()
 
void Draw (C4TargetFacet &cgo) override
 
virtual void ElementSizeChanged (Element *pOfElement)
 
virtual void ElementPosChanged (Element *pOfElement)
 
virtual void AfterElementRemoval ()
 
bool OnHotkey (uint32_t cHotkey) override
 
virtual void UpdateSize ()
 
virtual void UpdatePos ()
 
void Draw3DFrame (C4TargetFacet &cgo, bool fUp=false, int32_t iIndent=1, BYTE byAlpha=C4GUI_BorderAlpha, bool fDrawTop=true, int32_t iTopOff=0, bool fDrawLeft=true, int32_t iLeftOff=0)
 
void DrawBar (C4TargetFacet &cgo, DynBarFacet &rFacets)
 
void DrawVBar (C4TargetFacet &cgo, DynBarFacet &rFacets)
 
void DrawHBarByVGfx (C4TargetFacet &cgo, DynBarFacet &rFacets)
 
void DrawHVBar (C4TargetFacet &cgo, DynBarFacet &rFacets, C4DrawTransform &trf, int32_t iMiddleLength)
 
virtual bool IsOwnPtrElement ()
 
virtual bool IsExternalDrawDialog ()
 
virtual bool IsMenu ()
 
virtual class DialogWindow * GetDialogWindow ()
 
virtual bool CheckNameHotkey (const char *)
 

Protected Attributes

CStdFont * pFont
 
char * Text
 
uint32_t dwBGClr
 
uint32_t dwFontClr
 
uint32_t dwBorderColor
 
int32_t iBufferSize
 
int32_t iCursorPos
 
int32_t iSelectionStart
 
int32_t iSelectionEnd
 
int32_t iMaxTextLength
 
C4TimeMilliseconds tLastInputTime
 
int32_t iXScroll
 
char cPasswordMask
 
bool fLeftBtnDown
 
C4Rect rcClientRect
 
Element * pFirst
 
Element * pLast
 
Container * pParent {nullptr}
 
Element * pPrev
 
Element * pNext
 
Window * pDragTarget {nullptr}
 
int32_t iDragX
 
int32_t iDragY
 
bool fDragging {false}
 
ContextHandler * pContextHandler {nullptr}
 
C4Rect rcBounds
 

Detailed Description

Definition at line 1376 of file C4Gui.h.

Member Enumeration Documentation

◆ InputResult

enum C4GUI::Edit::InputResult
inherited
Enumerator
IR_None 
IR_CloseDlg 
IR_CloseEdit 
IR_Abort 

Definition at line 1253 of file C4Gui.h.

1254  {
1255  IR_None=0, // do nothing and continue pasting
1256  IR_CloseDlg, // stop any pastes and close parent dialog successfully
1257  IR_CloseEdit, // stop any pastes and remove this control
1258  IR_Abort // do nothing and stop any pastes
1259  };
@ IR_CloseDlg
Definition: C4Gui.h:1256
@ IR_Abort
Definition: C4Gui.h:1258
@ IR_CloseEdit
Definition: C4Gui.h:1257

◆ RenameResult

Enumerator
RR_Invalid 
RR_Accepted 
RR_Deleted 

Definition at line 1385 of file C4Gui.h.

1386  {
1387  RR_Invalid=0, // rename not accepted; continue editing
1388  RR_Accepted, // rename accepted; delete control
1389  RR_Deleted // control deleted - leave everything
1390  };

Constructor & Destructor Documentation

◆ RenameEdit()

C4GUI::RenameEdit::RenameEdit ( Label *  pLabel)

Definition at line 691 of file C4GuiEdit.cpp.

691  : Edit(pLabel->GetBounds(), true), fFinishing(false), pForLabel(pLabel)
692  {
693  // ctor - construct for label
694  assert(pForLabel);
695  pForLabel->SetVisibility(false);
696  InsertText(pForLabel->GetText(), true);
697  // put self into place
698  Container *pCont = pForLabel->GetParent();
699  assert(pCont);
700  pCont->AddElement(this);
701  Dialog *pDlg = GetDlg();
702  if (pDlg)
703  {
704  pPrevFocusCtrl = pDlg->GetFocus();
705  pDlg->SetFocus(this, false);
706  }
707  else pPrevFocusCtrl=nullptr;
708  // key binding for rename abort
710  keys.emplace_back(K_ESCAPE);
712  {
714  }
715  pKeyAbort = new C4KeyBinding(keys, "GUIRenameEditAbort", KEYSCOPE_Gui,
716  new ControlKeyCB<RenameEdit>(*this, &RenameEdit::KeyAbort), C4CustomKey::PRIO_FocusCtrl);
717  }
C4Config Config
Definition: C4Config.cpp:930
@ KEYSCOPE_Gui
int32_t GamepadGuiControl
Definition: C4Config.h:233
C4ConfigControls Controls
Definition: C4Config.h:263
std::vector< C4KeyCodeEx > CodeList
friend class Dialog
Definition: C4Gui.h:1070
Edit(const C4Rect &rtBounds, bool fFocusEdit=false)
Definition: C4GuiEdit.cpp:47
bool InsertText(const char *szText, bool fUser)
Definition: C4GuiEdit.cpp:163
virtual void SetVisibility(bool fToValue)
Definition: C4Gui.cpp:207
Container * GetParent()
Definition: C4Gui.h:429
virtual class Dialog * GetDlg()
Definition: C4Gui.cpp:288
const char * GetText()
Definition: C4Gui.h:503
bool KeyAbort()
Definition: C4Gui.h:1402
void Cancel(T &keys)

References C4GUI::Container::AddElement(), ControllerKeys::Cancel(), Config, C4Config::Controls, C4ConfigControls::GamepadGuiControl, C4GUI::Element::GetDlg(), C4GUI::Dialog::GetFocus(), C4GUI::Element::GetParent(), C4GUI::Label::GetText(), C4GUI::Edit::InsertText(), KeyAbort(), KEYSCOPE_Gui, C4CustomKey::PRIO_FocusCtrl, C4GUI::Dialog::SetFocus(), and C4GUI::Element::SetVisibility().

Here is the call graph for this function:

◆ ~RenameEdit()

C4GUI::RenameEdit::~RenameEdit ( )
override

Definition at line 719 of file C4GuiEdit.cpp.

720  {
721  delete pKeyAbort;
722  }

Member Function Documentation

◆ Abort()

void C4GUI::RenameEdit::Abort ( )

Definition at line 724 of file C4GuiEdit.cpp.

725  {
726  OnCancelRename();
727  FinishRename();
728  }
virtual void OnCancelRename()
Definition: C4Gui.h:1406

References OnCancelRename().

Referenced by C4StartupPlrSelDlg::AbortRenaming(), C4StartupScenSelDlg::AbortRenaming(), and KeyAbort().

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

◆ AddElement()

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

Definition at line 118 of file C4GuiContainers.cpp.

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

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

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

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

◆ AfterElementRemoval()

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

Reimplemented in C4GUI::ListBox.

Definition at line 756 of file C4Gui.h.

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

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

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

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

◆ ApplyElementOffset()

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

Reimplemented from C4GUI::Container.

Reimplemented in C4GUI::Dialog.

Definition at line 866 of file C4Gui.h.

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

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

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

Here is the caller graph for this function:

◆ ApplyInvElementOffset()

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

Reimplemented from C4GUI::Container.

Reimplemented in C4GUI::Dialog.

Definition at line 868 of file C4Gui.h.

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

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

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

Here is the caller graph for this function:

◆ begin()

Iterator C4GUI::Container::begin ( )
inlineinherited

Definition at line 824 of file C4Gui.h.

824 { return Iterator(pFirst); }

References C4GUI::Container::pFirst.

Referenced by C4ScriptGuiWindow::ClearPointers().

Here is the caller graph for this function:

◆ CharIn()

bool C4GUI::Edit::CharIn ( const char *  c)
overrideprotectedvirtualinherited

Reimplemented from C4GUI::Control.

Definition at line 453 of file C4GuiEdit.cpp.

454  {
455  // no control codes
456  if (((unsigned char)(c[0]))<' ' || c[0]==0x7f) return false;
457  // no '|'
458  if (c[0]=='|') return false;
459  // all extended characters are OK
460  // insert character at cursor position
461  return InsertText(c, true);
462  }

References C4GUI::Edit::InsertText().

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 C4GUI::ListBox::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  }
friend class Element
Definition: C4Gui.h:844
virtual bool IsOwnPtrElement()
Definition: C4Gui.h:401

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

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

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

◆ ClearText()

void C4GUI::Edit::ClearText ( )
inherited

Definition at line 125 of file C4GuiEdit.cpp.

126  {
127  // free oversized buffers
128  if (iBufferSize > 256)
129  {
130  delete[] Text;
131  Text = new char[256];
132  iBufferSize = 256;
133  }
134  // clear text
135  *Text=0;
136  // reset cursor and selection
138  iXScroll = 0;
139  }
int32_t iCursorPos
Definition: C4Gui.h:1309
char * Text
Definition: C4Gui.h:1306
int32_t iSelectionStart
Definition: C4Gui.h:1310
int32_t iXScroll
Definition: C4Gui.h:1313
int32_t iSelectionEnd
Definition: C4Gui.h:1310
int32_t iBufferSize
Definition: C4Gui.h:1308

References C4GUI::Edit::iBufferSize, C4GUI::Edit::iCursorPos, C4GUI::Edit::iSelectionEnd, C4GUI::Edit::iSelectionStart, C4GUI::Edit::iXScroll, and C4GUI::Edit::Text.

Referenced by C4StartupScenSelDlg::DoBack(), C4StartupScenSelDlg::OpenFolder(), and C4GUI::Edit::SetText().

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:

◆ DeleteSelection()

void C4GUI::Edit::DeleteSelection ( )
inherited

Definition at line 149 of file C4GuiEdit.cpp.

150  {
151  // move end text to front
152  int32_t iSelBegin = std::min(iSelectionStart, iSelectionEnd), iSelEnd = std::max(iSelectionStart, iSelectionEnd);
153  if (iSelectionStart == iSelectionEnd) return;
154  memmove(Text + iSelBegin, Text + iSelEnd, strlen(Text + iSelEnd)+1);
155  // adjust cursor pos
156  if (iCursorPos > iSelBegin) iCursorPos = std::max(iSelBegin, iCursorPos - iSelEnd + iSelBegin);
157  // cursor might have moved: ensure it is shown
159  // nothing selected
160  iSelectionStart = iSelectionEnd = iSelBegin;
161  }
C4TimeMilliseconds tLastInputTime
Definition: C4Gui.h:1312
static C4TimeMilliseconds Now()

References C4GUI::Edit::iCursorPos, C4GUI::Edit::iSelectionEnd, C4GUI::Edit::iSelectionStart, C4TimeMilliseconds::Now(), C4GUI::Edit::Text, and C4GUI::Edit::tLastInputTime.

Referenced by C4GUI::Edit::InsertText(), C4GameLobby::MainDlg::KeyHistoryUpDown(), C4GameLobby::MainDlg::OnChatInput(), C4GUI::Edit::OnCtxClear(), and C4GUI::InputDialog::SetInputText().

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

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
int32_t Hgt
Definition: C4Rect.h:30
int32_t Wdt
Definition: C4Rect.h:30

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

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

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

◆ DoDragging()

void C4GUI::Edit::DoDragging ( CMouse &  rMouse,
int32_t  iX,
int32_t  iY,
DWORD  dwKeyParam 
)
overrideprotectedvirtualinherited

Reimplemented from C4GUI::Element.

Definition at line 535 of file C4GuiEdit.cpp.

536  {
537  // update cursor pos
538  int32_t iPrevCursorPos = iCursorPos;
539  iCursorPos = iSelectionEnd = GetCharPos(iX);
540  // scroll cursor in view
541  if (iPrevCursorPos != iCursorPos) ScrollCursorInView();
542  }

References C4GUI::Edit::iCursorPos, and C4GUI::Edit::iSelectionEnd.

◆ 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
C4Rect & GetBounds()
Definition: C4Gui.h:445
C4Rect & GetClientRect() override
Definition: C4Gui.h:864
virtual bool IsComponentOutsideClientArea()
Definition: C4Gui.h:870
Definition: C4Rect.h:28
float TargetY
Definition: C4Facet.h:165
float TargetX
Definition: C4Facet.h:165

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

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

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

◆ DrawBar()

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

Definition at line 308 of file C4Gui.cpp.

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

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

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

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

◆ DrawElement()

void C4GUI::Edit::DrawElement ( C4TargetFacet &  cgo)
overrideprotectedvirtualinherited

Reimplemented from C4GUI::Element.

Definition at line 562 of file C4GuiEdit.cpp.

563  {
564  // draw background
566  // draw frame
567  if (dwBorderColor)
568  {
569  int32_t x1=cgo.TargetX+rcBounds.x,y1=cgo.TargetY+rcBounds.y,x2=x1+rcBounds.Wdt,y2=y1+rcBounds.Hgt;
570  pDraw->DrawFrameDw(cgo.Surface, x1, y1, x2, y2-1, dwBorderColor);
571  pDraw->DrawFrameDw(cgo.Surface, x1+1, y1+1, x2-1, y2-2, dwBorderColor);
572  }
573  else
574  // default frame color
575  Draw3DFrame(cgo);
576  // clipping
577  int cx0,cy0,cx1,cy1; bool fClip, fOwnClip;
578  fClip = pDraw->GetPrimaryClipper(cx0,cy0,cx1,cy1);
579  float nclx1 = rcClientRect.x+cgo.TargetX-2, ncly1 = rcClientRect.y+cgo.TargetY, nclx2 = rcClientRect.x+rcClientRect.Wdt+cgo.TargetX+1, ncly2 = rcClientRect.y+rcClientRect.Hgt+cgo.TargetY;
580  pDraw->ApplyZoom(nclx1, ncly1);
581  pDraw->ApplyZoom(nclx2, ncly2);
582  fOwnClip = pDraw->SetPrimaryClipper(nclx1, ncly1, nclx2, ncly2);
583  // get usable height of edit field
584  int32_t iHgt = pFont->GetLineHeight(), iY0;
585  if (rcClientRect.Hgt <= iHgt)
586  {
587  // very narrow edit field: use all of it
588  iHgt=rcClientRect.Hgt;
589  iY0=rcClientRect.y;
590  }
591  else
592  {
593  // normal edit field: center text vertically
594  iY0 = rcClientRect.y+(rcClientRect.Hgt-iHgt)/2+1;
595  // don't overdo it with selection mark
596  iHgt-=2;
597  }
598  // get text to draw, apply password mask if neccessary
599  StdStrBuf Buf; char *pDrawText;
600  if (cPasswordMask)
601  {
603  pDrawText = Buf.getMData();
604  }
605  else
606  pDrawText = Text;
607  // draw selection
609  {
610  // get selection range
611  int32_t iSelBegin = std::min(iSelectionStart, iSelectionEnd);
612  int32_t iSelEnd = std::max(iSelectionStart, iSelectionEnd);
613  // get offsets in text
614  int32_t iSelX1, iSelX2, h;
615  char c = pDrawText[iSelBegin]; pDrawText[iSelBegin]=0; pFont->GetTextExtent(pDrawText, iSelX1, h, false); pDrawText[iSelBegin]=c;
616  c = pDrawText[iSelEnd]; pDrawText[iSelEnd]=0; pFont->GetTextExtent(pDrawText, iSelX2, h, false); pDrawText[iSelEnd]=c;
617  iSelX1 -= iXScroll; iSelX2 -= iXScroll;
618  // draw selection box around it
619  pDraw->DrawBoxDw(cgo.Surface, cgo.TargetX+rcClientRect.x+iSelX1,cgo.TargetY+iY0,rcClientRect.x+iSelX2-1+cgo.TargetX,iY0+iHgt-1+cgo.TargetY,0x7f7f7f00);
620  }
621  // draw edit text
622  pDraw->TextOut(pDrawText, *pFont, 1.0f, cgo.Surface, rcClientRect.x + cgo.TargetX - iXScroll, iY0 + cgo.TargetY - 1, dwFontClr, ALeft, false);
623  // draw cursor
624  bool fBlink = ((tLastInputTime - C4TimeMilliseconds::Now())/500)%2 == 0;
625  if (HasDrawFocus() && fBlink)
626  {
627  char cAtCursor = pDrawText[iCursorPos]; pDrawText[iCursorPos]=0; int32_t w,h,wc;
628  pFont->GetTextExtent(pDrawText, w, h, false);
629  pDrawText[iCursorPos] = cAtCursor;
630  pFont->GetTextExtent(CursorRepresentation, wc, h, false); wc/=2;
631  pDraw->TextOut(CursorRepresentation, *pFont, 1.5f, cgo.Surface, rcClientRect.x + cgo.TargetX + w - wc - iXScroll, iY0 + cgo.TargetY - h/3, dwFontClr, ALeft, false);
632  }
633  // unclip
634  if (fOwnClip)
635  {
636  if (fClip) pDraw->SetPrimaryClipper(cx0,cy0,cx1,cy1);
637  else pDraw->NoPrimaryClipper();
638  }
639  }
const int ALeft
Definition: C4Surface.h:41
size_t SLen(const char *sptr)
Definition: Standard.h:74
void DrawFrameDw(C4Surface *sfcDest, int x1, int y1, int x2, int y2, DWORD dwClr, float width=1.0f)
Definition: C4Draw.cpp:635
bool NoPrimaryClipper()
Definition: C4Draw.cpp:237
void DrawBoxDw(C4Surface *sfcDest, int iX1, int iY1, int iX2, int iY2, DWORD dwClr)
Definition: C4Draw.cpp:840
bool TextOut(const char *szText, CStdFont &rFont, float fZoom, C4Surface *sfcDest, float iTx, float iTy, DWORD dwFCol=0xffffffff, BYTE byForm=ALeft, bool fDoMarkup=true)
Definition: C4Draw.cpp:561
CStdFont * pFont
Definition: C4Gui.h:1305
char cPasswordMask
Definition: C4Gui.h:1314
uint32_t dwBGClr
Definition: C4Gui.h:1307
uint32_t dwBorderColor
Definition: C4Gui.h:1307
uint32_t dwFontClr
Definition: C4Gui.h:1307
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
int GetLineHeight() const
Definition: C4FontLoader.h:125
bool GetTextExtent(const char *szText, int32_t &rsx, int32_t &rsy, bool fCheckMarkup=true)
void AppendChars(char cChar, size_t iCnt)
Definition: StdBuf.h:582
char * getMData()
Definition: StdBuf.h:443

References ALeft, StdStrBuf::AppendChars(), C4Draw::ApplyZoom(), C4GUI::Edit::cPasswordMask, C4GUI::Element::Draw3DFrame(), C4Draw::DrawBoxDw(), C4Draw::DrawFrameDw(), C4GUI::Edit::dwBGClr, C4GUI::Edit::dwBorderColor, C4GUI::Edit::dwFontClr, CStdFont::GetLineHeight(), StdStrBuf::getMData(), C4Draw::GetPrimaryClipper(), CStdFont::GetTextExtent(), C4GUI::Control::HasDrawFocus(), C4Rect::Hgt, C4GUI::Edit::iCursorPos, C4GUI::Edit::iSelectionEnd, C4GUI::Edit::iSelectionStart, C4GUI::Edit::iXScroll, C4Draw::NoPrimaryClipper(), C4TimeMilliseconds::Now(), pDraw, C4GUI::Edit::pFont, C4GUI::Element::rcBounds, C4GUI::Window::rcClientRect, C4Draw::SetPrimaryClipper(), SLen(), C4Facet::Surface, C4TargetFacet::TargetX, C4TargetFacet::TargetY, C4GUI::Edit::Text, C4Draw::TextOut(), C4GUI::Edit::tLastInputTime, 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()

virtual void C4GUI::Container::ElementPosChanged ( Element *  pOfElement)
inlineprotectedvirtualinherited

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

Definition at line 754 of file C4Gui.h.

754 { } // called when an element position is changed

Referenced by C4GUI::ScrollWindow::ElementPosChanged(), and C4GUI::Element::UpdatePos().

Here is the caller graph for this function:

◆ ElementSizeChanged()

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

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

Definition at line 753 of file C4Gui.h.

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

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

Here is the caller graph for this function:

◆ end()

Iterator C4GUI::Container::end ( )
inlineinherited

Definition at line 825 of file C4Gui.h.

825 { return Iterator(nullptr); }

Referenced by C4ScriptGuiWindow::ClearPointers().

Here is the caller graph for this function:

◆ GetBounds()

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

Definition at line 445 of file C4Gui.h.

445 { return rcBounds; }

References C4GUI::Element::rcBounds.

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

Here is the caller graph for this function:

◆ GetClientRect()

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

Reimplemented from C4GUI::Element.

Definition at line 864 of file C4Gui.h.

864 { return rcClientRect; }

References C4GUI::Window::rcClientRect.

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

Here is the caller graph for this function:

◆ GetContainedClientRect()

C4Rect C4GUI::Element::GetContainedClientRect ( )
inlineinherited

Definition at line 448 of file C4Gui.h.

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

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

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

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

◆ GetContainer()

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

Reimplemented from C4GUI::Element.

Definition at line 831 of file C4Gui.h.

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

◆ GetContextHandler()

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

Reimplemented in C4GUI::Dialog.

Definition at line 429 of file C4Gui.cpp.

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

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

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

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

◆ GetCurrentWord()

bool C4GUI::Edit::GetCurrentWord ( char *  szTargetBuf,
int32_t  iMaxTargetBufLen 
)
inherited

Definition at line 676 of file C4GuiEdit.cpp.

677  {
678  // get word before cursor pos (for nick completion)
679  if (!Text || iCursorPos<=0) return false;
680  int32_t iPos = iCursorPos;
681  while (iPos>0)
682  if (IsWholeWordSpacer(Text[iPos-1])) break; else --iPos;
683  SCopy(Text + iPos, szTargetBuf, std::min(iCursorPos - iPos, iMaxTargetBufLen));
684  return !!*szTargetBuf;
685  }
void SCopy(const char *szSource, char *sTarget, size_t iMaxL)
Definition: Standard.cpp:152
bool IsWholeWordSpacer(unsigned char c)
Definition: C4GuiEdit.cpp:350

References C4GUI::Edit::iCursorPos, C4GUI::IsWholeWordSpacer(), SCopy(), and C4GUI::Edit::Text.

Here is the call graph for this function:

◆ GetCustomEditHeight()

int32_t C4GUI::Edit::GetCustomEditHeight ( CStdFont *  pUseFont)
staticinherited

Definition at line 119 of file C4GuiEdit.cpp.

120  {
121  // edit height for custom font: Make it so edits and wooden labels have same height
122  return std::max<int32_t>(pUseFont->GetLineHeight()+3, C4GUI_MinWoodBarHgt);
123  }
#define C4GUI_MinWoodBarHgt
Definition: C4Gui.h:158

References C4GUI_MinWoodBarHgt, and CStdFont::GetLineHeight().

Referenced by C4StartupPlrPropertiesDlg::C4StartupPlrPropertiesDlg(), C4GUI::LabeledEdit::GetControlSize(), and C4GUI::Edit::GetDefaultEditHeight().

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

◆ GetDefaultEditHeight()

int32_t C4GUI::Edit::GetDefaultEditHeight ( )
staticinherited

Definition at line 113 of file C4GuiEdit.cpp.

114  {
115  // edit height for default font
117  }
C4GraphicsResource GraphicsResource
static int32_t GetCustomEditHeight(CStdFont *pUseFont)
Definition: C4GuiEdit.cpp:119

References C4GUI::Edit::GetCustomEditHeight(), GraphicsResource, and C4GraphicsResource::TextFont.

Referenced by C4GUI::InputDialog::InputDialog(), C4GameLobby::MainDlg::MainDlg(), and C4ChatControl::UpdateSize().

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(), OnFinishInput(), C4GUI::Label::OnHotkey(), C4ChatControl::OnLoginDataEnter(), C4GUI::CloseButton::OnPress(), C4GUI::CloseIconButton::OnPress(), 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 C4GUI::ListBox::SortElements().

Here is the caller graph for this function:

◆ GetFirst()

◆ GetFirstContained()

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

Reimplemented from C4GUI::Element.

Definition at line 773 of file C4Gui.h.

773 { return pFirst; }

References C4GUI::Container::pFirst.

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

Here is the caller graph for this function:

◆ GetFirstNestedElement()

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

Reimplemented from C4GUI::Element.

Definition at line 204 of file C4GuiContainers.cpp.

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

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

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

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

◆ 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:

◆ GetLast()

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

Definition at line 830 of file C4Gui.h.

830 { return pLast; }

References C4GUI::Container::pLast.

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

Here is the caller graph for this function:

◆ GetLastContained()

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

Definition at line 774 of file C4Gui.h.

774 { return pLast; }

References C4GUI::Container::pLast.

◆ GetListItemTopSpacing()

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

Reimplemented in C4StartupNetListEntry, and C4StartupModsListEntry.

Definition at line 461 of file C4Gui.h.

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

References C4GUI_DefaultListSpacing.

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

Here is the caller graph for this function:

◆ GetListItemTopSpacingBar()

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

Definition at line 462 of file C4Gui.h.

462 { return false; }

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

Here is the caller graph for this function:

◆ GetMarginBottom()

int32_t C4GUI::Edit::GetMarginBottom ( )
inlineoverrideprotectedvirtualinherited

Reimplemented from C4GUI::Window.

Definition at line 1334 of file C4Gui.h.

1334 { return 2; }

◆ GetMarginLeft()

int32_t C4GUI::Edit::GetMarginLeft ( )
inlineoverrideprotectedvirtualinherited

Reimplemented from C4GUI::Window.

Definition at line 1332 of file C4Gui.h.

1332 { return 4; }

◆ GetMarginRight()

int32_t C4GUI::Edit::GetMarginRight ( )
inlineoverrideprotectedvirtualinherited

Reimplemented from C4GUI::Window.

Definition at line 1333 of file C4Gui.h.

1333 { return 4; }

◆ GetMarginTop()

int32_t C4GUI::Edit::GetMarginTop ( )
inlineoverrideprotectedvirtualinherited

Reimplemented from C4GUI::Window.

Definition at line 1331 of file C4Gui.h.

1331 { return 2; }

◆ 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 C4GUI::ListBox::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:

◆ GetText()

const char* C4GUI::Edit::GetText ( )
inlineinherited

Definition at line 1339 of file C4Gui.h.

1339 { return Text; }

References C4GUI::Edit::Text.

Referenced by C4StartupNetDlg::DoOK(), C4GUI::InputDialog::GetInputText(), C4GUI::LabeledEdit::GetText(), C4GameLobby::MainDlg::OnChatInput(), C4GUI::InputDialog::OnClosed(), C4StartupPlrPropertiesDlg::OnClosed(), C4ChatControl::OnConnectBtn(), and C4StartupPlrPropertiesDlg::UserClose().

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(), C4GUI::ListBox::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(), C4GUI::ListBox::IsFocused(), and C4GUI::Control::MouseInput().

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

◆ InsertElement()

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

Definition at line 150 of file C4GuiContainers.cpp.

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

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

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

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

◆ InsertText()

bool C4GUI::Edit::InsertText ( const char *  szText,
bool  fUser 
)
inherited

Definition at line 163 of file C4GuiEdit.cpp.

164  {
165  // empty previous selection
167  // check buffer length
168  int32_t iTextLen = SLen(szText);
169  int32_t iTextEnd = SLen(Text);
170  bool fBufferOK = (iTextLen + iTextEnd <= (iMaxTextLength-1));
171  if (!fBufferOK) iTextLen -= iTextEnd+iTextLen - (iMaxTextLength-1);
172  if (iTextLen <= 0) return false;
173  // ensure buffer is large enough
174  EnsureBufferSize(iTextEnd + iTextLen + 1);
175  // move down text buffer after cursor pos (including trailing zero-char)
176  int32_t i;
177  for (i=iTextEnd; i>=iCursorPos; --i) Text[i + iTextLen] = Text[i];
178  // insert buffer into text
179  for (i=iTextLen; i; --i) Text[iCursorPos + i - 1] = szText[i - 1];
180  if (fUser)
181  {
182  // advance cursor
183  iCursorPos += iTextLen;
184  // cursor moved: ensure it is shown
186  ScrollCursorInView();
187  }
188  // done; return whether everything was inserted
189  return fBufferOK;
190  }
void DeleteSelection()
Definition: C4GuiEdit.cpp:149
int32_t iMaxTextLength
Definition: C4Gui.h:1311

References C4GUI::Edit::DeleteSelection(), C4GUI::Edit::iCursorPos, C4GUI::Edit::iMaxTextLength, C4GUI::Edit::iSelectionEnd, C4GUI::Edit::iSelectionStart, C4TimeMilliseconds::Now(), SLen(), C4GUI::Edit::Text, and C4GUI::Edit::tLastInputTime.

Referenced by C4ChatInputDialog::C4ChatInputDialog(), C4StartupPlrPropertiesDlg::C4StartupPlrPropertiesDlg(), C4GUI::Edit::CharIn(), C4GameLobby::MainDlg::KeyHistoryUpDown(), C4GUI::LabeledEdit::LabeledEdit(), C4GUI::Edit::MouseInput(), RenameEdit(), C4GUI::InputDialog::SetInputText(), and C4GUI::Edit::SetText().

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

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

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

Definition at line 836 of file C4Gui.h.

836 { return pParent ? pParent->IsFocused(pCtrl) : false; }

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

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

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

◆ IsFocusElement()

Control* C4GUI::Control::IsFocusElement ( )
inlineoverrideprotectedvirtualinherited

Reimplemented from C4GUI::Element.

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

Definition at line 1055 of file C4Gui.h.

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

Referenced by C4GUI::CheckBox::IsFocusElement(), and C4GUI::Control::MouseInput().

Here is the caller graph for this function:

◆ IsFocusOnClick()

bool C4GUI::Edit::IsFocusOnClick ( )
inlineoverrideprotectedvirtualinherited

Reimplemented from C4GUI::Control.

Definition at line 1320 of file C4Gui.h.

1320 { return true; } // edit fields 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:

◆ IsOwnPtrElement()

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

Reimplemented in C4Menu.

Definition at line 401 of file C4Gui.h.

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

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

Here is the caller graph for this function:

◆ IsParentOf()

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

Reimplemented from C4GUI::Element.

Definition at line 239 of file C4GuiContainers.cpp.

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

References C4GUI::Element::GetParent().

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

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

◆ IsSelectedChild()

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

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

Definition at line 837 of file C4Gui.h.

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

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

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

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

◆ IsVisible()

bool C4GUI::Element::IsVisible ( )
inherited

◆ KeyAbort()

bool C4GUI::RenameEdit::KeyAbort ( )
inlineprotected

Definition at line 1402 of file C4Gui.h.

1402 { Abort(); return true; }

References Abort().

Referenced by RenameEdit().

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

◆ KeyContext()

bool C4GUI::Control::KeyContext ( )
inlineprotectedinherited

Definition at line 1059 of file C4Gui.h.

1059 { return DoContext(); }
bool DoContext()
Definition: C4Gui.cpp:417

References C4GUI::Element::DoContext().

Referenced by C4GUI::Control::Control().

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

◆ MakeLastElement()

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

Definition at line 106 of file C4GuiContainers.cpp.

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

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

Referenced by 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::Edit::MouseInput ( CMouse &  rMouse,
int32_t  iButton,
int32_t  iX,
int32_t  iY,
DWORD  dwKeyParam 
)
overridevirtualinherited

Reimplemented from C4GUI::Control.

Definition at line 464 of file C4GuiEdit.cpp.

465  {
466  // inherited first - this may give focus to this element
467  Control::MouseInput(rMouse, iButton, iX, iY, dwKeyParam);
468  // update dragging area
469  int32_t iPrevCursorPos = iCursorPos;
470  // dragging area is updated by drag proc
471  // process left down and up
472  switch (iButton)
473  {
475  // mark button as being down
476  fLeftBtnDown = true;
477  // set selection start
478  iSelectionStart = iSelectionEnd = GetCharPos(iX);
479  // set cursor pos here, too
481  // remember drag target
482  // no dragging movement will be done w/o drag component assigned
483  // but text selection should work even if the user goes outside the component
484  if (!rMouse.pDragElement) rMouse.pDragElement = this;
485  break;
486 
487  case C4MC_Button_LeftUp:
488  // only if button was down... (might have dragged here)
489  if (fLeftBtnDown)
490  {
491  // it's now up :)
492  fLeftBtnDown = false;
493  // set cursor to this pos
495  }
496  break;
497 
499  {
500  // word selection
501  // get character pos (half-char-offset, use this to allow selection at half-space-offset around a word)
502  int32_t iCharPos = GetCharPos(iX);
503  // was space? try left character
504  if (IsWholeWordSpacer(Text[iCharPos]))
505  {
506  if (!iCharPos) break;
507  if (IsWholeWordSpacer(Text[--iCharPos])) break;
508  }
509  // search ending of word left and right
510  // bounds-check is done by zero-char at end, which is regarded as a spacer
511  iSelectionStart = iCharPos; iSelectionEnd = iCharPos + 1;
514  // set cursor pos to end of selection
516  // ignore last btn-down-selection
517  fLeftBtnDown = false;
518  }
519  break;
521  // set selection start
522  iSelectionStart = iSelectionEnd = GetCharPos(iX);
523  // set cursor pos here, too
525 #ifndef _WIN32
526  // Insert primary selection
527  InsertText(Application.Paste(false).c_str(), true);
528 #endif
529  break;
530  };
531  // scroll cursor in view
532  if (iPrevCursorPos != iCursorPos) ScrollCursorInView();
533  }
C4Application Application
Definition: C4Globals.cpp:44
const int32_t C4MC_Button_MiddleDown
const int32_t C4MC_Button_LeftUp
const int32_t C4MC_Button_LeftDown
const int32_t C4MC_Button_LeftDouble
std::string Paste(bool fClipboard=true)
Definition: C4AppMac.mm:47
void MouseInput(CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam) override
bool fLeftBtnDown
Definition: C4Gui.h:1316

References Application, C4MC_Button_LeftDouble, C4MC_Button_LeftDown, C4MC_Button_LeftUp, C4MC_Button_MiddleDown, C4GUI::Edit::fLeftBtnDown, C4GUI::Edit::iCursorPos, C4GUI::Edit::InsertText(), C4GUI::Edit::iSelectionEnd, C4GUI::Edit::iSelectionStart, C4GUI::IsWholeWordSpacer(), C4GUI::Control::MouseInput(), C4AbstractApp::Paste(), C4GUI::CMouse::pDragElement, and C4GUI::Edit::Text.

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:

◆ OnAbortInput()

virtual void C4GUI::Edit::OnAbortInput ( )
inlineprotectedvirtualinherited

Reimplemented in C4GUI::CallbackEdit< CallbackCtrl >.

Definition at line 1328 of file C4Gui.h.

1328 {}

◆ OnCancelRename()

virtual void C4GUI::RenameEdit::OnCancelRename ( )
inlineprotectedvirtual

Reimplemented in C4GUI::CallbackRenameEdit< CallbackDlg, ParType >.

Definition at line 1406 of file C4Gui.h.

1406 {} // renaming was aborted

Referenced by Abort(), and OnFinishInput().

Here is the caller graph for this function:

◆ OnContext()

ContextMenu * C4GUI::Edit::OnContext ( C4GUI::Element *  pListItem,
int32_t  iX,
int32_t  iY 
)
protectedinherited

Definition at line 650 of file C4GuiEdit.cpp.

651  {
652  // safety: no text?
653  if (!Text) return nullptr;
654  // create context menu
655  ContextMenu *pCtx = new ContextMenu();
656  // fill with any valid items
657  // get selected range
658  uint32_t iSelBegin = std::min(iSelectionStart, iSelectionEnd), iSelEnd = std::max(iSelectionStart, iSelectionEnd);
659  bool fAnythingSelected = (iSelBegin != iSelEnd);
660  if (fAnythingSelected)
661  {
662  pCtx->AddItem(LoadResStr("IDS_DLG_CUT"), LoadResStr("IDS_DLGTIP_CUT"), Ico_None, new CBMenuHandler<Edit>(this, &Edit::OnCtxCut));
663  pCtx->AddItem(LoadResStr("IDS_DLG_COPY"), LoadResStr("IDS_DLGTIP_COPY"), Ico_None, new CBMenuHandler<Edit>(this, &Edit::OnCtxCopy));
664  }
666  pCtx->AddItem(LoadResStr("IDS_DLG_PASTE"), LoadResStr("IDS_DLGTIP_PASTE"), Ico_None, new CBMenuHandler<Edit>(this, &Edit::OnCtxPaste));
667 
668  if (fAnythingSelected)
669  pCtx->AddItem(LoadResStr("IDS_DLG_CLEAR"), LoadResStr("IDS_DLGTIP_CLEAR"), Ico_None, new CBMenuHandler<Edit>(this, &Edit::OnCtxClear));
670  if (*Text && (iSelBegin!=0 || iSelEnd!=SLen(Text)))
671  pCtx->AddItem(LoadResStr("IDS_DLG_SELALL"), LoadResStr("IDS_DLGTIP_SELALL"), Ico_None, new CBMenuHandler<Edit>(this, &Edit::OnCtxSelAll));
672  // return ctx menu
673  return pCtx;
674  }
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
bool IsClipboardFull(bool fClipboard=true)
Definition: C4AppMac.mm:58
void OnCtxSelAll(C4GUI::Element *pThis)
Definition: C4Gui.h:1284
void OnCtxCopy(C4GUI::Element *pThis)
Definition: C4Gui.h:1280
void OnCtxClear(C4GUI::Element *pThis)
Definition: C4Gui.h:1283
void OnCtxCut(C4GUI::Element *pThis)
Definition: C4Gui.h:1282
void OnCtxPaste(C4GUI::Element *pThis)
Definition: C4Gui.h:1281
@ Ico_None
Definition: C4Gui.h:640

References C4GUI::ContextMenu::AddItem(), Application, C4GUI::Ico_None, C4AbstractApp::IsClipboardFull(), C4GUI::Edit::iSelectionEnd, C4GUI::Edit::iSelectionStart, LoadResStr(), C4GUI::Edit::OnCtxClear(), C4GUI::Edit::OnCtxCopy(), C4GUI::Edit::OnCtxCut(), C4GUI::Edit::OnCtxPaste(), C4GUI::Edit::OnCtxSelAll(), SLen(), and C4GUI::Edit::Text.

Referenced by C4GUI::Edit::Edit().

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

◆ OnCtxClear()

void C4GUI::Edit::OnCtxClear ( C4GUI::Element *  pThis)
inlineprotectedinherited

Definition at line 1283 of file C4Gui.h.

1283 { DeleteSelection(); };

References C4GUI::Edit::DeleteSelection().

Referenced by C4GUI::Edit::OnContext().

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

◆ OnCtxCopy()

void C4GUI::Edit::OnCtxCopy ( C4GUI::Element *  pThis)
inlineprotectedinherited

Definition at line 1280 of file C4Gui.h.

1280 { Copy(); };

Referenced by C4GUI::Edit::OnContext().

Here is the caller graph for this function:

◆ OnCtxCut()

void C4GUI::Edit::OnCtxCut ( C4GUI::Element *  pThis)
inlineprotectedinherited

Definition at line 1282 of file C4Gui.h.

1282 { Cut(); };

Referenced by C4GUI::Edit::OnContext().

Here is the caller graph for this function:

◆ OnCtxPaste()

void C4GUI::Edit::OnCtxPaste ( C4GUI::Element *  pThis)
inlineprotectedinherited

Definition at line 1281 of file C4Gui.h.

1281 { Paste(); };

Referenced by C4GUI::Edit::OnContext().

Here is the caller graph for this function:

◆ OnCtxSelAll()

void C4GUI::Edit::OnCtxSelAll ( C4GUI::Element *  pThis)
inlineprotectedinherited

Definition at line 1284 of file C4Gui.h.

1284 { SelectAll(); };
void SelectAll()
Definition: C4GuiEdit.cpp:641

References C4GUI::Edit::SelectAll().

Referenced by C4GUI::Edit::OnContext().

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

◆ OnFinishInput()

Edit::InputResult C4GUI::RenameEdit::OnFinishInput ( bool  fPasting,
bool  fPastingMore 
)
overrideprotectedvirtual

Reimplemented from C4GUI::Edit.

Definition at line 730 of file C4GuiEdit.cpp.

731  {
732  // any text?
733  if (!Text || !*Text)
734  {
735  // OK without text is regarded as abort
736  OnCancelRename();
737  FinishRename();
738  }
739  else switch (OnOKRename(Text))
740  {
741  case RR_Invalid:
742  {
743  // new name was not accepted: Continue editing
744  Dialog *pDlg = GetDlg();
745  if (pDlg) if (pDlg->GetFocus() != this) pDlg->SetFocus(this, false);
746  SelectAll();
747  break;
748  }
749 
750  case RR_Accepted:
751  // okay, rename to that text
752  FinishRename();
753  break;
754 
755  case RR_Deleted:
756  // this is invalid; don't do anything!
757  break;
758  }
759  return IR_Abort;
760  }
virtual RenameResult OnOKRename(const char *szNewName)=0

References C4GUI::Element::GetDlg(), C4GUI::Dialog::GetFocus(), C4GUI::Edit::IR_Abort, OnCancelRename(), OnOKRename(), RR_Accepted, RR_Deleted, RR_Invalid, C4GUI::Edit::SelectAll(), C4GUI::Dialog::SetFocus(), and C4GUI::Edit::Text.

Referenced by OnLooseFocus().

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

◆ OnGetFocus()

void C4GUI::Edit::OnGetFocus ( bool  fByMouse)
overrideprotectedvirtualinherited

Reimplemented from C4GUI::Control.

Definition at line 544 of file C4GuiEdit.cpp.

545  {
546  // inherited
547  Control::OnGetFocus(fByMouse);
548  // select all
550  // begin with a flashing cursor
552  }
virtual void OnGetFocus(bool fByMouse)
Definition: C4Gui.h:1056

References C4GUI::Edit::iCursorPos, C4GUI::Edit::iSelectionEnd, C4GUI::Edit::iSelectionStart, C4TimeMilliseconds::Now(), C4GUI::Control::OnGetFocus(), SLen(), C4GUI::Edit::Text, and C4GUI::Edit::tLastInputTime.

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

void C4GUI::RenameEdit::OnLooseFocus ( )
overrideprotectedvirtual

Reimplemented from C4GUI::Edit.

Definition at line 772 of file C4GuiEdit.cpp.

773  {
775  // callback when control looses focus: OK input
776  if (!fFinishing) OnFinishInput(false, false);
777  }
void OnLooseFocus() override
Definition: C4GuiEdit.cpp:554
InputResult OnFinishInput(bool fPasting, bool fPastingMore) override
Definition: C4GuiEdit.cpp:730

References OnFinishInput(), and C4GUI::Edit::OnLooseFocus().

Here is the call graph for this function:

◆ OnOKRename()

virtual RenameResult C4GUI::RenameEdit::OnOKRename ( const char *  szNewName)
protectedpure virtual

Implemented in C4GUI::CallbackRenameEdit< CallbackDlg, ParType >.

Referenced by OnFinishInput().

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 C4GUI::ListBox::SortElements().

Here is the caller graph for this function:

◆ RemoveElement()

void C4GUI::Container::RemoveElement ( Element *  pChild)
overridevirtualinherited

Reimplemented from C4GUI::Element.

Reimplemented in C4GUI::Screen, C4GUI::Dialog, C4GUI::ContextMenu, C4GUI::Tabular, and C4GUI::ListBox.

Definition at line 89 of file C4GuiContainers.cpp.

90  {
91  // safety
92  if (!pChild) return;
93  // inherited
94  Element::RemoveElement(pChild);
95  // must be from same container
96  if (pChild->pParent != this) return;
97  // unlink from list
98  if (pChild->pPrev) pChild->pPrev->pNext = pChild->pNext; else pFirst = pChild->pNext;
99  if (pChild->pNext) pChild->pNext->pPrev = pChild->pPrev; else pLast = pChild->pPrev;
100  // unset parent; invalidates pPrev/pNext
101  pChild->pParent = nullptr;
102  // element has been removed
104  }
virtual void RemoveElement(Element *pChild)
Definition: C4Gui.cpp:173

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

Referenced by C4GUI::Container::AddElement(), C4GUI::Container::InsertElement(), C4ScriptGuiWindow::RemoveChild(), C4GUI::Element::RemoveElement(), C4GUI::ListBox::RemoveElement(), C4GUI::Tabular::RemoveElement(), C4GUI::ContextMenu::RemoveElement(), C4GUI::Dialog::RemoveElement(), C4GUI::Screen::RemoveElement(), and C4GUI::Element::~Element().

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

◆ rend()

ReverseIterator C4GUI::Container::rend ( )
inlineinherited

Definition at line 827 of file C4Gui.h.

827 { return ReverseIterator(nullptr); }

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

Here is the caller graph for this function:

◆ 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:

◆ SelectAll()

void C4GUI::Edit::SelectAll ( )
inherited

Definition at line 641 of file C4GuiEdit.cpp.

642  {
643  // safety: no text?
644  if (!Text) return;
645  // select all
646  iSelectionStart = 0;
648  }

References C4GUI::Edit::iCursorPos, C4GUI::Edit::iSelectionEnd, C4GUI::Edit::iSelectionStart, SLen(), and C4GUI::Edit::Text.

Referenced by C4GameLobby::MainDlg::KeyHistoryUpDown(), C4GameLobby::MainDlg::OnChatInput(), C4GUI::Edit::OnCtxSelAll(), OnFinishInput(), and C4GUI::InputDialog::SetInputText().

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
virtual void UpdatePos()
Definition: C4Gui.cpp:193

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

Referenced by C4GameOptionButtons::C4GameOptionButtons(), C4GoalDisplay::C4GoalDisplay(), C4StartupModsListEntry::C4StartupModsListEntry(), C4StartupNetDlg::C4StartupNetDlg(), C4StartupNetListEntry::C4StartupNetListEntry(), C4GUI::ContextButton::ContextButton(), C4GUI::ListBox::ContractToElementHeight(), C4GUI::Control::Control(), C4GUI::Dialog::Dialog(), C4ChatDlg::DoPlacement(), C4StartupNetListEntry::Execute(), C4GUI::FullscreenDialog::FullscreenDialog(), C4GUI::GroupBox::GroupBox(), C4GUI::HorizontalLine::HorizontalLine(), 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(), C4GUI::ListBox::UpdateElementPositions(), C4Menu::UpdateElementPositions(), C4GUI::ScrollWindow::UpdateOwnPos(), C4ChatControl::UpdateSize(), C4ChatDlg::UpdateSize(), C4GUI::TextWindow::UpdateSize(), and C4GUI::Dialog::UpdateSize().

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

◆ SetColors()

void C4GUI::Edit::SetColors ( uint32_t  dwNewBGClr,
uint32_t  dwNewFontClr,
uint32_t  dwNewBorderColor 
)
inlineinherited

Definition at line 1349 of file C4Gui.h.

1350  { dwBGClr = dwNewBGClr; dwFontClr = dwNewFontClr; dwBorderColor = dwNewBorderColor; }

References C4GUI::Edit::dwBGClr, C4GUI::Edit::dwBorderColor, and C4GUI::Edit::dwFontClr.

Referenced by C4StartupPlrPropertiesDlg::C4StartupPlrPropertiesDlg().

Here is the caller graph for this function:

◆ SetContextHandler()

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

Definition at line 465 of file C4Gui.h.

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

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

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

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

◆ SetDragTarget()

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

Definition at line 464 of file C4Gui.h.

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

References C4GUI::Element::pDragTarget.

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

Here is the caller graph for this function:

◆ SetFont()

void C4GUI::Edit::SetFont ( CStdFont *  pToFont)
inlineinherited

Definition at line 1348 of file C4Gui.h.

1348 { pFont=pToFont; ScrollCursorInView(); }

References C4GUI::Edit::pFont.

Referenced by C4StartupPlrPropertiesDlg::C4StartupPlrPropertiesDlg(), and C4GUI::LabeledEdit::LabeledEdit().

Here is the caller graph for this function:

◆ SetMaxText()

void C4GUI::Edit::SetMaxText ( int32_t  iTo)
inlineinherited

Definition at line 1352 of file C4Gui.h.

1352 { iMaxTextLength = iTo; }

References C4GUI::Edit::iMaxTextLength.

Referenced by C4StartupPlrPropertiesDlg::C4StartupPlrPropertiesDlg(), and C4GUI::InputDialog::SetMaxText().

Here is the caller graph for this function:

◆ SetPasswordMask()

void C4GUI::Edit::SetPasswordMask ( char  cNewPasswordMask)
inlineinherited

Definition at line 1294 of file C4Gui.h.

1294 { cPasswordMask = cNewPasswordMask; } // mask edit box contents using the given character

References C4GUI::Edit::cPasswordMask.

Referenced by C4ChatControl::C4ChatControl(), and C4LeagueSignupDialog::C4LeagueSignupDialog().

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:

◆ SetText()

bool C4GUI::Edit::SetText ( const char *  szText,
bool  fUser 
)
inlineinherited

Definition at line 1293 of file C4Gui.h.

1293 { ClearText(); return InsertText(szText, fUser); }
void ClearText()
Definition: C4GuiEdit.cpp:125

References C4GUI::Edit::ClearText(), and C4GUI::Edit::InsertText().

Referenced by C4ChatControl::C4ChatControl(), C4ChatControl::OnConnectBtn(), C4ChatControl::UpdateTitle(), and C4LeagueSignupDialog::UserClose().

Here is the call graph for this function:
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

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:

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

◆ UpdateOwnPos()

void C4GUI::Window::UpdateOwnPos ( )
overridevirtualinherited

Reimplemented from C4GUI::Element.

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

Definition at line 324 of file C4GuiContainers.cpp.

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

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

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

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

◆ UpdatePos()

void C4GUI::Element::UpdatePos ( )
protectedvirtualinherited

Reimplemented in C4GUI::Dialog.

Definition at line 193 of file C4Gui.cpp.

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

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

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

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

◆ UpdateSize()

void C4GUI::Element::UpdateSize ( )
protectedvirtualinherited

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

Definition at line 185 of file C4Gui.cpp.

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

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

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

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

Member Data Documentation

◆ cPasswordMask

char C4GUI::Edit::cPasswordMask
protectedinherited

◆ dwBGClr

uint32_t C4GUI::Edit::dwBGClr
protectedinherited

Definition at line 1307 of file C4Gui.h.

Referenced by C4GUI::Edit::DrawElement(), C4GUI::Edit::Edit(), and C4GUI::Edit::SetColors().

◆ dwBorderColor

uint32_t C4GUI::Edit::dwBorderColor
protectedinherited

Definition at line 1307 of file C4Gui.h.

Referenced by C4GUI::Edit::DrawElement(), C4GUI::Edit::Edit(), and C4GUI::Edit::SetColors().

◆ dwFontClr

uint32_t C4GUI::Edit::dwFontClr
protectedinherited

Definition at line 1307 of file C4Gui.h.

Referenced by C4GUI::Edit::DrawElement(), C4GUI::Edit::Edit(), and C4GUI::Edit::SetColors().

◆ fDragging

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

Definition at line 380 of file C4Gui.h.

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

◆ fLeftBtnDown

bool C4GUI::Edit::fLeftBtnDown
protectedinherited

Definition at line 1316 of file C4Gui.h.

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

◆ fVisible

◆ iBufferSize

int32_t C4GUI::Edit::iBufferSize
protectedinherited

Definition at line 1308 of file C4Gui.h.

Referenced by C4GUI::Edit::ClearText(), and C4GUI::Edit::Edit().

◆ iCursorPos

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

◆ iMaxTextLength

int32_t C4GUI::Edit::iMaxTextLength
protectedinherited

Definition at line 1311 of file C4Gui.h.

Referenced by C4GUI::Edit::Edit(), C4GUI::Edit::InsertText(), and C4GUI::Edit::SetMaxText().

◆ iSelectionEnd

◆ iSelectionStart

◆ iXScroll

int32_t C4GUI::Edit::iXScroll
protectedinherited

Definition at line 1313 of file C4Gui.h.

Referenced by C4GUI::Edit::ClearText(), C4GUI::Edit::DrawElement(), and C4GUI::Edit::Edit().

◆ pContextHandler

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

◆ pDragTarget

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

◆ pFirst

◆ pFont

CStdFont* C4GUI::Edit::pFont
protectedinherited

Definition at line 1305 of file C4Gui.h.

Referenced by C4GUI::Edit::DrawElement(), C4GUI::Edit::Edit(), and C4GUI::Edit::SetFont().

◆ pLast

◆ pNext

◆ pParent

◆ pPrev

◆ rcBounds

C4Rect C4GUI::Element::rcBounds
protectedinherited

Definition at line 385 of file C4Gui.h.

Referenced by C4Chart::C4Chart(), C4GameOptionButtons::C4GameOptionButtons(), C4GoalDisplay::C4GoalDisplay(), C4StartupMainDlg::C4StartupMainDlg(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4GUI::Element::ClientPos2ScreenPos(), C4GUI::ContextMenu::ContextMenu(), C4GUI::Dialog::CreateConsoleWindow(), C4GUI::ContextMenu::CtxMouseInput(), C4FileSelDlg::DefaultListItem::DefaultListItem(), C4GUI::Dialog::Dialog(), C4GUI::Element::DoContext(), C4GUI::Element::DoDragging(), C4ScoreboardDlg::DoPlacement(), C4GUI::Dialog::Draw(), C4ScriptGuiWindow::Draw(), C4GUI::Element::Draw3DFrame(), C4GUI::Element::DrawBar(), C4ScriptGuiWindow::DrawChildren(), C4GUI::Label::DrawElement(), C4GUI::WoodenLabel::DrawElement(), C4GUI::MultilineLabel::DrawElement(), C4GUI::ProgressBar::DrawElement(), C4GUI::HorizontalLine::DrawElement(), C4GUI::Picture::DrawElement(), C4GUI::OverlayPicture::DrawElement(), C4GUI::ScrollBar::DrawElement(), C4GUI::GroupBox::DrawElement(), C4GUI::PaintBox::DrawElement(), C4GUI::Button::DrawElement(), C4GUI::IconButton::DrawElement(), C4GUI::ArrowButton::DrawElement(), C4GUI::FacetButton::DrawElement(), C4GUI::Edit::DrawElement(), C4GUI::CheckBox::DrawElement(), C4GUI::ListBox::DrawElement(), C4GUI::Tabular::DrawElement(), C4GUI::TextWindow::DrawElement(), C4GUI::ContextMenu::Entry::DrawElement(), C4GUI::ContextMenu::DrawElement(), C4GUI::ContextButton::DrawElement(), C4GUI::ComboBox::DrawElement(), C4GUI::Dialog::DrawElement(), C4MenuItem::DrawElement(), C4Menu::DrawElement(), C4StartupMainDlg::DrawElement(), C4StartupNetListEntry::DrawElement(), C4StartupPlrPropertiesDlg::DrawElement(), C4Chart::DrawElement(), C4GUI::Element::DrawHBarByVGfx(), C4GUI::Element::DrawHVBar(), C4GUI::Element::DrawVBar(), C4GUI::Element::Element(), C4GUI::ContextMenu::Entry::Entry(), C4GUI::Element::GetBounds(), C4GUI::Element::GetClientRect(), C4ScriptGuiWindow::GetClippingRect(), C4GUI::Element::GetHeight(), C4GUI::WoodenLabel::GetLeftIndent(), C4GUI::Tabular::GetMarginBottom(), C4GUI::Tabular::GetMarginLeft(), C4GUI::Tabular::GetMarginRight(), C4GUI::Tabular::GetMarginTop(), C4StartupPlrSelDlg::GetMarginTop(), C4StartupScenSelDlg::GetMarginTop(), C4GUI::Element::GetWidth(), C4GUI::ScrollBar::HasPin(), C4Menu::InitLocation(), C4Menu::InitSize(), C4GUI::ScrollWindow::IsScrollingNecessary(), C4GUI::Label::Label(), C4GUI::LabeledEdit::LabeledEdit(), C4GUI::Window::MouseInput(), C4GUI::CheckBox::MouseInput(), C4GUI::Tabular::MouseInput(), C4GUI::ContextMenu::MouseInput(), C4ScriptGuiWindow::MouseInput(), 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

◆ Text

◆ tLastInputTime

C4TimeMilliseconds C4GUI::Edit::tLastInputTime
protectedinherited

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