OpenClonk
C4MenuItem Class Reference

#include <C4Menu.h>

Inheritance diagram for C4MenuItem:
[legend]
Collaboration diagram for C4MenuItem:
[legend]

Public Member Functions

 ~C4MenuItem () override
 
C4ID GetC4ID () const
 
int32_t GetValue () const
 
C4ObjectGetObject () const
 
const char * GetCommand () const
 
void ClearPointers (C4Object *pObj)
 
void MouseInput (class C4GUI::CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam) override
 
void MouseEnter (class C4GUI::CMouse &rMouse) override
 
virtual ContainerGetContainer ()
 
virtual void MouseLeave (CMouse &rMouse)
 
virtual void StartDragging (CMouse &rMouse, int32_t iX, int32_t iY, DWORD dwKeyParam)
 
virtual void DoDragging (CMouse &rMouse, int32_t iX, int32_t iY, DWORD dwKeyParam)
 
virtual void StopDragging (CMouse &rMouse, int32_t iX, int32_t iY, DWORD dwKeyParam)
 
virtual bool OnHotkey (uint32_t cHotkey)
 
bool DoContext ()
 
ContainerGetParent ()
 
virtual class Dialog * GetDlg ()
 
virtual Screen * GetScreen ()
 
virtual ControlIsFocusElement ()
 
virtual void UpdateOwnPos ()
 
void ScreenPos2ClientPos (int32_t &riX, int32_t &riY)
 
void ClientPos2ScreenPos (int32_t &riX, int32_t &riY)
 
void SetToolTip (const char *szNewTooltip, bool is_immediate=false)
 
const char * GetToolTip ()
 
const char * GetOwnToolTip ()
 
bool IsImmediateToolTip () const
 
int32_t GetWidth ()
 
int32_t GetHeight ()
 
C4RectGetBounds ()
 
void SetBounds (const C4Rect &rcNewBound)
 
virtual C4RectGetClientRect ()
 
C4Rect GetContainedClientRect ()
 
ElementGetNext () const
 
ElementGetPrev () const
 
virtual ElementGetFirstNestedElement (bool fBackwards)
 
virtual ElementGetFirstContained ()
 
bool IsInActiveDlg (bool fForKeyboard)
 
virtual bool IsParentOf (Element *pEl)
 
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 void SetVisibility (bool fToValue)
 
virtual int32_t GetListItemTopSpacing ()
 
virtual bool GetListItemTopSpacingBar ()
 
void SetDragTarget (Window *pToWindow)
 
void SetContextHandler (ContextHandler *pNewHd)
 
virtual ContextHandler * GetContextHandler ()
 

Public Attributes

bool fVisible {true}
 

Protected Member Functions

void DrawElement (C4TargetFacet &cgo) override
 
 C4MenuItem (C4Menu *pMenu, int32_t iIndex, const char *szCaption, const char *szCommand, int32_t iCount, C4Object *pObject, const char *szInfoCaption, C4ID idID, const char *szCommand2, bool fOwnValue, int32_t iValue, int32_t iStyle, bool fIsSelectable)
 
void GrabSymbol (C4FacetSurface &fctSymbol)
 
void SetGraphics (C4Object *pObj)
 
void SetGraphics (C4DefGraphics *pGfx)
 
void RefSymbol (const C4Facet &fctSymbol)
 
void SetSelected (bool fToVal)
 
void DoTextProgress (int32_t &riByVal)
 
virtual void Draw (C4TargetFacet &cgo)
 
virtual void RemoveElement (Element *pChild)
 
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

char Caption [C4MaxTitle+1]
 
char Command [_MAX_FNAME_LEN+30]
 
char Command2 [_MAX_FNAME_LEN+30]
 
char InfoCaption [2 *C4MaxTitle+1]
 
int32_t Count
 
C4ID id
 
C4ObjectObject
 
C4FacetSurface Symbol
 
C4ObjectpSymbolObj
 
C4DefGraphicspSymbolGraphics
 
uint32_t dwSymbolClr
 
bool fOwnValue
 
int32_t iValue
 
bool fSelected
 
int32_t iStyle
 
class C4MenupMenu
 
int32_t iIndex
 
bool IsSelectable
 
int32_t TextDisplayProgress
 
ContainerpParent {nullptr}
 
ElementpPrev
 
ElementpNext
 
Window * pDragTarget {nullptr}
 
int32_t iDragX
 
int32_t iDragY
 
bool fDragging {false}
 
ContextHandler * pContextHandler {nullptr}
 
C4Rect rcBounds
 

Friends

class C4Menu
 

Detailed Description

Definition at line 65 of file C4Menu.h.

Constructor & Destructor Documentation

◆ ~C4MenuItem()

C4MenuItem::~C4MenuItem ( )
override

Definition at line 66 of file C4Menu.cpp.

67 {
68  Symbol.Clear();
69 }
void Clear()
Definition: C4FacetEx.h:44
C4FacetSurface Symbol
Definition: C4Menu.h:78

References C4FacetSurface::Clear(), and Symbol.

Here is the call graph for this function:

◆ C4MenuItem()

C4MenuItem::C4MenuItem ( C4Menu pMenu,
int32_t  iIndex,
const char *  szCaption,
const char *  szCommand,
int32_t  iCount,
C4Object pObject,
const char *  szInfoCaption,
C4ID  idID,
const char *  szCommand2,
bool  fOwnValue,
int32_t  iValue,
int32_t  iStyle,
bool  fIsSelectable 
)
protected

Definition at line 48 of file C4Menu.cpp.

51  : C4GUI::Element(), Count(iCount), id(idID), Object(pObject), pSymbolObj(nullptr), pSymbolGraphics(nullptr), dwSymbolClr(0u),
53  iIndex(iIndex), IsSelectable(fIsSelectable), TextDisplayProgress(-1)
54 {
56  Symbol.Default();
57  SCopy(szCaption,Caption,C4MaxTitle);
58  SCopy(szCommand,Command,_MAX_FNAME+30);
59  SCopy(szCommand2,Command2,_MAX_FNAME+30);
60  SCopy(szInfoCaption,InfoCaption,C4MaxTitle);
61  // some info caption corrections
62  SReplaceChar(InfoCaption, 10, ' '); SReplaceChar(InfoCaption, 13, '|');
64 }
const size_t C4MaxTitle
Definition: C4Constants.h:25
#define _MAX_FNAME
void SReplaceChar(char *str, char fc, char tc)
Definition: Standard.cpp:354
void SCopy(const char *szSource, char *sTarget, size_t iMaxL)
Definition: Standard.cpp:152
void Default()
Definition: C4FacetEx.h:43
void SetToolTip(const char *szNewTooltip, bool is_immediate=false)
Definition: C4Gui.cpp:409
class C4Menu * pMenu
Definition: C4Menu.h:86
C4ID id
Definition: C4Menu.h:76
bool IsSelectable
Definition: C4Menu.h:88
char InfoCaption[2 *C4MaxTitle+1]
Definition: C4Menu.h:74
int32_t iValue
Definition: C4Menu.h:83
uint32_t dwSymbolClr
Definition: C4Menu.h:81
char Caption[C4MaxTitle+1]
Definition: C4Menu.h:71
C4DefGraphics * pSymbolGraphics
Definition: C4Menu.h:80
char Command[_MAX_FNAME_LEN+30]
Definition: C4Menu.h:72
bool fSelected
Definition: C4Menu.h:84
int32_t iStyle
Definition: C4Menu.h:85
bool fOwnValue
Definition: C4Menu.h:82
char Command2[_MAX_FNAME_LEN+30]
Definition: C4Menu.h:73
C4Object * pSymbolObj
Definition: C4Menu.h:79
int32_t TextDisplayProgress
Definition: C4Menu.h:89
int32_t Count
Definition: C4Menu.h:75
C4Object * Object
Definition: C4Menu.h:77
int32_t iIndex
Definition: C4Menu.h:87

References _MAX_FNAME, C4MaxTitle, Caption, Command, Command2, C4FacetSurface::Default(), InfoCaption, SCopy(), C4GUI::Element::SetToolTip(), SReplaceChar(), and Symbol.

Here is the call graph for this function:

Member Function Documentation

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

◆ ClearPointers()

void C4MenuItem::ClearPointers ( C4Object pObj)
inline

Definition at line 115 of file C4Menu.h.

115 { if(pObj == Object) Object = nullptr; if(pObj == pSymbolObj) pSymbolObj = nullptr; }

References Object, and pSymbolObj.

Referenced by C4Menu::ClearPointers().

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
Container * pParent
Definition: C4Gui.h:376
friend class Container
Definition: C4Gui.h:472
int32_t y
Definition: C4Rect.h:30
int32_t x
Definition: C4Rect.h:30

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:

◆ 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::Element::DoDragging ( CMouse rMouse,
int32_t  iX,
int32_t  iY,
DWORD  dwKeyParam 
)
virtualinherited

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

Definition at line 269 of file C4Gui.cpp.

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

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

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

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

◆ DoTextProgress()

void C4MenuItem::DoTextProgress ( int32_t &  riByVal)
protected

Definition at line 71 of file C4Menu.cpp.

72 {
73  // any progress to be done?
74  if (TextDisplayProgress<0) return;
75  // if this is an option or empty text, show it immediately
76  if (IsSelectable || !*Caption) { TextDisplayProgress=-1; return; }
77  // normal text: move forward in unbroken message, ignoring markup
78  StdStrBuf sText(Caption);
79  C4Markup MarkupChecker(false);
80  const char *szPos = sText.getPtr(std::min<int>(TextDisplayProgress, sText.getLength()));
81  while (riByVal && *szPos)
82  {
83  MarkupChecker.SkipTags(&szPos);
84  if (!*szPos) break;
85  --riByVal;
86 
87  // Advance one UTF-8 character
88  uint32_t c = GetNextCharacter(&szPos);
89  // Treat embedded images {{XXX}} as one entity
90  if(c == '{' && *szPos == '{')
91  {
92  int32_t end = SCharPos('}', szPos);
93  if(end > 0 && szPos[end+1] == '}')
94  szPos += end + 2;
95  }
96  }
97  if (!*szPos)
99  else
100  TextDisplayProgress = szPos - Caption;
101 }
int SCharPos(char cTarget, const char *szInStr, int iIndex)
Definition: Standard.cpp:239
uint32_t GetNextCharacter(const char **pszString)
Definition: Standard.h:84

References Caption, StdStrBuf::getLength(), GetNextCharacter(), StdStrBuf::getPtr(), IsSelectable, SCharPos(), C4Markup::SkipTags(), and TextDisplayProgress.

Referenced by C4Menu::SetTextProgress().

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

◆ Draw()

virtual void C4GUI::Element::Draw ( C4TargetFacet cgo)
inlineprotectedvirtualinherited

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

Definition at line 387 of file C4Gui.h.

387 { DrawElement(cgo); } // draw this class (this + any contents)
virtual void DrawElement(C4TargetFacet &cgo)
Definition: C4Gui.h:388

References C4GUI::Element::DrawElement().

Here is the call graph for this function:

◆ Draw3DFrame()

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

Definition at line 291 of file C4Gui.cpp.

292  {
293  DWORD dwAlpha = byAlpha<<24;
294  int32_t x0 = cgo.TargetX + rcBounds.x + iLeftOff,
295  y0 = cgo.TargetY + rcBounds.y + iTopOff,
296  x1 = cgo.TargetX + rcBounds.x + rcBounds.Wdt - 1,
297  y1 = cgo.TargetY + rcBounds.y + rcBounds.Hgt - 1;
298  if (fDrawTop) pDraw->DrawLineDw(cgo.Surface, (float)x0,(float)y0,(float)x1,(float)y0, C4GUI_BorderColor1 | dwAlpha);
299  if (fDrawLeft) pDraw->DrawLineDw(cgo.Surface, (float)x0,(float)y0,(float)x0,(float)y1, C4GUI_BorderColor1 | dwAlpha);
300  if (fDrawTop) pDraw->DrawLineDw(cgo.Surface, (float)(x0+1),(float)(y0+1),(float)(x1-1),(float)(y0+1), C4GUI_BorderColor2 | dwAlpha);
301  if (fDrawLeft) pDraw->DrawLineDw(cgo.Surface, (float)(x0+1),(float)(y0+1),(float)(x0+1),(float)(y1-1), C4GUI_BorderColor2 | dwAlpha);
302  pDraw->DrawLineDw(cgo.Surface, (float)x0,(float)y1,(float)x1,(float)y1, C4GUI_BorderColor3 | dwAlpha);
303  pDraw->DrawLineDw(cgo.Surface, (float)x1,(float)y0,(float)x1,(float)y1, C4GUI_BorderColor3 | dwAlpha);
304  pDraw->DrawLineDw(cgo.Surface, (float)(x0+1),(float)(y1-1),(float)(x1-1),(float)(y1-1), C4GUI_BorderColor1 | dwAlpha);
305  pDraw->DrawLineDw(cgo.Surface, (float)(x1-1),(float)(y0+1),(float)(x1-1),(float)(y1-1), C4GUI_BorderColor1 | dwAlpha);
306  }
C4Draw * pDraw
Definition: C4Draw.cpp:42
#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
float TargetY
Definition: C4Facet.h:165
float TargetX
Definition: C4Facet.h:165

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 C4MenuItem::DrawElement ( C4TargetFacet cgo)
overrideprotectedvirtual

Reimplemented from C4GUI::Element.

Definition at line 122 of file C4Menu.cpp.

123 {
124  // get target pos
125  C4Facet cgoOut(cgo.Surface, cgo.TargetX + rcBounds.x, cgo.TargetY + rcBounds.y, rcBounds.Wdt, rcBounds.Hgt);
126  // Select mark
127  if (iStyle!=C4MN_Style_Info)
129  pDraw->DrawBoxDw(cgo.Surface, cgoOut.X, cgoOut.Y, cgoOut.X + cgoOut.Wdt - 1, cgoOut.Y + cgoOut.Hgt - 1, C4RGB(0xca, 0, 0));
130  // Symbol/text areas
131  C4Facet cgoItemSymbol,cgoItemText;
132  cgoItemSymbol=cgoItemText=cgoOut;
133  int32_t iSymWidth;
134  if ((iSymWidth = GetSymbolWidth(cgoItemText.Hgt)))
135  {
136  // get symbol area
137  cgoItemSymbol=cgoItemText.Truncate(C4FCT_Left, iSymWidth);
138  }
139  // cgoItemSymbol.Hgt is 0. This means rcBounds.Hgt is 0. That
140  // makes no sense at this point, so let's just draw in a
141  // square area at item y.
142  C4Facet cgoSymbolOut(cgoItemSymbol.Surface, cgoItemSymbol.X, cgoItemSymbol.Y, cgoItemSymbol.Wdt, cgoItemSymbol.Wdt);
143 
144  // Draw item symbol:
145  // Draw if there is no text progression at all (TextDisplayProgress==-1, or if it's progressed far enough already (TextDisplayProgress>0)
147  {
148  pSymbolObj->DrawPicture(cgoSymbolOut, false, nullptr);
149  }
151  {
152  pSymbolGraphics->Draw(cgoSymbolOut, dwSymbolClr ? dwSymbolClr : 0xffffffff, nullptr, 0, 0, nullptr);
153  }
154  else if (Symbol.Surface && TextDisplayProgress)
155  Symbol.DrawClr(cgoItemSymbol, true, dwSymbolClr);
156 
157  // Draw item text
158  pDraw->StorePrimaryClipper(); pDraw->SubPrimaryClipper(cgoItemText.X, cgoItemText.Y, cgoItemText.X+cgoItemText.Wdt-1, cgoItemText.Y+cgoItemText.Hgt-1);
159  switch (iStyle)
160  {
161  case C4MN_Style_Context:
162  pDraw->TextOut(Caption,::GraphicsResource.FontRegular, 1.0, cgoItemText.Surface,cgoItemText.X,cgoItemText.Y,C4Draw::DEFAULT_MESSAGE_COLOR,ALeft);
163  break;
164  case C4MN_Style_Info:
165  {
166  StdStrBuf sText;
167  ::GraphicsResource.FontRegular.BreakMessage(InfoCaption, cgoItemText.Wdt, &sText, true);
168  pDraw->TextOut(sText.getData(), ::GraphicsResource.FontRegular, 1.0, cgoItemText.Surface,cgoItemText.X,cgoItemText.Y);
169  break;
170  }
171  case C4MN_Style_Dialog:
172  {
173  // cut buffer at text display pos
174  char cXChg='\0'; int iStopPos = 0;
175  if (TextDisplayProgress>-1)
176  {
177  iStopPos = std::min<int>(TextDisplayProgress, strlen(Caption));
178  cXChg = Caption[iStopPos];
179  Caption[iStopPos] = '\0';
180  }
181  // display broken text
182  StdStrBuf sText;
183  ::GraphicsResource.FontRegular.BreakMessage(Caption, cgoItemText.Wdt, &sText, true);
184  pDraw->TextOut(sText.getData(),::GraphicsResource.FontRegular, 1.0, cgoItemText.Surface,cgoItemText.X,cgoItemText.Y);
185  // restore complete text
186  if (cXChg) Caption[iStopPos] = cXChg;
187  break;
188  }
189  }
191  // Draw count
193  {
194  char szCount[10+1];
195  sprintf(szCount,"%ix",Count);
196  pDraw->TextOut(szCount, ::GraphicsResource.FontRegular, 1.0, cgoItemText.Surface, cgoItemText.X+cgoItemText.Wdt-1, cgoItemText.Y+cgoItemText.Hgt-1-::GraphicsResource.FontRegular.GetLineHeight(), C4Draw::DEFAULT_MESSAGE_COLOR, ARight);
197  }
198 }
const int32_t C4FCT_Left
Definition: C4Facet.h:27
C4GraphicsResource GraphicsResource
@ C4MN_Item_NoCount
Definition: C4Menu.h:58
@ C4MN_Style_Dialog
Definition: C4Menu.h:38
@ C4MN_Style_Context
Definition: C4Menu.h:36
@ C4MN_Style_Info
Definition: C4Menu.h:37
const int ARight
Definition: C4Surface.h:41
const int ALeft
Definition: C4Surface.h:41
#define sprintf
Definition: Standard.h:162
#define C4RGB(r, g, b)
Definition: StdColors.h:26
void Draw(C4Facet &cgo, DWORD iColor, C4Object *pObj, int32_t iPhaseX, int32_t iPhaseY, C4DrawTransform *trans)
bool SubPrimaryClipper(int iX1, int iY1, int iX2, int iY2)
Definition: C4Draw.cpp:196
bool RestorePrimaryClipper()
Definition: C4Draw.cpp:210
@ DEFAULT_MESSAGE_COLOR
Definition: C4Draw.h:167
void DrawBoxDw(C4Surface *sfcDest, int iX1, int iY1, int iX2, int iY2, DWORD dwClr)
Definition: C4Draw.cpp:840
bool StorePrimaryClipper()
Definition: C4Draw.cpp:203
bool TextOut(const char *szText, CStdFont &rFont, float fZoom, C4Surface *sfcDest, float iTx, float iTy, DWORD dwFCol=0xffffffff, BYTE byForm=ALeft, bool fDoMarkup=true)
Definition: C4Draw.cpp:561
float Hgt
Definition: C4Facet.h:118
void DrawClr(C4Facet &cgo, bool fAspect=true, DWORD dwClr=0)
Definition: C4Facet.cpp:213
C4Facet Truncate(int32_t iAlign, int32_t iSize)
Definition: C4Facet.cpp:284
float Wdt
Definition: C4Facet.h:118
float Y
Definition: C4Facet.h:118
float X
Definition: C4Facet.h:118
void DrawPicture(C4Facet &cgo, bool fSelected=false, C4DrawTransform *transform=nullptr)
int Wdt
Definition: C4Surface.h:65
int GetLineHeight() const
Definition: C4FontLoader.h:125
std::tuple< std::string, int > BreakMessage(const char *szMsg, int iWdt, bool fCheckMarkup, float fZoom=1.0f)
const char * getData() const
Definition: StdBuf.h:442

References ALeft, ARight, CStdFont::BreakMessage(), C4FCT_Left, C4MN_Item_NoCount, C4MN_Style_Context, C4MN_Style_Dialog, C4MN_Style_Info, C4RGB, Caption, Count, C4Draw::DEFAULT_MESSAGE_COLOR, C4DefGraphics::Draw(), C4Draw::DrawBoxDw(), C4Facet::DrawClr(), C4Object::DrawPicture(), dwSymbolClr, C4GraphicsResource::FontRegular, fSelected, StdStrBuf::getData(), CStdFont::GetLineHeight(), GraphicsResource, C4Facet::Hgt, C4Rect::Hgt, InfoCaption, iStyle, pDraw, pSymbolGraphics, pSymbolObj, C4GUI::Element::rcBounds, C4Draw::RestorePrimaryClipper(), sprintf, C4Draw::StorePrimaryClipper(), C4Draw::SubPrimaryClipper(), C4Facet::Surface, Symbol, C4TargetFacet::TargetX, C4TargetFacet::TargetY, TextDisplayProgress, C4Draw::TextOut(), C4Facet::Truncate(), C4Facet::Wdt, C4Rect::Wdt, C4Facet::X, C4Rect::x, C4Facet::Y, 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:

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

◆ GetC4ID()

C4ID C4MenuItem::GetC4ID ( ) const
inline

Definition at line 110 of file C4Menu.h.

110 { return id; }

References id.

◆ GetClientRect()

virtual C4Rect& C4GUI::Element::GetClientRect ( )
inlinevirtualinherited

Reimplemented in C4GUI::Window.

Definition at line 447 of file C4Gui.h.

447 { return rcBounds; }

References C4GUI::Element::rcBounds.

Referenced by C4GUI::Element::GetContainedClientRect(), and C4GUI::Element::GetToprightCornerRect().

Here is the caller graph for this function:

◆ GetCommand()

const char* C4MenuItem::GetCommand ( ) const
inline

Definition at line 113 of file C4Menu.h.

113 { return Command; }

References Command.

Referenced by C4Player::Execute(), and C4MainMenu::OnSelectionChanged().

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
Definition: C4Rect.h:28

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

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

Reimplemented in C4GUI::Container.

Definition at line 410 of file C4Gui.h.

410 { return pParent; } // returns parent for elements; this for containers

References C4GUI::Element::pParent.

Referenced by C4GUI::ContextButton::ContextButton(), and C4GUI::Element::GetToprightCornerRect().

Here is the caller graph for this function:

◆ GetContextHandler()

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

Reimplemented in C4GUI::Dialog.

Definition at line 429 of file C4Gui.cpp.

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

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

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

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

◆ GetDialogWindow()

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

Reimplemented in C4GUI::Dialog.

Definition at line 404 of file C4Gui.h.

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

◆ GetDlg()

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

Reimplemented in C4GUI::Dialog.

Definition at line 288 of file C4Gui.cpp.

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

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

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

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

◆ GetFirstContained()

virtual Element* C4GUI::Element::GetFirstContained ( )
inlinevirtualinherited

Reimplemented in C4GUI::Container.

Definition at line 452 of file C4Gui.h.

452 { return nullptr; }

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

Here is the caller graph for this function:

◆ GetFirstNestedElement()

virtual Element* C4GUI::Element::GetFirstNestedElement ( bool  fBackwards)
inlinevirtualinherited

Reimplemented in C4GUI::Container.

Definition at line 451 of file C4Gui.h.

451 { return this; }

Referenced by C4GUI::Container::GetFirstNestedElement(), and C4GUI::Container::GetNextNestedElement().

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:

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

◆ GetNext()

◆ GetObject()

C4Object* C4MenuItem::GetObject ( ) const
inline

Definition at line 112 of file C4Menu.h.

112 { return Object; }

References Object.

◆ GetOwnToolTip()

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

Definition at line 440 of file C4Gui.h.

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

References StdStrBuf::getData().

Here is the call graph for this function:

◆ GetParent()

◆ GetPrev()

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

Definition at line 450 of file C4Gui.h.

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

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:

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

◆ GetValue()

int32_t C4MenuItem::GetValue ( ) const
inline

Definition at line 111 of file C4Menu.h.

111 { return iValue; }

References iValue.

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

◆ GrabSymbol()

void C4MenuItem::GrabSymbol ( C4FacetSurface fctSymbol)
inlineprotected

Definition at line 102 of file C4Menu.h.

102 { Symbol.GrabFrom(fctSymbol); if (Symbol.Surface) dwSymbolClr=Symbol.Surface->GetClr(); }
void GrabFrom(C4FacetSurface &rSource)
Definition: C4FacetEx.h:57
DWORD GetClr()
Definition: C4Surface.h:133

References dwSymbolClr, C4Surface::GetClr(), C4FacetSurface::GrabFrom(), C4Facet::Surface, and Symbol.

Referenced by C4Menu::Add().

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

◆ IsFocusElement()

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

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

Definition at line 432 of file C4Gui.h.

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

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

Here is the caller graph for this function:

◆ IsImmediateToolTip()

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

Definition at line 441 of file C4Gui.h.

441 { return is_immediate_tooltip; }

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

Here is the caller graph for this function:

◆ IsInActiveDlg()

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

Definition at line 435 of file C4Gui.cpp.

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

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

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

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

◆ IsMenu()

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

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

Definition at line 403 of file C4Gui.h.

403 { return false; }

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

Here is the caller graph for this function:

◆ IsOwnPtrElement()

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

Reimplemented in C4Menu.

Definition at line 401 of file C4Gui.h.

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

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

Here is the caller graph for this function:

◆ IsParentOf()

virtual bool C4GUI::Element::IsParentOf ( Element pEl)
inlinevirtualinherited

Reimplemented in C4GUI::Container.

Definition at line 454 of file C4Gui.h.

454 { return false; } // whether this is the parent container (directly or recursively) of the passed element

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

Here is the caller graph for this function:

◆ IsVisible()

bool C4GUI::Element::IsVisible ( )
inherited

◆ MouseEnter()

void C4MenuItem::MouseEnter ( class C4GUI::CMouse rMouse)
overridevirtual

Reimplemented from C4GUI::Element.

Definition at line 226 of file C4Menu.cpp.

227 {
228  // callback to menu: Select item
230  typedef C4GUI::Element ParentClass;
231  ParentClass::MouseEnter(rMouse);
232 }
C4MouseControl MouseControl
Definition: C4Globals.cpp:47
void UserSelectItem(int32_t Player, C4MenuItem *pItem)
Definition: C4Menu.cpp:1116
int32_t GetPlayer()

References C4MouseControl::GetPlayer(), MouseControl, pMenu, and C4Menu::UserSelectItem().

Here is the call graph for this function:

◆ MouseInput()

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

Reimplemented from C4GUI::Element.

Definition at line 200 of file C4Menu.cpp.

201 {
202  // clicky clicky!
203  if (iButton == C4MC_Button_LeftDown)
204  {
205  // button down: Init drag only; Enter selection only by button up
206  if (IsDragElement())
207  StartDragging(rMouse, iX, iY, dwKeyParam);
208  }
209  else if (iButton == C4MC_Button_LeftUp)
210  {
211  // left-click performed
212  pMenu->UserEnter(::MouseControl.GetPlayer(), this, false);
213  return;
214  }
215  else if (iButton == C4MC_Button_RightUp)
216  {
217  // right-up: Alternative enter command
218  pMenu->UserEnter(::MouseControl.GetPlayer(), this, true);
219  return;
220  }
221  // inherited; this is just setting some vars
222  typedef C4GUI::Element ParentClass;
223  ParentClass::MouseInput(rMouse, iButton, iX, iY, dwKeyParam);
224 }
const int32_t C4MC_Button_RightUp
const int32_t C4MC_Button_LeftUp
const int32_t C4MC_Button_LeftDown
virtual void StartDragging(CMouse &rMouse, int32_t iX, int32_t iY, DWORD dwKeyParam)
Definition: C4Gui.cpp:259
void UserEnter(int32_t Player, C4MenuItem *pItem, bool fRight)
Definition: C4Menu.cpp:1126

References C4MC_Button_LeftDown, C4MC_Button_LeftUp, C4MC_Button_RightUp, C4MouseControl::GetPlayer(), MouseControl, pMenu, C4GUI::Element::StartDragging(), and C4Menu::UserEnter().

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:

◆ OnHotkey()

virtual bool C4GUI::Element::OnHotkey ( uint32_t  cHotkey)
inlinevirtualinherited

Reimplemented in C4GUI::ContextMenu::Entry, C4GUI::CheckBox, C4GUI::Button, C4GUI::Container, and C4GUI::Label.

Definition at line 420 of file C4Gui.h.

420 { return false; } // return true when hotkey has been processed

◆ RefSymbol()

void C4MenuItem::RefSymbol ( const C4Facet fctSymbol)
inlineprotected

Definition at line 105 of file C4Menu.h.

105 { Symbol.Set(fctSymbol); if (Symbol.Surface) dwSymbolClr=Symbol.Surface->GetClr(); }
void Set(const C4Facet &cpy)
Definition: C4FacetEx.h:46

References dwSymbolClr, C4Surface::GetClr(), C4FacetSurface::Set(), C4Facet::Surface, and Symbol.

Referenced by C4Menu::AddRefSym().

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

◆ RemoveElement()

void C4GUI::Element::RemoveElement ( Element pChild)
protectedvirtualinherited

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

Definition at line 173 of file C4Gui.cpp.

174  {
175  // child removed: forward to parent
176  if (pParent)
177  pParent->RemoveElement(pChild);
178  else if (this != Screen::GetScreenS())
179  // always ensure removal from screen!
180  // but not if this is the context menu, to avoid endless flip-flop!
181  if (!IsMenu())
183  }
void RemoveElement(Element *pChild) override
virtual bool IsMenu()
Definition: C4Gui.h:403
static Screen * GetScreenS()
Definition: C4Gui.h:2629
void RemoveElement(Element *pChild) override
Definition: C4Gui.cpp:556

References C4GUI::Screen::GetScreenS(), C4GUI::Element::IsMenu(), C4GUI::Element::pParent, C4GUI::Container::RemoveElement(), and C4GUI::Screen::RemoveElement().

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

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

◆ ScreenPos2ClientPos()

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

Definition at line 218 of file C4Gui.cpp.

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

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

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

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

◆ SetBounds()

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

Definition at line 446 of file C4Gui.h.

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

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

Referenced by C4GameOptionButtons::C4GameOptionButtons(), C4GoalDisplay::C4GoalDisplay(), C4StartupModsListEntry::C4StartupModsListEntry(), C4StartupNetDlg::C4StartupNetDlg(), C4StartupNetListEntry::C4StartupNetListEntry(), C4GUI::ContextButton::ContextButton(), C4GUI::ListBox::ContractToElementHeight(), C4GUI::Control::Control(), C4GUI::Dialog::Dialog(), C4ChatDlg::DoPlacement(), C4StartupNetListEntry::Execute(), C4GUI::FullscreenDialog::FullscreenDialog(), C4GUI::GroupBox::GroupBox(), C4GUI::HorizontalLine::HorizontalLine(), 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:

◆ SetContextHandler()

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

Definition at line 465 of file C4Gui.h.

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

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

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

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

◆ SetDragTarget()

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

Definition at line 464 of file C4Gui.h.

464 { pDragTarget = pToWindow; }

References C4GUI::Element::pDragTarget.

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

Here is the caller graph for this function:

◆ SetGraphics() [1/2]

void C4MenuItem::SetGraphics ( C4DefGraphics pGfx)
inlineprotected

Definition at line 104 of file C4Menu.h.

104 { pSymbolGraphics = pGfx; }

References pSymbolGraphics.

◆ SetGraphics() [2/2]

void C4MenuItem::SetGraphics ( C4Object pObj)
inlineprotected

Definition at line 103 of file C4Menu.h.

103 { pSymbolObj = pObj; }

References pSymbolObj.

Referenced by C4Menu::Add().

Here is the caller graph for this function:

◆ SetSelected()

void C4MenuItem::SetSelected ( bool  fToVal)
inlineprotected

Definition at line 106 of file C4Menu.h.

106 { fSelected = fToVal; }

References fSelected.

Referenced by C4Menu::SetSelection().

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(), 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::Element::SetVisibility ( bool  fToValue)
virtualinherited

Reimplemented in C4StartupNetListEntry, C4GUI::Container, and C4StartupModsListEntry.

Definition at line 207 of file C4Gui.cpp.

208  {
209  fVisible = fToValue;
210  // stop mouseover for invisible
211  if (!fVisible)
212  {
213  Screen *pScreen = GetScreen();
214  if (pScreen) pScreen->Mouse.OnElementGetsInvisible(this);
215  }
216  }

References C4GUI::Element::fVisible, C4GUI::Element::GetScreen(), C4GUI::Screen::Mouse, and C4GUI::CMouse::OnElementGetsInvisible().

Referenced by C4GUI::RenameEdit::RenameEdit(), C4GUI::TextWindow::SetPicture(), C4GUI::ScrollWindow::SetScrollBarEnabled(), C4GUI::Container::SetVisibility(), C4GUI::ScrollBar::Update(), and C4ScriptGuiWindow::UpdateLayout().

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

◆ StartDragging()

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

Definition at line 259 of file C4Gui.cpp.

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

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

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

virtual void C4GUI::Element::UpdateOwnPos ( )
inlinevirtualinherited

◆ 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
virtual void UpdateOwnPos()
Definition: C4Gui.h:434

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

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

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

◆ UpdateSize()

void C4GUI::Element::UpdateSize ( )
protectedvirtualinherited

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

Definition at line 185 of file C4Gui.cpp.

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

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

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

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

Friends And Related Function Documentation

◆ C4Menu

friend class C4Menu
friend

Definition at line 67 of file C4Menu.h.

Member Data Documentation

◆ Caption

char C4MenuItem::Caption[C4MaxTitle+1]
protected

◆ Command

char C4MenuItem::Command[_MAX_FNAME_LEN+30]
protected

Definition at line 72 of file C4Menu.h.

Referenced by C4MenuItem(), C4Menu::Enter(), and GetCommand().

◆ Command2

char C4MenuItem::Command2[_MAX_FNAME_LEN+30]
protected

Definition at line 73 of file C4Menu.h.

Referenced by C4MenuItem(), and C4Menu::Enter().

◆ Count

int32_t C4MenuItem::Count
protected

Definition at line 75 of file C4Menu.h.

Referenced by DrawElement().

◆ dwSymbolClr

uint32_t C4MenuItem::dwSymbolClr
protected

Definition at line 81 of file C4Menu.h.

Referenced by DrawElement(), GrabSymbol(), and RefSymbol().

◆ fDragging

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

Definition at line 380 of file C4Gui.h.

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

◆ fOwnValue

bool C4MenuItem::fOwnValue
protected

Definition at line 82 of file C4Menu.h.

Referenced by C4Menu::DrawElement().

◆ fSelected

bool C4MenuItem::fSelected
protected

Definition at line 84 of file C4Menu.h.

Referenced by DrawElement(), and SetSelected().

◆ fVisible

◆ id

C4ID C4MenuItem::id
protected

Definition at line 76 of file C4Menu.h.

Referenced by C4Menu::DrawElement(), and GetC4ID().

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

◆ iIndex

int32_t C4MenuItem::iIndex
protected

Definition at line 87 of file C4Menu.h.

Referenced by C4Menu::UserEnter(), and C4Menu::UserSelectItem().

◆ InfoCaption

char C4MenuItem::InfoCaption[2 *C4MaxTitle+1]
protected

Definition at line 74 of file C4Menu.h.

Referenced by C4MenuItem(), C4Menu::Draw(), DrawElement(), and C4Menu::InitLocation().

◆ IsSelectable

◆ iStyle

int32_t C4MenuItem::iStyle
protected

Definition at line 85 of file C4Menu.h.

Referenced by DrawElement().

◆ iValue

int32_t C4MenuItem::iValue
protected

Definition at line 83 of file C4Menu.h.

Referenced by C4Menu::DrawElement(), and GetValue().

◆ Object

C4Object* C4MenuItem::Object
protected

Definition at line 77 of file C4Menu.h.

Referenced by ClearPointers(), and GetObject().

◆ pContextHandler

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

◆ pDragTarget

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

◆ pMenu

class C4Menu* C4MenuItem::pMenu
protected

Definition at line 86 of file C4Menu.h.

Referenced by MouseEnter(), and MouseInput().

◆ pNext

◆ pParent

◆ pPrev

◆ pSymbolGraphics

C4DefGraphics* C4MenuItem::pSymbolGraphics
protected

Definition at line 80 of file C4Menu.h.

Referenced by DrawElement(), and SetGraphics().

◆ pSymbolObj

C4Object* C4MenuItem::pSymbolObj
protected

Definition at line 79 of file C4Menu.h.

Referenced by ClearPointers(), DrawElement(), and SetGraphics().

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

◆ Symbol

C4FacetSurface C4MenuItem::Symbol
protected

◆ TextDisplayProgress

int32_t C4MenuItem::TextDisplayProgress
protected

Definition at line 89 of file C4Menu.h.

Referenced by DoTextProgress(), DrawElement(), and C4Menu::SetTextProgress().


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