OpenClonk
C4StartupNetDlg Class Reference

#include <C4StartupNetDlg.h>

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

Public Member Functions

 C4StartupNetDlg ()
 
 ~C4StartupNetDlg () override
 
bool DoOK ()
 
bool DoBack ()
 
void DoRefresh ()
 
void CreateGame ()
 
void OnReferenceEntryAdd (C4StartupNetListEntry *pEntry)
 
void OnSec1Timer () override
 
void CheckVersionUpdate ()
 
virtual bool SetSubscreen (const char *szToScreen)
 
virtual void OnKeyboardLayoutChanged ()
 
virtual void OnLeagueOptionChanged ()
 
void SetTitle (const char *szToTitle)
 
void SetTitle (const char *szToTitle, bool fShowCloseButton=true)
 
void RemoveElement (Element *pChild) override
 
void Draw (C4TargetFacet &cgo) override
 
void ApplyElementOffset (int32_t &riX, int32_t &riY) override
 
void ApplyInvElementOffset (int32_t &riX, int32_t &riY) override
 
bool IsFocused (Control *pCtrl) override
 
void SetFocus (Control *pCtrl, bool fByMouse)
 
ControlGetFocus ()
 
DialogGetDlg () override
 
DialogWindow * GetDialogWindow () override
 
virtual bool CharIn (const char *c)
 
void MouseInput (CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam) override
 
bool KeyEnter ()
 
bool KeyEscape ()
 
void AdvanceFocus (bool fBackwards)
 
bool KeyAdvanceFocus (bool fBackwards)
 
bool IsShown ()
 
bool IsOK ()
 
bool IsAborted ()
 
bool IsActive (bool fForKeyboard)
 
bool IsFading ()
 
virtual bool IsFreePlaceDialog ()
 
virtual bool IsBottomPlacementDialog ()
 
virtual bool IsExclusiveDialog ()
 
virtual bool IsMouseControlled ()
 
virtual C4ViewportGetViewport ()
 
bool IsViewportDialog ()
 
bool IsExternalDrawDialog () override
 
virtual int32_t GetZOrdering ()
 
bool Show (Screen *pOnScreen, bool fCB)
 
void Close (bool fOK)
 
bool FadeIn (Screen *pOnScreen)
 
void FadeOut (bool fCloseWithOK)
 
bool DoModal ()
 
bool Execute ()
 
bool Execute2 ()
 
void SetDelOnClose (bool fToVal=true)
 
void SetFrameDeco (FrameDecoration *pNewDeco)
 
void ClearFrameDeco ()
 
FrameDecoration * GetFrameDecoration () const
 
void SetClientSize (int32_t iToWdt, int32_t iToHgt)
 
void OnUserClose (C4GUI::Control *btn)
 
virtual void UserClose (bool fOK)
 
virtual void OnIdle ()
 
ContextHandler * GetContextHandler () override
 
void SetPos (int32_t iXPos, int32_t iYPos)
 
C4RectGetClientRect () override
 
void Clear ()
 
void ClearChildren ()
 
void MakeLastElement (Element *pChild)
 
void AddElement (Element *pChild)
 
void ReaddElement (Element *pChild)
 
void InsertElement (Element *pChild, Element *pInsertBefore)
 
ElementGetNextNestedElement (Element *pPrevElement, bool fBackwards)
 
ElementGetFirstContained () override
 
virtual ElementGetLastContained ()
 
ElementGetFirstNestedElement (bool fBackwards) override
 
Iterator begin ()
 
Iterator end ()
 
ReverseIterator rbegin ()
 
ReverseIterator rend ()
 
ElementGetFirst ()
 
ElementGetLast ()
 
ContainerGetContainer () override
 
ElementGetElementByIndex (int32_t i)
 
int32_t GetElementCount ()
 
void SetVisibility (bool fToValue) override
 
virtual bool IsSelectedChild (Element *pChild)
 
bool IsParentOf (Element *pEl) override
 
virtual void MouseEnter (CMouse &rMouse)
 
virtual void MouseLeave (CMouse &rMouse)
 
virtual void StartDragging (CMouse &rMouse, int32_t iX, int32_t iY, DWORD dwKeyParam)
 
virtual void DoDragging (CMouse &rMouse, int32_t iX, int32_t iY, DWORD dwKeyParam)
 
virtual void StopDragging (CMouse &rMouse, int32_t iX, int32_t iY, DWORD dwKeyParam)
 
bool DoContext ()
 
ContainerGetParent ()
 
virtual ScreenGetScreen ()
 
virtual ControlIsFocusElement ()
 
void ScreenPos2ClientPos (int32_t &riX, int32_t &riY)
 
void ClientPos2ScreenPos (int32_t &riX, int32_t &riY)
 
void SetToolTip (const char *szNewTooltip, bool is_immediate=false)
 
const char * GetToolTip ()
 
const char * GetOwnToolTip ()
 
bool IsImmediateToolTip () const
 
int32_t GetWidth ()
 
int32_t GetHeight ()
 
C4RectGetBounds ()
 
void SetBounds (const C4Rect &rcNewBound)
 
C4Rect GetContainedClientRect ()
 
ElementGetNext () const
 
ElementGetPrev () const
 
bool IsInActiveDlg (bool fForKeyboard)
 
C4Rect GetToprightCornerRect (int32_t iWidth=16, int32_t iHeight=16, int32_t iHIndent=4, int32_t iVIndent=4, int32_t iIndexX=0)
 
bool IsVisible ()
 
virtual int32_t GetListItemTopSpacing ()
 
virtual bool GetListItemTopSpacingBar ()
 
void SetDragTarget (Window *pToWindow)
 
void SetContextHandler (ContextHandler *pNewHd)
 

Static Public Member Functions

static int32_t GetDefaultTitleHeight ()
 

Public Attributes

bool fVisible {true}
 

Protected Member Functions

bool HasBackground () override
 
void DrawElement (C4TargetFacet &cgo) override
 
C4GUI::ControlGetDefaultControl () override
 
C4GUI::ControlGetDlgModeFocusControl ()
 
bool OnEnter () override
 
bool OnEscape () override
 
bool KeyBack ()
 
bool KeyRefresh ()
 
bool KeyForward ()
 
void OnShown () override
 
void OnClosed (bool fOK) override
 
void OnBackBtn (C4GUI::Control *btn)
 
void OnRefreshBtn (C4GUI::Control *btn)
 
void OnCreateGameBtn (C4GUI::Control *btn)
 
void OnJoinGameBtn (C4GUI::Control *btn)
 
void OnSelChange (class C4GUI::Element *pEl)
 
void OnSelDblClick (class C4GUI::Element *pEl)
 
void OnBtnGameList (C4GUI::Control *btn)
 
void OnBtnChat (C4GUI::Control *btn)
 
void OnBtnInternet (C4GUI::Control *btn)
 
void OnBtnRecord (C4GUI::Control *btn)
 
C4GUI::Edit::InputResult OnJoinAddressEnter (C4GUI::Edit *edt, bool fPasting, bool fPastingMore)
 
C4GUI::Edit::InputResult OnSearchFieldEnter (C4GUI::Edit *edt, bool fPasting, bool fPastingMore)
 
void OnChatTitleChange (const StdStrBuf &sNewTitle)
 
const char * GetID () override
 
bool IsComponentOutsideClientArea () override
 
virtual bool HasUpperBoard ()
 
bool IsFullscreenDialog () override
 
bool DoPlacement (Screen *pOnScreen, const C4Rect &rPreferredDlgRect) override
 
int32_t GetMarginTop () override
 
int32_t GetMarginLeft () override
 
int32_t GetMarginRight () override
 
int32_t GetMarginBottom () override
 
void UpdateOwnPos () override
 
void DrawBackground (C4TargetFacet &cgo, C4Facet &rFromFct)
 
bool CreateConsoleWindow ()
 
void DestroyConsoleWindow ()
 
void UpdateSize () override
 
void UpdatePos () override
 
virtual void ElementSizeChanged (Element *pOfElement)
 
virtual void ElementPosChanged (Element *pOfElement)
 
virtual void AfterElementRemoval ()
 
bool OnHotkey (uint32_t cHotkey) override
 
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 IsMenu ()
 
virtual bool CheckNameHotkey (const char *)
 

Protected Attributes

Label * pFullscreenTitle
 
Label * pSubTitle
 
int32_t iDlgMarginX
 
int32_t iDlgMarginY
 
WoodenLabel * pTitle
 
CallbackButton< Dialog, C4GUI::IconButton > * pCloseBtn
 
ControlpActiveCtrl
 
bool fShow
 
bool fOK
 
int32_t iFade
 
Fade eFade
 
bool fDelOnClose
 
StdStrBuf TitleString
 
bool fViewportDlg
 
DialogWindow * pWindow
 
FrameDecoration * pFrameDeco
 
C4Rect rcClientRect
 
ElementpFirst
 
ElementpLast
 
ContainerpParent {nullptr}
 
ElementpPrev
 
ElementpNext
 
WindowpDragTarget {nullptr}
 
int32_t iDragX
 
int32_t iDragY
 
bool fDragging {false}
 
ContextHandler * pContextHandler {nullptr}
 
C4Rect rcBounds
 

Private Member Functions

bool Execute (int, pollfd *) override
 

Detailed Description

Definition at line 126 of file C4StartupNetDlg.h.

Constructor & Destructor Documentation

◆ C4StartupNetDlg()

C4StartupNetDlg::C4StartupNetDlg ( )

Definition at line 594 of file C4StartupNetDlg.cpp.

594  : C4StartupDlg(LoadResStr("IDS_DLG_NETSTART"))
595 {
596  // ctor
597  // key bindings
599  keys.emplace_back(K_BACK); keys.emplace_back(K_LEFT);
600  pKeyBack = new C4KeyBinding(keys, "StartupNetBack", KEYSCOPE_Gui,
602  pKeyRefresh = new C4KeyBinding(C4KeyCodeEx(K_F5), "StartupNetReload", KEYSCOPE_Gui,
604 
605  // screen calculations
606  UpdateSize();
607  int32_t iIconSize = C4GUI_IconExWdt;
608  int32_t iButtonWidth,iCaptionFontHgt, iSideSize = std::max<int32_t>(GetBounds().Wdt/6, iIconSize);
609  int32_t iButtonHeight = C4GUI_ButtonHgt, iButtonIndent = GetBounds().Wdt/40;
610  ::GraphicsResource.CaptionFont.GetTextExtent("<< BACK", iButtonWidth, iCaptionFontHgt, true);
611  iButtonWidth *= 3;
612  C4GUI::ComponentAligner caMain(GetClientRect(), 0,0, true);
613  C4GUI::ComponentAligner caButtonArea(caMain.GetFromBottom(caMain.GetHeight()/7),0,0);
614  int32_t iButtonAreaWdt = caButtonArea.GetWidth()*7/8;
615  iButtonWidth = std::min<int32_t>(iButtonWidth, (iButtonAreaWdt - 8 * iButtonIndent)/4);
616  iButtonIndent = (iButtonAreaWdt - 4 * iButtonWidth) / 8;
617  C4GUI::ComponentAligner caButtons(caButtonArea.GetCentered(iButtonAreaWdt, iButtonHeight),iButtonIndent,0);
618  C4GUI::ComponentAligner caLeftBtnArea(caMain.GetFromLeft(iSideSize), std::min<int32_t>(caMain.GetWidth()/20, (iSideSize-C4GUI_IconExWdt)/2), caMain.GetHeight()/40);
619  C4GUI::ComponentAligner caConfigArea(caMain.GetFromRight(iSideSize), std::min<int32_t>(caMain.GetWidth()/20, (iSideSize-C4GUI_IconExWdt)/2), caMain.GetHeight()/40);
620 
621  // left button area: Switch between chat and game list
623  {
624  btnGameList = new C4GUI::CallbackButton<C4StartupNetDlg, C4GUI::IconButton>(C4GUI::Ico_Ex_GameList, caLeftBtnArea.GetFromTop(iIconSize, iIconSize), '\0', &C4StartupNetDlg::OnBtnGameList);
625  btnGameList->SetToolTip(LoadResStr("IDS_DESC_SHOWSAVAILABLENETWORKGAME"));
626  btnGameList->SetText(LoadResStr("IDS_BTN_GAMES"));
627  AddElement(btnGameList);
628  btnChat = new C4GUI::CallbackButton<C4StartupNetDlg, C4GUI::IconButton>(C4GUI::Ico_Ex_Chat, caLeftBtnArea.GetFromTop(iIconSize, iIconSize), '\0', &C4StartupNetDlg::OnBtnChat);
629  btnChat->SetToolTip(LoadResStr("IDS_DESC_CONNECTSTOANIRCCHATSERVER"));
630  btnChat->SetText(LoadResStr("IDS_BTN_CHAT"));
631  AddElement(btnChat);
632  }
633  else btnChat = nullptr;
634 
635  // main area: Tabular to switch between game list and chat
636  pMainTabular = new C4GUI::Tabular(caMain.GetAll(), C4GUI::Tabular::tbNone);
637  pMainTabular->SetDrawDecoration(false);
638  pMainTabular->SetSheetMargin(0);
639  AddElement(pMainTabular);
640 
641  // main area: game selection sheet
642  C4GUI::Tabular::Sheet *pSheetGameList = pMainTabular->AddSheet(nullptr);
643  C4GUI::ComponentAligner caGameList(pSheetGameList->GetContainedClientRect(), 0,0, false);
645  pGameListLbl = new C4GUI::WoodenLabel(LoadResStr("IDS_NET_GAMELIST"), caGameList.GetFromTop(iCaptHgt), C4GUI_Caption2FontClr, &::GraphicsResource.TextFont, ALeft);
646  // search field
647  C4GUI::WoodenLabel *pSearchLbl;
648  const char *szSearchLblText = LoadResStr("IDS_NET_MSSEARCH");
649  int32_t iSearchWdt=100, iSearchHgt;
650  ::GraphicsResource.TextFont.GetTextExtent(szSearchLblText, iSearchWdt, iSearchHgt, true);
651  C4GUI::ComponentAligner caSearch(caGameList.GetFromTop(iSearchHgt), 0,0);
652  pSearchLbl = new C4GUI::WoodenLabel(szSearchLblText, caSearch.GetFromLeft(iSearchWdt+10), C4GUI_Caption2FontClr, &::GraphicsResource.TextFont);
653  const char *szSearchTip = LoadResStr("IDS_NET_MSSEARCH_DESC");
654  pSearchLbl->SetToolTip(szSearchTip);
655  pSheetGameList->AddElement(pSearchLbl);
656  pSearchFieldEdt = new C4GUI::CallbackEdit<C4StartupNetDlg>(caSearch.GetAll(), this, &C4StartupNetDlg::OnSearchFieldEnter);
657  pSearchFieldEdt->SetToolTip(szSearchTip);
658  pSheetGameList->AddElement(pSearchFieldEdt);
659  pSheetGameList->AddElement(pGameListLbl);
660  pGameSelList = new C4GUI::ListBox(caGameList.GetFromTop(caGameList.GetHeight() - iCaptHgt));
661  pGameSelList->SetDecoration(true, nullptr, true, true);
662  pGameSelList->UpdateElementPositions();
665  pSheetGameList->AddElement(pGameSelList);
666  C4GUI::ComponentAligner caIP(caGameList.GetAll(), 0,0);
667  C4GUI::WoodenLabel *pIPLbl;
668  const char *szIPLblText = LoadResStr("IDS_NET_IP");
669  int32_t iIPWdt=100, Q;
670  ::GraphicsResource.TextFont.GetTextExtent(szIPLblText, iIPWdt, Q, true);
671  pIPLbl = new C4GUI::WoodenLabel(szIPLblText, caIP.GetFromLeft(iIPWdt+10), C4GUI_Caption2FontClr, &::GraphicsResource.TextFont);
672  const char *szIPTip = LoadResStr("IDS_NET_IP_DESC");
673  pIPLbl->SetToolTip(szIPTip);
674  pSheetGameList->AddElement(pIPLbl);
675  pJoinAddressEdt = new C4GUI::CallbackEdit<C4StartupNetDlg>(caIP.GetAll(), this, &C4StartupNetDlg::OnJoinAddressEnter);
676  pJoinAddressEdt->SetToolTip(szIPTip);
677  pSheetGameList->AddElement(pJoinAddressEdt);
678 
679  // main area: chat sheet
681  {
682  C4GUI::Tabular::Sheet *pSheetChat = pMainTabular->AddSheet(nullptr);
683  C4GUI::ComponentAligner caChat(pSheetChat->GetContainedClientRect(), 0,0, false);
684  pSheetChat->AddElement(pChatTitleLabel = new C4GUI::WoodenLabel("", caChat.GetFromTop(iCaptHgt), C4GUI_Caption2FontClr, &::GraphicsResource.TextFont, ALeft, false));
685  C4GUI::GroupBox *pChatGroup = new C4GUI::GroupBox(caChat.GetAll());
687  pChatGroup->SetMargin(2);
688  pSheetChat->AddElement(pChatGroup);
689  pChatCtrl = new C4ChatControl(&Application.IRCClient);
690  pChatCtrl->SetBounds(pChatGroup->GetContainedClientRect());
692  StdStrBuf sCurrTitle; sCurrTitle.Ref(pChatCtrl->GetTitle()); OnChatTitleChange(sCurrTitle);
693  pChatGroup->AddElement(pChatCtrl);
694  }
695 
696  // config area
698  btnInternet->SetToolTip(LoadResStr("IDS_DLGTIP_SEARCHINTERNETGAME"));
699  btnInternet->SetText(LoadResStr("IDS_CTL_INETSERVER"));
700  AddElement(btnInternet);
702  btnRecord->SetToolTip(LoadResStr("IDS_DLGTIP_RECORD"));
703  btnRecord->SetText(LoadResStr("IDS_CTL_RECORD"));
704  AddElement(btnRecord);
705 #ifdef WITH_AUTOMATIC_UPDATE
706  btnUpdate = new C4GUI::CallbackButton<C4StartupNetDlg, C4GUI::IconButton>(C4GUI::Ico_Ex_Update, caConfigArea.GetFromTop(iIconSize, iIconSize), '\0', &C4StartupNetDlg::OnBtnUpdate);
707  btnUpdate->SetVisibility(false); // update only available if masterserver notifies it
708  btnUpdate->SetToolTip(LoadResStr("IDS_DLGTIP_UPDATE"));
709  btnUpdate->SetText(LoadResStr("IDS_CTL_UPDATE"));
710  AddElement(btnUpdate);
711 #endif
712 
713  // button area
715  AddElement(btn = new C4GUI::CallbackButton<C4StartupNetDlg>(LoadResStr("IDS_BTN_BACK"), caButtons.GetFromLeft(iButtonWidth), &C4StartupNetDlg::OnBackBtn));
716  btn->SetToolTip(LoadResStr("IDS_DLGTIP_BACKMAIN"));
717  AddElement(btnRefresh = new C4GUI::CallbackButton<C4StartupNetDlg>(LoadResStr("IDS_BTN_RELOAD"), caButtons.GetFromLeft(iButtonWidth), &C4StartupNetDlg::OnRefreshBtn));
718  btnRefresh->SetToolTip(LoadResStr("IDS_NET_RELOAD_DESC"));
719  AddElement(btnJoin = new C4GUI::CallbackButton<C4StartupNetDlg>(LoadResStr("IDS_NET_JOINGAME_BTN"), caButtons.GetFromLeft(iButtonWidth), &C4StartupNetDlg::OnJoinGameBtn));
720  btnJoin->SetToolTip(LoadResStr("IDS_NET_JOINGAME_DESC"));
721  AddElement(btn = new C4GUI::CallbackButton<C4StartupNetDlg>(LoadResStr("IDS_NET_NEWGAME"), caButtons.GetFromLeft(iButtonWidth), &C4StartupNetDlg::OnCreateGameBtn));
722  btn->SetToolTip(LoadResStr("IDS_NET_NEWGAME_DESC"));
723 
724  // initial dlg mode
725  UpdateDlgMode();
726 
727  // initial focus
729 
730  // initialize discovery
731  DiscoverClient.Init(Config.Network.PortDiscovery);
732  DiscoverClient.StartDiscovery();
733  iGameDiscoverInterval = C4NetGameDiscoveryInterval;
734 
735  // register timer
736  Application.Add(this);
737 
738  // register as receiver of reference notifies
740 
741 }
C4Config Config
Definition: C4Config.cpp:930
C4Game Game
Definition: C4Globals.cpp:52
C4Application Application
Definition: C4Globals.cpp:44
C4GraphicsResource GraphicsResource
#define C4GUI_StandardBGColor
Definition: C4Gui.h:66
#define C4GUI_CaptionFontClr
Definition: C4Gui.h:37
#define C4GUI_ButtonHgt
Definition: C4Gui.h:111
#define C4GUI_Caption2FontClr
Definition: C4Gui.h:38
#define C4GUI_IconExWdt
Definition: C4Gui.h:95
@ Ev_HTTP_Response
@ KEYSCOPE_Gui
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
const int C4NetGameDiscoveryInterval
const int ALeft
Definition: C4Surface.h:41
C4InteractiveThread InteractiveThread
Definition: C4Application.h:45
C4Network2IRCClient & IRCClient
Definition: C4Application.h:47
void SetTitleChangeCB(C4GUI::BaseInputCallback *pNewCB)
Definition: C4ChatDlg.cpp:383
const char * GetTitle()
Definition: C4ChatDlg.h:140
static bool IsChatEnabled()
Definition: C4ChatDlg.cpp:1004
C4ConfigNetwork Network
Definition: C4Config.h:259
int32_t MasterServerSignUp
Definition: C4Config.h:147
int32_t PortDiscovery
Definition: C4Config.h:153
std::vector< C4KeyCodeEx > CodeList
void SetText(const char *szToText)
Definition: C4GuiButton.cpp:55
void AddElement(Element *pChild)
void SetFocus(Control *pCtrl, bool fByMouse)
void UpdateSize() override
C4Rect GetContainedClientRect()
Definition: C4Gui.h:448
void SetBounds(const C4Rect &rcNewBound)
Definition: C4Gui.h:446
void SetToolTip(const char *szNewTooltip, bool is_immediate=false)
Definition: C4Gui.cpp:409
C4Rect & GetBounds()
Definition: C4Gui.h:445
void SetColors(uint32_t dwFrameClr, uint32_t dwTitleClr, uint32_t dwBackClr=0xffffffff)
Definition: C4Gui.h:1017
void SetMargin(int32_t iNewMargin)
Definition: C4Gui.h:1019
void SetSelectionDblClickFn(BaseCallbackHandler *pToHandler)
Definition: C4Gui.h:1554
void SetSelectionChangeCallbackFn(BaseCallbackHandler *pToHandler)
Definition: C4Gui.h:1549
void UpdateElementPositions()
void SetDecoration(bool fDrawBG, ScrollBarFacets *pToGfx, bool fAutoScroll, bool fDrawBorder=false)
Definition: C4Gui.h:1567
Sheet * AddSheet(const char *szTitle, int32_t icoTitle=Ico_None)
void SetDrawDecoration(bool fToVal)
Definition: C4Gui.h:1715
void SetSheetMargin(int32_t iMargin)
Definition: C4Gui.h:1714
C4Rect & GetClientRect() override
Definition: C4Gui.h:864
static int32_t GetDefaultHeight(CStdFont *pUseFont=nullptr)
bool Record
Definition: C4Game.h:124
void SetCallback(C4InteractiveEventType eEvent, Callback *pnNetworkCallback)
bool Init(uint16_t iPort=C4NetIO::addr_t::IPPORT_NONE) override
int32_t Wdt
Definition: C4Rect.h:30
C4StartupDlg(const char *szTitle)
Definition: C4Startup.h:98
void OnChatTitleChange(const StdStrBuf &sNewTitle)
void OnBtnRecord(C4GUI::Control *btn)
C4GUI::Edit::InputResult OnJoinAddressEnter(C4GUI::Edit *edt, bool fPasting, bool fPastingMore)
void OnCreateGameBtn(C4GUI::Control *btn)
void OnBackBtn(C4GUI::Control *btn)
void OnRefreshBtn(C4GUI::Control *btn)
void OnSelDblClick(class C4GUI::Element *pEl)
void OnBtnInternet(C4GUI::Control *btn)
C4GUI::Edit::InputResult OnSearchFieldEnter(C4GUI::Edit *edt, bool fPasting, bool fPastingMore)
void OnJoinGameBtn(C4GUI::Control *btn)
void OnBtnGameList(C4GUI::Control *btn)
void OnSelChange(class C4GUI::Element *pEl)
C4GUI::Control * GetDlgModeFocusControl()
void OnBtnChat(C4GUI::Control *btn)
bool GetTextExtent(const char *szText, int32_t &rsx, int32_t &rsy, bool fCheckMarkup=true)
void Add(StdSchedulerProc *pProc)
void Ref(const char *pnData)
Definition: StdBuf.h:455
@ Ico_Ex_Update
Definition: C4Gui.h:712
@ Ico_Ex_RecordOff
Definition: C4Gui.h:698
@ Ico_Ex_InternetOn
Definition: C4Gui.h:705
@ Ico_Ex_InternetOff
Definition: C4Gui.h:704
@ Ico_Ex_RecordOn
Definition: C4Gui.h:699
@ Ico_Ex_Chat
Definition: C4Gui.h:713
@ Ico_Ex_GameList
Definition: C4Gui.h:714

References StdScheduler::Add(), C4GUI::Container::AddElement(), C4GUI::Tabular::AddSheet(), ALeft, Application, C4GUI_ButtonHgt, C4GUI_Caption2FontClr, C4GUI_CaptionFontClr, C4GUI_IconExWdt, C4GUI_StandardBGColor, C4NetGameDiscoveryInterval, C4GraphicsResource::CaptionFont, Config, Ev_HTTP_Response, Game, C4GUI::ComponentAligner::GetAll(), C4GUI::Element::GetBounds(), C4GUI::ComponentAligner::GetCentered(), C4GUI::Window::GetClientRect(), C4GUI::Element::GetContainedClientRect(), C4GUI::WoodenLabel::GetDefaultHeight(), GetDlgModeFocusControl(), C4GUI::ComponentAligner::GetFromBottom(), C4GUI::ComponentAligner::GetFromLeft(), C4GUI::ComponentAligner::GetFromRight(), C4GUI::ComponentAligner::GetFromTop(), C4GUI::ComponentAligner::GetHeight(), CStdFont::GetTextExtent(), C4ChatControl::GetTitle(), C4GUI::ComponentAligner::GetWidth(), GraphicsResource, C4GUI::Ico_Ex_Chat, C4GUI::Ico_Ex_GameList, C4GUI::Ico_Ex_InternetOff, C4GUI::Ico_Ex_InternetOn, C4GUI::Ico_Ex_RecordOff, C4GUI::Ico_Ex_RecordOn, C4GUI::Ico_Ex_Update, C4Network2IODiscoverClient::Init(), C4Application::InteractiveThread, C4Application::IRCClient, C4ChatDlg::IsChatEnabled(), KeyBack(), KeyRefresh(), KEYSCOPE_Gui, LoadResStr(), C4ConfigNetwork::MasterServerSignUp, C4Config::Network, OnBackBtn(), OnBtnChat(), OnBtnGameList(), OnBtnInternet(), OnBtnRecord(), OnChatTitleChange(), OnCreateGameBtn(), OnJoinAddressEnter(), OnJoinGameBtn(), OnRefreshBtn(), OnSearchFieldEnter(), OnSelChange(), OnSelDblClick(), C4ConfigNetwork::PortDiscovery, C4CustomKey::PRIO_CtrlOverride, C4CustomKey::PRIO_Dlg, C4Game::Record, StdStrBuf::Ref(), C4GUI::Element::SetBounds(), C4InteractiveThread::SetCallback(), C4GUI::GroupBox::SetColors(), C4GUI::ListBox::SetDecoration(), C4GUI::Tabular::SetDrawDecoration(), C4GUI::Dialog::SetFocus(), C4GUI::GroupBox::SetMargin(), C4GUI::ListBox::SetSelectionChangeCallbackFn(), C4GUI::ListBox::SetSelectionDblClickFn(), C4GUI::Tabular::SetSheetMargin(), C4GUI::Button::SetText(), C4ChatControl::SetTitleChangeCB(), C4GUI::Element::SetToolTip(), C4Network2IODiscoverClient::StartDiscovery(), C4GUI::Tabular::tbNone, C4GraphicsResource::TextFont, C4GUI::ListBox::UpdateElementPositions(), C4GUI::Dialog::UpdateSize(), and C4Rect::Wdt.

Here is the call graph for this function:

◆ ~C4StartupNetDlg()

C4StartupNetDlg::~C4StartupNetDlg ( )
override

Definition at line 743 of file C4StartupNetDlg.cpp.

744 {
745  // disable notifies
747  Application.InteractiveThread.RemoveProc(&pUpdateClient);
748 
749  DiscoverClient.Close();
750  Application.Remove(this);
751  if (pMasterserverClient) delete pMasterserverClient;
752  // dtor
753  delete pKeyBack;
754  delete pKeyRefresh;
755 }
void RemoveProc(StdSchedulerProc *pProc)
void ClearCallback(C4InteractiveEventType eEvent, Callback *pnNetworkCallback)
bool Close() override
Definition: C4NetIO.cpp:2041
void Remove(StdSchedulerProc *pProc)

References Application, C4InteractiveThread::ClearCallback(), C4NetIOSimpleUDP::Close(), Ev_HTTP_Response, C4Application::InteractiveThread, StdScheduler::Remove(), and C4InteractiveThread::RemoveProc().

Here is the call graph for this function:

Member Function Documentation

◆ 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(), C4StartupNetListEntry::C4StartupNetListEntry(), C4StartupOptionsDlg::C4StartupOptionsDlg(), C4StartupPlrColorPickerDlg::C4StartupPlrColorPickerDlg(), C4StartupPlrPropertiesDlg::C4StartupPlrPropertiesDlg(), C4StartupPlrSelDlg::C4StartupPlrSelDlg(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4GUI::ContextButton::ContextButton(), C4MapFolderData::CreateGUIElements(), C4GUI::InfoDialog::CreateSubComponents(), C4FileSelDlg::DefaultListItem::DefaultListItem(), C4GUI::FullscreenDialog::FullscreenDialog(), C4FileSelDlg::InitElements(), C4GUI::InputDialog::InputDialog(), C4GUI::Container::InsertElement(), C4GUI::LabeledEdit::LabeledEdit(), C4GameLobby::MainDlg::MainDlg(), C4GUI::MessageDialog::MessageDialog(), C4ChatControl::ChatSheet::NickItem::NickItem(), C4GUI::ProgressDialog::ProgressDialog(), C4GUI::RenameEdit::RenameEdit(), C4GameLobby::ScenDesc::ScenDesc(), C4StartupScenSelDlg::ScenListItem::ScenListItem(), C4GUI::ScrollWindow::ScrollWindow(), C4GUI::InputDialog::SetCustomEdit(), C4GoalDisplay::SetGoals(), C4GUI::FullscreenDialog::SetTitle(), C4GUI::Dialog::SetTitle(), and C4GUI::TextWindow::TextWindow().

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

◆ AdvanceFocus()

void C4GUI::Dialog::AdvanceFocus ( bool  fBackwards)
inherited

Definition at line 580 of file C4GuiDialogs.cpp.

581  {
582  // get element to start from
583  Element *pCurrElement = pActiveCtrl;
584  // find new control
585  for (;;)
586  {
587  // get next element
588  pCurrElement = GetNextNestedElement(pCurrElement, fBackwards);
589  // end reached: start from beginning
590  if (!pCurrElement && pActiveCtrl) if (!(pCurrElement = GetNextNestedElement(nullptr, fBackwards))) return;
591  // cycled?
592  if (pCurrElement == pActiveCtrl)
593  {
594  // but current is no longer a focus element? Then defocus it and return
595  if (pCurrElement && !pCurrElement->IsFocusElement())
596  SetFocus(nullptr, false);
597  return;
598  }
599  // for list elements, check whether the child can be selected
600  if (pCurrElement->GetParent() && !pCurrElement->GetParent()->IsSelectedChild(pCurrElement)) continue;
601  // check if this is a new control
602  Control *pFocusCtrl = pCurrElement->IsFocusElement();
603  if (pFocusCtrl && pFocusCtrl != pActiveCtrl && pFocusCtrl->IsVisible())
604  {
605  // set focus here...
606  SetFocus(pFocusCtrl, false);
607  // ...done!
608  return;
609  }
610  }
611  // never reached
612  }
C4GameControl Control
friend class Element
Definition: C4Gui.h:844
Element * GetNextNestedElement(Element *pPrevElement, bool fBackwards)
Control * pActiveCtrl
Definition: C4Gui.h:2081
bool IsVisible()
Definition: C4Gui.cpp:201

References C4GUI::Container::GetNextNestedElement(), C4GUI::Element::GetParent(), C4GUI::Element::IsFocusElement(), C4GUI::Container::IsSelectedChild(), C4GUI::Element::IsVisible(), C4GUI::Dialog::pActiveCtrl, and C4GUI::Dialog::SetFocus().

Referenced by C4GUI::Control::DisableFocus(), C4GUI::Dialog::KeyAdvanceFocus(), and C4ChatControl::OnLoginDataEnter().

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::Dialog::ApplyElementOffset ( int32_t &  riX,
int32_t &  riY 
)
overridevirtualinherited

Reimplemented from C4GUI::Window.

Definition at line 743 of file C4GuiDialogs.cpp.

744  {
745  // inherited
746  Window::ApplyElementOffset(riX, riY);
747  // apply viewport offset, if a viewport is assigned
748  C4Viewport *pVP = GetViewport();
749  if (pVP)
750  {
751  C4Rect rcVP(pVP->GetOutputRect());
752  riX -= rcVP.x; riY -= rcVP.y;
753  }
754  }
virtual C4Viewport * GetViewport()
Definition: C4Gui.h:2172
void ApplyElementOffset(int32_t &riX, int32_t &riY) override
Definition: C4Gui.h:866
Definition: C4Rect.h:28
C4Rect GetOutputRect()
Definition: C4Viewport.h:67

References C4GUI::Window::ApplyElementOffset(), C4Viewport::GetOutputRect(), C4GUI::Dialog::GetViewport(), C4Rect::x, and C4Rect::y.

Here is the call graph for this function:

◆ ApplyInvElementOffset()

void C4GUI::Dialog::ApplyInvElementOffset ( int32_t &  riX,
int32_t &  riY 
)
overridevirtualinherited

Reimplemented from C4GUI::Window.

Definition at line 756 of file C4GuiDialogs.cpp.

757  {
758  // inherited
760  // apply viewport offset, if a viewport is assigned
761  C4Viewport *pVP = GetViewport();
762  if (pVP)
763  {
764  C4Rect rcVP(pVP->GetOutputRect());
765  riX += rcVP.x; riY += rcVP.y;
766  }
767  }
void ApplyInvElementOffset(int32_t &riX, int32_t &riY) override
Definition: C4Gui.h:868

References C4GUI::Window::ApplyInvElementOffset(), C4Viewport::GetOutputRect(), C4GUI::Dialog::GetViewport(), C4Rect::x, and C4Rect::y.

Here is the call 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::Dialog::CharIn ( const char *  c)
virtualinherited

Definition at line 519 of file C4GuiDialogs.cpp.

520  {
521  // reroute to active control
522  if (pActiveCtrl && pActiveCtrl->CharIn(c)) return true;
523  // unprocessed: Focus default control
524  // Except for space, which may have been processed as a key already
525  // (changing focus here would render buttons unusable, because they switch on KeyUp)
526  Control *pDefCtrl = GetDefaultControl();
527  if (pDefCtrl && pDefCtrl != pActiveCtrl && (!c || *c != 0x20))
528  {
529  SetFocus(pDefCtrl, false);
530  if (pActiveCtrl && pActiveCtrl->CharIn(c))
531  return true;
532  }
533  return false;
534  }
virtual bool CharIn(const char *)
Definition: C4Gui.h:1051
virtual class Control * GetDefaultControl()
Definition: C4Gui.h:2130

References C4GUI::Control::CharIn(), C4GUI::Dialog::GetDefaultControl(), C4GUI::Dialog::pActiveCtrl, and C4GUI::Dialog::SetFocus().

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

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

◆ CheckNameHotkey()

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

Reimplemented in C4StartupScenSelDlg::ScenListItem.

Definition at line 407 of file C4Gui.h.

407 { return false; }

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

Here is the caller graph for this function:

◆ CheckVersionUpdate()

void C4StartupNetDlg::CheckVersionUpdate ( )

Definition at line 1270 of file C4StartupNetDlg.cpp.

1271 {
1272 #ifdef WITH_AUTOMATIC_UPDATE
1273  StdStrBuf strVersion; strVersion.Format("%d.%d", C4XVER1, C4XVER2);
1274  StdStrBuf strQuery; strQuery.Format("%s?version=%s&platform=%s&action=version", Config.Network.UpdateServerAddress, strVersion.getData(), C4_OS);
1275 
1276  if (pUpdateClient.Init() && pUpdateClient.SetServer(strQuery.getData()) && pUpdateClient.QueryUpdateURL())
1277  {
1278  pUpdateClient.SetNotify(&Application.InteractiveThread);
1279  Application.InteractiveThread.AddProc(&pUpdateClient);
1280  }
1281  fUpdateCheckPending = true;
1282 #endif
1283 }
#define C4_OS
bool Init()
Definition: C4HTTP.cpp:42
bool SetServer(const char *szServerAddress)
Definition: C4HTTP.cpp:298
void SetNotify(class C4InteractiveThread *pnNotify)
Definition: C4HTTP.h:106
bool AddProc(StdSchedulerProc *pProc)
const char * getData() const
Definition: StdBuf.h:442
void Format(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O
Definition: StdBuf.cpp:174

References C4InteractiveThread::AddProc(), Application, C4_OS, Config, StdStrBuf::Format(), StdStrBuf::getData(), C4HTTPClient::Init(), C4Application::InteractiveThread, C4Config::Network, C4Network2UpdateClient::QueryUpdateURL(), C4HTTPClient::SetNotify(), and C4HTTPClient::SetServer().

Referenced by OnShown().

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

◆ Clear()

void C4GUI::Container::Clear ( )
inherited

Definition at line 63 of file C4GuiContainers.cpp.

64  {
65  ClearChildren();
66  }

References C4GUI::Container::ClearChildren().

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

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

◆ ClearChildren()

void C4GUI::Container::ClearChildren ( )
inherited

Definition at line 68 of file C4GuiContainers.cpp.

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

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

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

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

◆ ClearFrameDeco()

void C4GUI::Dialog::ClearFrameDeco ( )
inlineinherited

Definition at line 2200 of file C4Gui.h.

2201  {if (pFrameDeco) pFrameDeco->Deref(); pFrameDeco = nullptr; }
FrameDecoration * pFrameDeco
Definition: C4Gui.h:2090

References C4GUI::FrameDecoration::Deref(), and C4GUI::Dialog::pFrameDeco.

Referenced by C4Menu::Clear().

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

◆ ClientPos2ScreenPos()

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

Definition at line 231 of file C4Gui.cpp.

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

◆ Close()

void C4GUI::Dialog::Close ( bool  fOK)
inherited

Definition at line 631 of file C4GuiDialogs.cpp.

632  {
633  // already closed?
634  if (!fShow) return;
635  // set OK flag
636  this->fOK = fOK;
637  // get screen
638  Screen *pScreen = GetScreen();
639  if (pScreen) pScreen->CloseDialog(this, false); else fShow = false;
640  // developer mode: Remove window
642  // do callback - last call, because it might do perilous things
643  OnClosed(fOK);
644  }
bool fShow
Definition: C4Gui.h:2082
friend class Screen
Definition: C4Gui.h:2217
bool fOK
Definition: C4Gui.h:2083
DialogWindow * pWindow
Definition: C4Gui.h:2089
virtual void OnClosed(bool fOK)
void DestroyConsoleWindow()
virtual Screen * GetScreen()
Definition: C4Gui.cpp:289

References C4GUI::Screen::CloseDialog(), C4GUI::Dialog::DestroyConsoleWindow(), C4GUI::Dialog::fOK, C4GUI::Dialog::fShow, C4GUI::Element::GetScreen(), C4GUI::Dialog::OnClosed(), and C4GUI::Dialog::pWindow.

Referenced by C4MainMenu::ActivateMain(), C4Menu::Clear(), C4GUI::Screen::CloseAllDialogs(), C4FullScreen::CloseMenu(), C4Player::CloseMenu(), C4MessageInput::CloseTypeIn(), C4StartupScenSelDlg::DoBack(), C4Scoreboard::DoDlgShow(), C4Network2::DoLobby(), C4Startup::DontStartup(), C4Menu::Enter(), C4Menu::Execute(), C4Scoreboard::HideDlg(), C4Network2::LeaguePlrAuth(), C4Network2::LeagueStart(), C4MainMenu::MenuCommand(), C4GUI::MessageDialog::OnEnter(), C4GameLobby::MainDlg::OnExitBtn(), C4DownloadDlg::OnIdle(), C4Menu::Refill(), C4ChatDlg::StopChat(), C4Network2ClientListDlg::Toggle(), C4ChartDialog::Toggle(), C4ChatDlg::ToggleChat(), C4Menu::TryClose(), C4GUI::Dialog::UserClose(), C4FileSelDlg::UserClose(), and C4StartupPlrPropertiesDlg::UserClose().

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

◆ CreateConsoleWindow()

bool C4GUI::Dialog::CreateConsoleWindow ( )
protectedinherited

Definition at line 239 of file C4GuiDialogs.cpp.

240  {
241 #ifdef WITH_QT_EDITOR
242  // TODO: Implement these as Qt editor windows.
243  // This currently creates an empty window in Windows and a segfault in Linux.
244  return false;
245 #endif
246  // already created?
247  if (pWindow) return true;
248  // create it!
249  pWindow = new DialogWindow();
251  {
252  delete pWindow;
253  pWindow = nullptr;
254  return false;
255  }
256  // create rendering context
258  pWindow->pDialog = this;
259  return true;
260  }
virtual const char * GetID()
Definition: C4Gui.h:2108
StdStrBuf TitleString
Definition: C4Gui.h:2087
C4Window * Init(C4AbstractApp *pApp, const char *Title, const C4Rect &rcBounds, const char *szID)
Dialog * pDialog
Definition: C4Gui.h:2033
C4Surface * pSurface
Definition: C4Window.h:275

References Application, StdStrBuf::getData(), C4GUI::Dialog::GetID(), C4GUI::DialogWindow::Init(), C4GUI::DialogWindow::pDialog, C4Window::pSurface, C4GUI::Dialog::pWindow, C4GUI::Element::rcBounds, and C4GUI::Dialog::TitleString.

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

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

◆ CreateGame()

void C4StartupNetDlg::CreateGame ( )

Definition at line 1218 of file C4StartupNetDlg.cpp.

1219 {
1221 }
static C4Startup * Get()
Definition: C4Startup.h:147
@ SDID_ScenSelNetwork
Definition: C4Startup.h:114
class C4StartupDlg * SwitchDialog(DialogID eToDlg, bool fFade=true, const char *szSubDialog=nullptr)
Definition: C4Startup.cpp:139

References C4Startup::Get(), C4Startup::SDID_ScenSelNetwork, and C4Startup::SwitchDialog().

Referenced by OnCreateGameBtn().

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

◆ DestroyConsoleWindow()

void C4GUI::Dialog::DestroyConsoleWindow ( )
protectedinherited

Definition at line 262 of file C4GuiDialogs.cpp.

263  {
264  if (pWindow)
265  {
266  delete pWindow->pSurface;
267  pWindow->Clear();
268  delete pWindow;
269  pWindow = nullptr;
270  }
271  }
virtual void Clear()
Definition: C4AppT.cpp:102

References C4Window::Clear(), C4Window::pSurface, and C4GUI::Dialog::pWindow.

Referenced by C4GUI::Dialog::Close(), C4GUI::Dialog::OnClosed(), and C4GUI::Dialog::~Dialog().

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

◆ DoBack()

bool C4StartupNetDlg::DoBack ( )

Definition at line 1178 of file C4StartupNetDlg.cpp.

1179 {
1180  // abort dialog: Back to main
1182  return true;
1183 }

References C4Startup::Get(), C4Startup::SDID_Back, and C4Startup::SwitchDialog().

Referenced by KeyBack(), OnBackBtn(), OnClosed(), and OnEscape().

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

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:

◆ DoModal()

bool C4GUI::Dialog::DoModal ( )
inherited

Definition at line 658 of file C4GuiDialogs.cpp.

659  {
660  // Cancel all dialogues if game is left (including e.g. league dialogues)
661  if (::Application.IsQuittingGame()) return false;
662  // main message loop
663  while (fShow)
664  {
665  // dialog idle proc
666  OnIdle();
667  // Modal dialogue during running game is tricky. Do not execute game!
668  bool fGameWasRunning = ::Game.IsRunning;
669  ::Game.IsRunning = false;
670  // handle messages - this may block until the next timer
671  if (!Application.ScheduleProcs())
672  return false; // game GUI and lobby will deleted in Game::Clear()
673  // reset game run state
674  if (fGameWasRunning) ::Game.IsRunning = true;
675  }
676  // return whether dlg was OK
677  return fOK;
678  }
bool IsQuittingGame() const
Definition: C4Application.h:70
virtual void OnIdle()
Definition: C4Gui.h:2210
bool IsRunning
Definition: C4Game.h:140
bool ScheduleProcs(int iTimeout=1000/36)

References Application, C4GUI::Dialog::fOK, C4GUI::Dialog::fShow, Game, C4Application::IsQuittingGame(), C4Game::IsRunning, C4GUI::Dialog::OnIdle(), and StdScheduler::ScheduleProcs().

Referenced by C4DownloadDlg::ShowModal(), and C4GUI::Screen::ShowModalDlg().

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

◆ DoOK()

bool C4StartupNetDlg::DoOK ( )

Definition at line 1006 of file C4StartupNetDlg.cpp.

1007 {
1008  // OK in chat mode? Forward to chat control
1009  if (GetDlgMode() == SNDM_Chat) return pChatCtrl->DlgEnter();
1010  // OK on editbox with text enetered: Add the specified IP for reference retrieval
1011  if (GetFocus() == pJoinAddressEdt)
1012  {
1013  const char *szDirectJoinAddress = pJoinAddressEdt->GetText();
1014  if (szDirectJoinAddress && *szDirectJoinAddress)
1015  {
1016  // First do some acrobatics to avoid trying to resolve addresses with leading
1017  // or trailing whitespace, which is easily pasted in with an IP address.
1018  // We can trivially skip whitespace at the beginning, but we need a copy to
1019  // omit whitespace at the end.
1020  while (std::isspace(*szDirectJoinAddress))
1021  // skip whitespace at the beginning
1022  ++szDirectJoinAddress;
1023  if (!*szDirectJoinAddress)
1024  // entry empty, apart from whitespace
1025  return true;
1026  const char *szDirectJoinAddressEnd = szDirectJoinAddress + std::strlen(szDirectJoinAddress) - 1;
1027  while (std::isspace(*szDirectJoinAddressEnd))
1028  // skip whitespace at the end
1029  --szDirectJoinAddressEnd;
1030  if (*++szDirectJoinAddressEnd)
1031  {
1032  // Make a temporary copy of the part that is not trailing whitespace, if any
1033  std::string strDirectJoinAddressStripped(szDirectJoinAddress, szDirectJoinAddressEnd - szDirectJoinAddress);
1034  AddReferenceQuery(strDirectJoinAddressStripped.c_str(), C4StartupNetListEntry::NRQT_DirectJoin);
1035  }
1036  else
1037  AddReferenceQuery(szDirectJoinAddress, C4StartupNetListEntry::NRQT_DirectJoin);
1038  // Switch focus to list so another OK joins the specified address
1039  SetFocus(pGameSelList, true);
1040  return true;
1041  }
1042  }
1043  if (GetFocus() == pSearchFieldEdt)
1044  {
1045  UpdateList();
1046  return true;
1047  }
1048  // get currently selected item
1049  C4GUI::Element *pSelection = pGameSelList->GetSelectedItem();
1050  StdCopyStrBuf strNoJoin(LoadResStr("IDS_NET_NOJOIN"));
1051  if (!pSelection)
1052  {
1053  // no ref selected: Oh noes!
1055  LoadResStr("IDS_NET_NOJOIN_NOREF"),
1056  strNoJoin.getData(),
1059  return true;
1060  }
1061  C4StartupNetListEntry *pRefEntry = static_cast<C4StartupNetListEntry *>(pSelection);
1062  const char *szError;
1063  if ((szError = pRefEntry->GetError()))
1064  {
1065  // erroneous ref selected: Oh noes!
1067  FormatString(LoadResStr("IDS_NET_NOJOIN_BADREF"), szError).getData(),
1068  strNoJoin.getData(),
1071  return true;
1072  }
1073  C4Network2Reference *pRef = pRefEntry->GetReference();
1074  const char *szDirectJoinAddress = pRefEntry->GetJoinAddress();
1075  if (!pRef && !(szDirectJoinAddress && *szDirectJoinAddress))
1076  {
1077  // something strange has been selected (e.g., a masterserver entry). Error.
1079  LoadResStr("IDS_NET_NOJOIN_NOREF"),
1080  strNoJoin.getData(),
1083  return true;
1084  }
1085  // check if join to this reference is possible at all
1086  if (pRef)
1087  {
1088  // version mismatch
1089  C4GameVersion verThis;
1090  if (!(pRef->getGameVersion() == verThis))
1091  {
1093  FormatString(LoadResStr("IDS_NET_NOJOIN_BADVER"),
1094  pRef->getGameVersion().GetString().getData(),
1095  verThis.GetString().getData()).getData(),
1096  strNoJoin.getData(),
1099  return true;
1100  }
1101  if (pRef->getGameStatus().isPastLobby())
1102  {
1103  // no runtime join
1104  if (!pRef->isJoinAllowed())
1105  {
1106  if (!::pGUI->ShowMessageModal(
1107  LoadResStr("IDS_NET_NOJOIN_NORUNTIME"),
1108  strNoJoin.getData(),
1111  {
1112  return true;
1113  }
1114  }
1115  else
1116  {
1117  if (!::pGUI->ShowMessageModal(
1118  LoadResStr("IDS_NET_NOJOIN_RUNTIMEBROKEN"),
1119  strNoJoin.getData(),
1122  {
1123  return true;
1124  }
1125  }
1126  }
1127  }
1128  // OK; joining!
1129  if (pRef->isEditor())
1130  {
1131  bool success = false;
1132  // Editor mode join: Serialize reference to temp file and join on that
1133  // (could pass through environment, but that's hard to do platform-independent
1134  // (QProcessEnvironment? But then there's a Qt dependency in the network init code))
1135  StdStrBuf tmpfn(Config.AtTempPath("ocjoin"), true);
1136  MakeTempFilename(&tmpfn);
1137  StdStrBuf join_data = DecompileToBuf<StdCompilerINIWrite>(mkNamingAdapt(*pRef, "Reference"));
1138  if (join_data.getSize())
1139  {
1140  if (join_data.SaveToFile(tmpfn.getData()))
1141  {
1142  if (RestartApplication({"--editor", FormatString("--join=%s%s", C4Game::DirectJoinFilePrefix, tmpfn.getData()).getData()})) // hope for no " in temp path
1143  {
1144  // Application.Quit() has been called. Will quit after returning from this callback.
1145  // The temp file will be deleted by the new instance
1146  success = true;
1147  }
1148  else
1149  {
1150  EraseFile(tmpfn.getData());
1151  }
1152  }
1153  }
1154  if (!success)
1155  {
1156  C4GUI::TheScreen.ShowErrorMessage(LoadResStr("IDS_ERR_STARTEDITOR"));
1157  }
1158  return true;
1159  }
1160  else
1161  {
1162  // Player mode join
1163  // Take over reference
1164  pRefEntry->GrabReference();
1165  // Set join parameters
1166  *Game.ScenarioFilename = '\0';
1167  if (szDirectJoinAddress) SCopy(szDirectJoinAddress, Game.DirectJoinAddress, _MAX_PATH); else *Game.DirectJoinAddress = '\0';
1168  SCopy("Objects.ocd", Game.DefinitionFilenames);
1169  Game.NetworkActive = true;
1170  Game.fObserve = false;
1171  Game.pJoinReference.reset(pRef);
1172  // start with this set!
1174  return true;
1175  }
1176 }
C4GUIScreen * pGUI
Definition: C4Gui.cpp:1191
bool RestartApplication(std::vector< const char * > parameters)
#define _MAX_PATH
void SCopy(const char *szSource, char *sTarget, size_t iMaxL)
Definition: Standard.cpp:152
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:92
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:270
void MakeTempFilename(char *szFilename)
Definition: StdFile.cpp:320
bool EraseFile(const char *szFileName)
void OpenGame(const char *scenario=nullptr)
bool DlgEnter()
Definition: C4ChatDlg.cpp:786
const char * AtTempPath(const char *filename)
Definition: C4Config.cpp:600
Control * GetFocus()
Definition: C4Gui.h:2116
const char * GetText()
Definition: C4Gui.h:1339
Element * GetSelectedItem()
Definition: C4Gui.h:1581
bool ShowErrorMessage(const char *szMessage)
bool ShowMessageModal(const char *szMessage, const char *szCaption, DWORD dwButtons, Icons icoIcon, int32_t *piConfigDontShowAgainSetting=nullptr)
char DirectJoinAddress[_MAX_PATH_LEN]
Definition: C4Game.h:106
char ScenarioFilename[_MAX_PATH_LEN]
Definition: C4Game.h:102
static constexpr const char * DirectJoinFilePrefix
Definition: C4Game.h:296
std::unique_ptr< C4Network2Reference > pJoinReference
Definition: C4Game.h:108
bool NetworkActive
Definition: C4Game.h:123
bool fObserve
Definition: C4Game.h:121
char DefinitionFilenames[20 *_MAX_PATH_LEN]
Definition: C4Game.h:105
const C4GameVersion & getGameVersion() const
C4Network2Status getGameStatus() const
bool isPastLobby() const
Definition: C4Network2.h:88
C4Network2Reference * GetReference() const
const char * GetJoinAddress()
const char * GetError()
@ NRQT_DirectJoin
C4Network2Reference * GrabReference()
size_t getSize() const
Definition: StdBuf.h:444
bool SaveToFile(const char *szFile) const
Definition: StdBuf.cpp:94
Screen TheScreen
Definition: C4Gui.cpp:1054
@ Ico_Error
Definition: C4Gui.h:652
StdStrBuf GetString() const
Definition: C4GameVersion.h:33

References _MAX_PATH, Application, C4Config::AtTempPath(), C4GUI::MessageDialog::btnNo, C4GUI::MessageDialog::btnOK, C4GUI::MessageDialog::btnYes, Config, C4Game::DefinitionFilenames, C4Game::DirectJoinAddress, C4Game::DirectJoinFilePrefix, C4ChatControl::DlgEnter(), EraseFile(), C4Game::fObserve, FormatString(), Game, StdStrBuf::getData(), C4StartupNetListEntry::GetError(), C4GUI::Dialog::GetFocus(), C4Network2Reference::getGameStatus(), C4Network2Reference::getGameVersion(), C4StartupNetListEntry::GetJoinAddress(), C4StartupNetListEntry::GetReference(), C4GUI::ListBox::GetSelectedItem(), StdStrBuf::getSize(), C4GameVersion::GetString(), C4GUI::Edit::GetText(), C4StartupNetListEntry::GrabReference(), C4GUI::Ico_Error, C4Network2Reference::isEditor(), C4Network2Reference::isJoinAllowed(), C4Network2Status::isPastLobby(), LoadResStr(), MakeTempFilename(), mkNamingAdapt(), C4Game::NetworkActive, C4StartupNetListEntry::NRQT_DirectJoin, C4Application::OpenGame(), pGUI, C4Game::pJoinReference, RestartApplication(), StdStrBuf::SaveToFile(), C4Game::ScenarioFilename, SCopy(), C4GUI::Dialog::SetFocus(), C4GUI::Screen::ShowErrorMessage(), C4GUI::Screen::ShowMessageModal(), and C4GUI::TheScreen.

Referenced by KeyForward(), OnEnter(), OnJoinAddressEnter(), OnJoinGameBtn(), OnSearchFieldEnter(), and OnSelDblClick().

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

◆ DoPlacement()

bool C4GUI::FullscreenDialog::DoPlacement ( Screen pOnScreen,
const C4Rect rPreferredDlgRect 
)
inlineoverrideprotectedvirtualinherited

Reimplemented from C4GUI::Dialog.

Definition at line 2245 of file C4Gui.h.

2245 { return true; } // fullscreen dlg already placed

◆ DoRefresh()

void C4StartupNetDlg::DoRefresh ( )

Definition at line 1185 of file C4StartupNetDlg.cpp.

1186 {
1187  // check min refresh timer
1188  time_t tNow = time(nullptr);
1189  if (tLastRefresh && tNow < tLastRefresh + C4NetMinRefreshInterval)
1190  {
1191  // avoid hammering on refresh key
1192  C4GUI::GUISound("UI::Error");
1193  return;
1194  }
1195  tLastRefresh = tNow;
1196  // empty list of all old entries
1197  fUpdatingList = true;
1198  while (pGameSelList->GetFirst()) delete pGameSelList->GetFirst();
1199  pMasterserverClient=nullptr;
1200  // (Re-)Start discovery
1201  if (!DiscoverClient.StartDiscovery())
1202  {
1203  StdCopyStrBuf strNoDiscovery(LoadResStr("IDS_NET_NODISCOVERY"));
1205  FormatString(LoadResStr("IDS_NET_NODISCOVERY_DESC"), DiscoverClient.GetError()).getData(),
1206  strNoDiscovery.getData(),
1209  }
1210  iGameDiscoverInterval = C4NetGameDiscoveryInterval;
1211  // restart masterserver query
1212  UpdateMasterserver();
1213  // done; update stuff
1214  fUpdatingList = false;
1215  UpdateList();
1216 }
const int C4NetMinRefreshInterval
Element * GetFirst()
Definition: C4Gui.h:1572
virtual const char * GetError() const
Definition: C4NetIO.h:286
void GUISound(const char *szSound)
Definition: C4Gui.cpp:1175

References C4GUI::MessageDialog::btnAbort, C4NetGameDiscoveryInterval, C4NetMinRefreshInterval, FormatString(), StdStrBuf::getData(), C4NetIO::GetError(), C4GUI::ListBox::GetFirst(), C4GUI::GUISound(), C4GUI::Ico_Error, LoadResStr(), pGUI, C4GUI::Screen::ShowMessageModal(), and C4Network2IODiscoverClient::StartDiscovery().

Referenced by KeyRefresh(), and OnRefreshBtn().

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

◆ Draw()

void C4GUI::Dialog::Draw ( C4TargetFacet cgo)
overridevirtualinherited

Reimplemented from C4GUI::Window.

Reimplemented in C4ScoreboardDlg, and C4Menu.

Definition at line 435 of file C4GuiDialogs.cpp.

436  {
437  C4TargetFacet cgo; cgo.Set(cgo0);
438  // Dialogs with a window just ignore the cgo.
439  if (pWindow)
440  {
441  cgo.Surface = pWindow->pSurface;
442  cgo.X = 0; cgo.Y = 0; cgo.Wdt = rcBounds.Wdt; cgo.Hgt = rcBounds.Hgt;
443  }
444  Screen *pScreen;
445  // evaluate fading
446  switch (eFade)
447  {
448  case eFadeNone: break; // no fading
449  case eFadeIn:
450  // fade in
451  if ((iFade+=10) >= 100)
452  {
453  if ((pScreen = GetScreen()))
454  {
455  if (pScreen->GetTopDialog() == this)
456  pScreen->ActivateDialog(this);
457  }
458  eFade = eFadeNone;
459  }
460  break;
461  case eFadeOut:
462  // fade out
463  if ((iFade-=10) <= 0)
464  {
465  fVisible = fShow = false;
466  if ((pScreen = GetScreen()))
467  pScreen->RecheckActiveDialog();
468  eFade = eFadeNone;
469  }
470  }
471  // set fade
472  if (iFade < 100)
473  {
474  if (iFade <= 0) return;
475  pDraw->ActivateBlitModulation((iFade*255/100)<<24 | 0xffffff);
476  }
477  // separate window: Clear background
478  if (pWindow)
479  pDraw->DrawBoxDw(cgo.Surface, rcBounds.x, rcBounds.y, rcBounds.Wdt-1, rcBounds.Hgt-1, (0xff << 24) | (C4GUI_StandardBGColor & 0xffffff) );
480  // draw window + contents (evaluates IsVisible)
481  Window::Draw(cgo);
482  // reset blit modulation
484  // blit output to own window
485  if (pWindow)
486  {
487  // Draw context menu on editor window
488  ContextMenu *menu;
489  if ((menu = GetScreen()->pContext))
490  {
491  if (menu->GetTargetDialog() == this)
492  {
493  menu->Draw(cgo);
494  }
495  }
496  // Editor window: Blit to output
497  C4Rect rtSrc,rtDst;
498  rtSrc.x=rcBounds.x; rtSrc.y=rcBounds.y; rtSrc.Wdt=rcBounds.Wdt; rtSrc.Hgt=rcBounds.Hgt;
499  rtDst.x=0; rtDst.y=0; rtDst.Wdt=rcBounds.Wdt; rtDst.Hgt=rcBounds.Hgt;
500  pWindow->pSurface->PageFlip(&rtSrc, &rtDst);
501  }
502  }
C4Draw * pDraw
Definition: C4Draw.cpp:42
void DeactivateBlitModulation()
Definition: C4Draw.h:189
void DrawBoxDw(C4Surface *sfcDest, int iX1, int iY1, int iX2, int iY2, DWORD dwClr)
Definition: C4Draw.cpp:840
void ActivateBlitModulation(DWORD dwWithClr)
Definition: C4Draw.h:188
C4Surface * Surface
Definition: C4Facet.h:117
float Hgt
Definition: C4Facet.h:118
float Wdt
Definition: C4Facet.h:118
float Y
Definition: C4Facet.h:118
float X
Definition: C4Facet.h:118
int32_t iFade
Definition: C4Gui.h:2084
Fade eFade
Definition: C4Gui.h:2085
bool fVisible
Definition: C4Gui.h:383
void Draw(C4TargetFacet &cgo) override
bool PageFlip(C4Rect *pSrcRt=nullptr, C4Rect *pDstRt=nullptr)
Definition: C4Surface.cpp:310
void Set(const C4Facet &cpy)
Definition: C4Facet.h:182

References C4Draw::ActivateBlitModulation(), C4GUI::Screen::ActivateDialog(), C4GUI_StandardBGColor, C4Draw::DeactivateBlitModulation(), C4GUI::Window::Draw(), C4GUI::ContextMenu::Draw(), C4Draw::DrawBoxDw(), C4GUI::Dialog::eFade, C4GUI::Dialog::fShow, C4GUI::Element::fVisible, C4GUI::Element::GetScreen(), C4GUI::ContextMenu::GetTargetDialog(), C4GUI::Screen::GetTopDialog(), C4Facet::Hgt, C4Rect::Hgt, C4GUI::Dialog::iFade, C4Surface::PageFlip(), pDraw, C4Window::pSurface, C4GUI::Dialog::pWindow, C4GUI::Element::rcBounds, C4GUI::Screen::RecheckActiveDialog(), C4TargetFacet::Set(), C4Facet::Surface, C4Facet::Wdt, C4Rect::Wdt, C4Facet::X, C4Rect::x, C4Facet::Y, and C4Rect::y.

Referenced by C4GUI::DialogWindow::PerformUpdate().

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

◆ DrawBackground()

void C4GUI::FullscreenDialog::DrawBackground ( C4TargetFacet cgo,
C4Facet rFromFct 
)
protectedinherited

Definition at line 836 of file C4GuiDialogs.cpp.

837  {
838  // draw across fullscreen bounds - zoom 1px border to prevent flashing borders by blit offsets
839  rFromFct.DrawFullScreen(cgo);
840  }
void DrawFullScreen(C4Facet &cgo)
Definition: C4Facet.cpp:184

References C4Facet::DrawFullScreen().

Referenced by C4StartupScenSelDlg::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 C4StartupNetDlg::DrawElement ( C4TargetFacet cgo)
overrideprotectedvirtual

Reimplemented from C4GUI::FullscreenDialog.

Definition at line 757 of file C4StartupNetDlg.cpp.

758 {
759  // draw background
760  typedef C4GUI::FullscreenDialog Base;
761  Base::DrawElement(cgo);
762 }

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

◆ Execute()

bool C4GUI::Dialog::Execute ( )
inherited

Definition at line 680 of file C4GuiDialogs.cpp.

681  {
682  // process messages
683  if (!Application.ScheduleProcs(0))
684  return false;
685  // check status
686  if (!fShow) return false;
687  return true;
688  }

References Application, C4GUI::Dialog::fShow, and StdScheduler::ScheduleProcs().

Referenced by C4GUI::Dialog::Execute2(), C4Network2::FinalInit(), and C4Network2::RetrieveRes().

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

◆ Execute2()

bool C4GUI::Dialog::Execute2 ( )
inherited

Definition at line 690 of file C4GuiDialogs.cpp.

691  {
692  // execute
693  if (Execute()) return true;
694  // delete self if closed
695  delete this;
696  return false;
697  }

References C4GUI::Dialog::Execute().

Here is the call graph for this function:

◆ FadeIn()

bool C4GUI::Dialog::FadeIn ( Screen pOnScreen)
inherited

Definition at line 714 of file C4GuiDialogs.cpp.

715  {
716  // default screen
717  if (!pOnScreen) pOnScreen = Screen::GetScreenS();
718  // fade in there
719  pOnScreen->ShowDialog(this, true);
720  iFade = 0;
721  eFade = eFadeIn;
722  fVisible = true;
723  OnShown();
724  // done, success
725  return true;
726  }
virtual void OnShown()
Definition: C4Gui.h:2209
static Screen * GetScreenS()
Definition: C4Gui.h:2629

References C4GUI::Dialog::eFade, C4GUI::Element::fVisible, C4GUI::Screen::GetScreenS(), C4GUI::Dialog::iFade, C4GUI::Dialog::OnShown(), and C4GUI::Screen::ShowDialog().

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

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

◆ FadeOut()

void C4GUI::Dialog::FadeOut ( bool  fCloseWithOK)
inherited

Definition at line 728 of file C4GuiDialogs.cpp.

729  {
730  // only if shown, or being faded in
731  if (!IsShown() && (!fVisible || eFade!=eFadeIn)) return;
732  // set OK flag
733  this->fOK = fCloseWithOK;
734  // fade out
735  Screen *pOnScreen = GetScreen();
736  if (!pOnScreen) return;
737  pOnScreen->CloseDialog(this, true);
738  eFade = eFadeOut;
739  // do callback - last call, because it might do perilous things
740  OnClosed(fCloseWithOK);
741  }
bool IsShown()
Definition: C4Gui.h:2148

References C4GUI::Screen::CloseDialog(), C4GUI::Dialog::eFade, C4GUI::Dialog::fOK, C4GUI::Element::fVisible, C4GUI::Element::GetScreen(), C4GUI::Dialog::IsShown(), and C4GUI::Dialog::OnClosed().

Referenced by C4Startup::SwitchDialog().

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(), 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; }
C4Rect rcClientRect
Definition: C4Gui.h:851

References C4GUI::Window::rcClientRect.

Referenced by C4GameOverDlg::C4GameOverDlg(), C4LeagueSignupDialog::C4LeagueSignupDialog(), C4StartupMainDlg::C4StartupMainDlg(), C4StartupModsDlg::C4StartupModsDlg(), 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(), 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::Dialog::GetContextHandler ( )
inlineoverridevirtualinherited

Reimplemented from C4GUI::Element.

Definition at line 2212 of file C4Gui.h.

2213  { return pContextHandler; }

References C4GUI::Element::pContextHandler.

◆ GetDefaultControl()

C4GUI::Control * C4StartupNetDlg::GetDefaultControl ( )
overrideprotectedvirtual

Reimplemented from C4GUI::Dialog.

Definition at line 785 of file C4StartupNetDlg.cpp.

786 {
787  // default control depends on whether dlg is in chat or game list mode
788  if (GetDlgMode() == SNDM_Chat && pChatCtrl)
789  // chat mode: Chat input edit
790  return pChatCtrl->GetDefaultControl();
791  else
792  // game list mode: No default control, because it would move focus away from IP input edit
793  return nullptr;
794 }
virtual class C4GUI::Control * GetDefaultControl()
Definition: C4ChatDlg.cpp:426

References C4ChatControl::GetDefaultControl().

Here is the call graph for this function:

◆ GetDefaultTitleHeight()

int32_t C4GUI::Dialog::GetDefaultTitleHeight ( )
staticinherited

Definition at line 330 of file C4GuiDialogs.cpp.

331  {
332  // default title font
333  return std::min<int32_t>(::GraphicsResource.TextFont.GetLineHeight(), C4GUI_MinWoodBarHgt);
334  }
#define C4GUI_MinWoodBarHgt
Definition: C4Gui.h:158
int GetLineHeight() const
Definition: C4FontLoader.h:125

References C4GUI_MinWoodBarHgt, CStdFont::GetLineHeight(), GraphicsResource, and C4GraphicsResource::TextFont.

Here is the call graph for this function:

◆ GetDialogWindow()

DialogWindow* C4GUI::Dialog::GetDialogWindow ( )
inlineoverridevirtualinherited

Reimplemented from C4GUI::Element.

Definition at line 2118 of file C4Gui.h.

2118 { return pWindow; }

References C4GUI::Dialog::pWindow.

◆ GetDlg()

Dialog* C4GUI::Dialog::GetDlg ( )
inlineoverridevirtualinherited

Reimplemented from C4GUI::Element.

Definition at line 2117 of file C4Gui.h.

2117 { return this; } // this is the dialog

Referenced by C4GUI::Screen::GetDialog(), C4GUI::Screen::GetFullscreenDialog(), C4GUI::Screen::GetMouseControlledDialogCount(), C4GUI::Screen::GetTopDialog(), C4GUI::Screen::MouseInput(), and C4StartupPlrSelDlg::PlayerListItem::UpdateCore().

Here is the caller graph for this function:

◆ GetDlgModeFocusControl()

C4GUI::Control * C4StartupNetDlg::GetDlgModeFocusControl ( )
protected

Definition at line 796 of file C4StartupNetDlg.cpp.

797 {
798  // default control depends on whether dlg is in chat or game list mode
799  if (GetDlgMode() == SNDM_Chat && pChatCtrl)
800  // chat mode: Chat input edit
801  return pChatCtrl->GetDefaultControl();
802  else
803  // game list mode: Game list box
804  return pGameSelList;
805 }

References C4ChatControl::GetDefaultControl().

Referenced by C4StartupNetDlg().

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:

◆ GetFocus()

Control* C4GUI::Dialog::GetFocus ( )
inlineinherited

Definition at line 2116 of file C4Gui.h.

2116 { return pActiveCtrl; }

References C4GUI::Dialog::pActiveCtrl.

Referenced by C4StartupScenSelDlg::DeselectAll(), C4StartupModsDlg::DoOK(), DoOK(), C4GUI::Control::MouseInput(), C4GUI::RenameEdit::OnFinishInput(), C4GUI::RenameEdit::RenameEdit(), and C4GUI::Container::SetVisibility().

Here is the caller graph for this function:

◆ GetFrameDecoration()

FrameDecoration* C4GUI::Dialog::GetFrameDecoration ( ) const
inlineinherited

Definition at line 2202 of file C4Gui.h.

2202 { return pFrameDeco; }

References C4GUI::Dialog::pFrameDeco.

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

◆ GetID()

const char* C4GUI::FullscreenDialog::GetID ( )
inlineoverrideprotectedvirtualinherited

Reimplemented from C4GUI::Dialog.

Definition at line 2227 of file C4Gui.h.

2227 { return nullptr; } // no ID needed, because it's never created as a window

◆ 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::FullscreenDialog::GetMarginBottom ( )
inlineoverrideprotectedvirtualinherited

Reimplemented from C4GUI::Dialog.

Definition at line 2250 of file C4Gui.h.

2250 { return iDlgMarginY; }

References C4GUI::FullscreenDialog::iDlgMarginY.

◆ GetMarginLeft()

int32_t C4GUI::FullscreenDialog::GetMarginLeft ( )
inlineoverrideprotectedvirtualinherited

Reimplemented from C4GUI::Dialog.

Definition at line 2248 of file C4Gui.h.

2248 { return iDlgMarginX; }

References C4GUI::FullscreenDialog::iDlgMarginX.

◆ GetMarginRight()

int32_t C4GUI::FullscreenDialog::GetMarginRight ( )
inlineoverrideprotectedvirtualinherited

Reimplemented from C4GUI::Dialog.

Definition at line 2249 of file C4Gui.h.

2249 { return iDlgMarginX; }

References C4GUI::FullscreenDialog::iDlgMarginX.

◆ GetMarginTop()

int32_t C4GUI::FullscreenDialog::GetMarginTop ( )
inlineoverrideprotectedvirtualinherited

Reimplemented from C4GUI::Dialog.

Reimplemented in C4StartupScenSelDlg, and C4StartupPlrSelDlg.

Definition at line 2247 of file C4Gui.h.

const int C4UpperBoardHeight
Definition: C4Constants.h:59
#define C4GUI_FullscreenDlg_TitleHeight
Definition: C4Gui.h:160
virtual bool HasUpperBoard()
Definition: C4Gui.h:2242

References C4GUI_FullscreenDlg_TitleHeight, C4UpperBoardHeight, C4GUI::FullscreenDialog::HasUpperBoard(), and C4GUI::FullscreenDialog::iDlgMarginY.

Referenced by C4GUI::FullscreenDialog::FullscreenDialog(), and C4GUI::FullscreenDialog::SetTitle().

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

◆ GetNext()

◆ GetNextNestedElement()

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

Definition at line 171 of file C4GuiContainers.cpp.

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

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

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

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

◆ GetOwnToolTip()

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

Definition at line 440 of file C4Gui.h.

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

References StdStrBuf::getData().

Here is the call graph for this function:

◆ GetParent()

◆ 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; }

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

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:

◆ GetViewport()

virtual C4Viewport* C4GUI::Dialog::GetViewport ( )
inlinevirtualinherited

Reimplemented in C4Menu.

Definition at line 2172 of file C4Gui.h.

2172 { return nullptr; }

Referenced by C4GUI::Dialog::ApplyElementOffset(), C4GUI::Dialog::ApplyInvElementOffset(), and C4GUI::Screen::MouseInput().

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:

◆ GetZOrdering()

virtual int32_t C4GUI::Dialog::GetZOrdering ( )
inlinevirtualinherited

Reimplemented in C4ChatInputDialog, C4Menu, and C4GUI::MessageDialog.

Definition at line 2182 of file C4Gui.h.

2182 { return C4GUI_Z_DEFAULT; }
#define C4GUI_Z_DEFAULT
Definition: C4Gui.h:154

References C4GUI_Z_DEFAULT.

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

Here is the caller graph for this function:

◆ HasBackground()

bool C4StartupNetDlg::HasBackground ( )
inlineoverrideprotectedvirtual

Reimplemented from C4GUI::Dialog.

Definition at line 158 of file C4StartupNetDlg.h.

158 { return false; }

◆ HasUpperBoard()

virtual bool C4GUI::FullscreenDialog::HasUpperBoard ( )
inlineprotectedvirtualinherited

Definition at line 2242 of file C4Gui.h.

2242 { return false; } // standard fullscreen dialog: UpperBoard no longer present

Referenced by C4GUI::FullscreenDialog::DrawElement(), C4GUI::FullscreenDialog::FullscreenDialog(), C4GUI::FullscreenDialog::GetMarginTop(), and C4GUI::FullscreenDialog::SetTitle().

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  }

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:

◆ IsAborted()

bool C4GUI::Dialog::IsAborted ( )
inlineinherited

Definition at line 2150 of file C4Gui.h.

2150 { return !fShow && !fOK; } // returns whether dialog has been aborted

References C4GUI::Dialog::fOK, and C4GUI::Dialog::fShow.

Referenced by C4Network2::DoLobby(), C4Network2::FinalInit(), C4Game::InitNetworkFromAddress(), C4Network2::LeaguePlrAuth(), C4Network2::LeagueStart(), and C4Network2::RetrieveRes().

Here is the caller graph for this function:

◆ IsActive()

bool C4GUI::Dialog::IsActive ( bool  fForKeyboard)
inherited

Definition at line 699 of file C4GuiDialogs.cpp.

700  {
701  // must be fully visible
702  if (!IsShown() || IsFading()) return false;
703  // screen-less dialogs are always inactive (not yet added)
704  Screen *pScreen = GetScreen();
705  if (!pScreen) return false;
706  // no keyboard focus if screen is in context mode
707  if (fForKeyboard && pScreen->HasContext()) return false;
708  // always okay in shared mode: all dlgs accessible by mouse
709  if (!pScreen->IsExclusive() && !fForKeyboard) return true;
710  // exclusive mode or keyboard input: Only one dlg active
711  return pScreen->pActiveDlg == this;
712  }
bool IsFading()
Definition: C4Gui.h:2152

References C4GUI::Element::GetScreen(), C4GUI::Screen::HasContext(), C4GUI::Screen::IsExclusive(), C4GUI::Dialog::IsFading(), C4GUI::Dialog::IsShown(), and C4GUI::Screen::pActiveDlg.

Referenced by C4GUI::Control::HasDrawFocus(), C4GUI::Element::IsInActiveDlg(), C4StartupModsDlg::OnSec1Timer(), and OnSec1Timer().

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

◆ IsBottomPlacementDialog()

virtual bool C4GUI::Dialog::IsBottomPlacementDialog ( )
inlinevirtualinherited

Reimplemented in C4ChatInputDialog.

Definition at line 2162 of file C4Gui.h.

2162 { return false; }

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

Here is the caller graph for this function:

◆ IsComponentOutsideClientArea()

bool C4GUI::FullscreenDialog::IsComponentOutsideClientArea ( )
inlineoverrideprotectedvirtualinherited

Reimplemented from C4GUI::Dialog.

Definition at line 2240 of file C4Gui.h.

2240 { return true; }

◆ IsExclusiveDialog()

virtual bool C4GUI::Dialog::IsExclusiveDialog ( )
inlinevirtualinherited

Reimplemented in C4ChatInputDialog, C4GameOverDlg, C4AbortGameDialog, and C4ChatDlg.

Definition at line 2165 of file C4Gui.h.

2165 { return false; }

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

Here is the caller graph for this function:

◆ IsExternalDrawDialog()

bool C4GUI::Dialog::IsExternalDrawDialog ( )
inlineoverridevirtualinherited

Reimplemented from C4GUI::Element.

Reimplemented in C4Menu.

Definition at line 2179 of file C4Gui.h.

2179 { return false; }

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

Here is the caller graph for this function:

◆ IsFading()

bool C4GUI::Dialog::IsFading ( )
inlineinherited

Definition at line 2152 of file C4Gui.h.

2152 { return eFade != eFadeNone; }

References C4GUI::Dialog::eFade.

Referenced by C4GUI::Screen::CloseDialog(), C4GUI::Screen::GetFullscreenDialog(), C4GUI::Dialog::IsActive(), C4GUI::Screen::MouseInput(), and C4GUI::Screen::RecheckActiveDialog().

Here is the caller graph for this function:

◆ IsFocused()

bool C4GUI::Dialog::IsFocused ( Control pCtrl)
inlineoverridevirtualinherited

Reimplemented from C4GUI::Container.

Definition at line 2114 of file C4Gui.h.

2114 { return pCtrl == pActiveCtrl; }

References C4GUI::Dialog::pActiveCtrl.

Referenced by C4GameLobby::MainDlg::KeyHistoryUpDown().

Here is the caller graph for this function:

◆ IsFocusElement()

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

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

Definition at line 432 of file C4Gui.h.

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

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

Here is the caller graph for this function:

◆ IsFreePlaceDialog()

virtual bool C4GUI::Dialog::IsFreePlaceDialog ( )
inlinevirtualinherited

Reimplemented in C4ChatInputDialog, C4GameOverDlg, C4AbortGameDialog, and C4ChatDlg.

Definition at line 2159 of file C4Gui.h.

2159 { return false; }

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

Here is the caller graph for this function:

◆ IsFullscreenDialog()

bool C4GUI::FullscreenDialog::IsFullscreenDialog ( )
inlineoverrideprotectedvirtualinherited

Reimplemented from C4GUI::Dialog.

Definition at line 2244 of file C4Gui.h.

2244 { return true; }

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

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:

◆ IsMouseControlled()

virtual bool C4GUI::Dialog::IsMouseControlled ( )
inlinevirtualinherited

Reimplemented in C4ScoreboardDlg, C4ChatInputDialog, and C4Menu.

Definition at line 2169 of file C4Gui.h.

2169 { return true; }

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

Here is the caller graph for this function:

◆ IsOK()

bool C4GUI::Dialog::IsOK ( )
inlineinherited

Definition at line 2149 of file C4Gui.h.

2149 { return fOK; } // returns whether user pressed OK

References C4GUI::Dialog::fOK.

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

◆ IsShown()

bool C4GUI::Dialog::IsShown ( )
inlineinherited

Definition at line 2148 of file C4Gui.h.

2148 { return fShow; } // returns whether dlg is on screen (may be invisible)

References C4GUI::Dialog::fShow.

Referenced by C4Network2::DoLobby(), C4Startup::DontStartup(), C4ScenarioListLoader::DoProcessCallback(), C4GUI::Dialog::FadeOut(), C4GUI::Screen::GetMouseControlledDialogCount(), C4GUI::Screen::GetTopDialog(), C4GUI::Dialog::IsActive(), C4GUI::Screen::MouseInput(), C4FileSelDlg::SetPath(), C4Startup::SwitchDialog(), and C4ChatDlg::ToggleChat().

Here is the caller graph for this function:

◆ IsViewportDialog()

bool C4GUI::Dialog::IsViewportDialog ( )
inlineinherited

Definition at line 2173 of file C4Gui.h.

2173 { return fViewportDlg; }
bool fViewportDlg
Definition: C4Gui.h:2088

References C4GUI::Dialog::fViewportDlg.

Referenced by C4GUI::Dialog::SetTitle(), C4GUI::Dialog::Show(), and C4GUI::Screen::ShowDialog().

Here is the caller graph for this function:

◆ IsVisible()

bool C4GUI::Element::IsVisible ( )
inherited

◆ KeyAdvanceFocus()

bool C4GUI::Dialog::KeyAdvanceFocus ( bool  fBackwards)
inlineinherited

Definition at line 2139 of file C4Gui.h.

2139 { AdvanceFocus(fBackwards); return true; }
void AdvanceFocus(bool fBackwards)

References C4GUI::Dialog::AdvanceFocus().

Referenced by C4StartupMainDlg::C4StartupMainDlg(), and C4GUI::Dialog::Dialog().

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

◆ KeyBack()

bool C4StartupNetDlg::KeyBack ( )
inlineprotected

Definition at line 166 of file C4StartupNetDlg.h.

166 { return DoBack(); }

References DoBack().

Referenced by C4StartupNetDlg().

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

◆ KeyEnter()

bool C4GUI::Dialog::KeyEnter ( )
inlineinherited

Definition at line 2134 of file C4Gui.h.

2134 { return OnEnter(); }
virtual bool OnEnter()
Definition: C4Gui.h:2133

References C4GUI::Dialog::OnEnter().

Referenced by C4FileSelDlg::C4FileSelDlg(), and C4GUI::Dialog::Dialog().

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

◆ KeyEscape()

bool C4GUI::Dialog::KeyEscape ( )
inlineinherited

Definition at line 2136 of file C4Gui.h.

2136 { return OnEscape(); }
virtual bool OnEscape()
Definition: C4Gui.h:2135

References C4GUI::Dialog::OnEscape().

Referenced by C4ChatInputDialog::C4ChatInputDialog(), and C4GUI::Dialog::Dialog().

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

◆ KeyForward()

bool C4StartupNetDlg::KeyForward ( )
inlineprotected

Definition at line 168 of file C4StartupNetDlg.h.

168 { DoOK(); return true; }

References DoOK().

Here is the call graph for this function:

◆ KeyRefresh()

bool C4StartupNetDlg::KeyRefresh ( )
inlineprotected

Definition at line 167 of file C4StartupNetDlg.h.

167 { DoRefresh(); return true; }

References DoRefresh().

Referenced by C4StartupNetDlg().

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

Reimplemented from C4GUI::Window.

Definition at line 557 of file C4GuiDialogs.cpp.

558  {
559  // inherited will do...
560  Window::MouseInput(rMouse, iButton, iX, iY, dwKeyParam);
561  }
void MouseInput(CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam) override

References C4GUI::Window::MouseInput().

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

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

◆ OnBackBtn()

void C4StartupNetDlg::OnBackBtn ( C4GUI::Control btn)
inlineprotected

Definition at line 172 of file C4StartupNetDlg.h.

172 { DoBack(); }

References DoBack().

Referenced by C4StartupNetDlg().

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

◆ OnBtnChat()

void C4StartupNetDlg::OnBtnChat ( C4GUI::Control btn)
protected

Definition at line 814 of file C4StartupNetDlg.cpp.

815 {
816  // toggle chat / game list
817  if (pChatCtrl)
818  {
819  if (pMainTabular->GetActiveSheetIndex() == SNDM_GameList)
820  {
821  pMainTabular->SelectSheet(SNDM_Chat, true);
822  pChatCtrl->OnShown();
823  UpdateDlgMode();
824  }
825  else
826  {
827  pMainTabular->SelectSheet(SNDM_GameList, true);
828  UpdateDlgMode();
829  }
830  }
831 }
virtual void OnShown()
Definition: C4ChatDlg.cpp:421
void SelectSheet(int32_t iIndex, bool fByUser)
int32_t GetActiveSheetIndex()

References C4GUI::Tabular::GetActiveSheetIndex(), C4ChatControl::OnShown(), and C4GUI::Tabular::SelectSheet().

Referenced by C4StartupNetDlg().

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

◆ OnBtnGameList()

void C4StartupNetDlg::OnBtnGameList ( C4GUI::Control btn)
protected

Definition at line 807 of file C4StartupNetDlg.cpp.

808 {
809  // switch to game list dialog
810  pMainTabular->SelectSheet(SNDM_GameList, true);
811  UpdateDlgMode();
812 }

References C4GUI::Tabular::SelectSheet().

Referenced by C4StartupNetDlg().

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

◆ OnBtnInternet()

void C4StartupNetDlg::OnBtnInternet ( C4GUI::Control btn)
protected

Definition at line 833 of file C4StartupNetDlg.cpp.

834 {
835  // toggle masterserver game search
837  UpdateMasterserver();
838 }

References Config, C4ConfigNetwork::MasterServerSignUp, and C4Config::Network.

Referenced by C4StartupNetDlg().

Here is the caller graph for this function:

◆ OnBtnRecord()

void C4StartupNetDlg::OnBtnRecord ( C4GUI::Control btn)
protected

Definition at line 840 of file C4StartupNetDlg.cpp.

841 {
842  // toggle league signup flag
843  bool fCheck = !Game.Record;
844  Game.Record = fCheck;
845  Config.General.DefRec = fCheck;
847 }
int32_t DefRec
Definition: C4Config.h:49
C4ConfigGeneral General
Definition: C4Config.h:255
void SetIcon(Icons eUseIcon)

References Config, C4ConfigGeneral::DefRec, Game, C4Config::General, C4GUI::Ico_Ex_RecordOff, C4GUI::Ico_Ex_RecordOn, C4Game::Record, and C4GUI::IconButton::SetIcon().

Referenced by C4StartupNetDlg().

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

◆ OnChatTitleChange()

void C4StartupNetDlg::OnChatTitleChange ( const StdStrBuf sNewTitle)
protected

Definition at line 1285 of file C4StartupNetDlg.cpp.

1286 {
1287  // update label
1288  if (pChatTitleLabel) pChatTitleLabel->SetText(FormatString("%s - %s", LoadResStr("IDS_DLG_CHAT"), sNewTitle.getData()).getData());
1289 }
void SetText(const char *szToText, bool fAllowHotkey=true)
Definition: C4GuiLabels.cpp:74

References FormatString(), StdStrBuf::getData(), LoadResStr(), and C4GUI::Label::SetText().

Referenced by C4StartupNetDlg().

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

◆ OnClosed()

void C4StartupNetDlg::OnClosed ( bool  fOK)
overrideprotectedvirtual

Reimplemented from C4GUI::Dialog.

Definition at line 778 of file C4StartupNetDlg.cpp.

779 {
780  // dlg abort: return to main screen
781  if (pMasterserverClient) { delete pMasterserverClient; pMasterserverClient=nullptr; }
782  if (!fOK) DoBack();
783 }

References DoBack(), and C4GUI::Dialog::fOK.

Here is the call graph for this function:

◆ OnCreateGameBtn()

void C4StartupNetDlg::OnCreateGameBtn ( C4GUI::Control btn)
inlineprotected

Definition at line 174 of file C4StartupNetDlg.h.

174 { CreateGame(); }

References CreateGame().

Referenced by C4StartupNetDlg().

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

◆ OnEnter()

bool C4StartupNetDlg::OnEnter ( )
inlineoverrideprotectedvirtual

Reimplemented from C4GUI::FullscreenDialog.

Definition at line 164 of file C4StartupNetDlg.h.

164 { DoOK(); return true; }

References DoOK().

Here is the call graph for this function:

◆ OnEscape()

bool C4StartupNetDlg::OnEscape ( )
inlineoverrideprotectedvirtual

Reimplemented from C4GUI::Dialog.

Definition at line 165 of file C4StartupNetDlg.h.

165 { DoBack(); return true; }

References DoBack().

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:

◆ OnIdle()

virtual void C4GUI::Dialog::OnIdle ( )
inlinevirtualinherited

Reimplemented in C4PortraitSelDlg, and C4DownloadDlg.

Definition at line 2210 of file C4Gui.h.

2210 {} // idle proc in DoModal

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

Here is the caller graph for this function:

◆ OnJoinAddressEnter()

C4GUI::Edit::InputResult C4StartupNetDlg::OnJoinAddressEnter ( C4GUI::Edit edt,
bool  fPasting,
bool  fPastingMore 
)
inlineprotected

Definition at line 185 of file C4StartupNetDlg.h.

186  { DoOK(); return C4GUI::Edit::IR_Abort; }
@ IR_Abort
Definition: C4Gui.h:1258

References DoOK(), and C4GUI::Edit::IR_Abort.

Referenced by C4StartupNetDlg().

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

◆ OnJoinGameBtn()

void C4StartupNetDlg::OnJoinGameBtn ( C4GUI::Control btn)
inlineprotected

Definition at line 175 of file C4StartupNetDlg.h.

175 { DoOK(); }

References DoOK().

Referenced by C4StartupNetDlg().

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

◆ OnKeyboardLayoutChanged()

virtual void C4StartupDlg::OnKeyboardLayoutChanged ( )
inlinevirtualinherited

Reimplemented in C4StartupOptionsDlg.

Definition at line 101 of file C4Startup.h.

101 {}

Referenced by C4Startup::OnKeyboardLayoutChanged().

Here is the caller graph for this function:

◆ OnLeagueOptionChanged()

virtual void C4StartupDlg::OnLeagueOptionChanged ( )
inlinevirtualinherited

Reimplemented in C4StartupScenSelDlg.

Definition at line 102 of file C4Startup.h.

102 {}

Referenced by C4Startup::OnLeagueOptionChanged().

Here is the caller graph for this function:

◆ OnReferenceEntryAdd()

void C4StartupNetDlg::OnReferenceEntryAdd ( C4StartupNetListEntry pEntry)

Definition at line 1263 of file C4StartupNetDlg.cpp.

1264 {
1265  // collapse the new entry if desired
1266  if (fIsCollapsed && pEntry != pGameSelList->GetSelectedItem())
1267  pEntry->UpdateCollapsed(true);
1268 }
void UpdateCollapsed(bool fToCollapseValue)

References C4GUI::ListBox::GetSelectedItem(), and C4StartupNetListEntry::UpdateCollapsed().

Here is the call graph for this function:

◆ OnRefreshBtn()

void C4StartupNetDlg::OnRefreshBtn ( C4GUI::Control btn)
inlineprotected

Definition at line 173 of file C4StartupNetDlg.h.

173 { DoRefresh(); }

References DoRefresh().

Referenced by C4StartupNetDlg().

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

◆ OnSearchFieldEnter()

C4GUI::Edit::InputResult C4StartupNetDlg::OnSearchFieldEnter ( C4GUI::Edit edt,
bool  fPasting,
bool  fPastingMore 
)
inlineprotected

Definition at line 187 of file C4StartupNetDlg.h.

188  { DoOK(); return C4GUI::Edit::IR_Abort; }

References DoOK(), and C4GUI::Edit::IR_Abort.

Referenced by C4StartupNetDlg().

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

◆ OnSec1Timer()

void C4StartupNetDlg::OnSec1Timer ( )
overridevirtual

Implements C4ApplicationSec1Timer.

Definition at line 1223 of file C4StartupNetDlg.cpp.

1224 {
1225  // no updates if dialog is inactive (e.g., because a join password dlg is shown!)
1226  if (!IsActive(true))
1227  return;
1228 
1229  // Execute discovery
1230  if (!iGameDiscoverInterval--)
1231  {
1232  DiscoverClient.StartDiscovery();
1233  iGameDiscoverInterval = C4NetGameDiscoveryInterval;
1234  }
1235  DiscoverClient.Execute(0);
1236 
1237  UpdateList(false);
1238 }
bool IsActive(bool fForKeyboard)
bool Execute(int iMaxTime=TO_INF, pollfd *=nullptr) override
Definition: C4NetIO.cpp:2100

References C4NetGameDiscoveryInterval, C4NetIOSimpleUDP::Execute(), C4GUI::Dialog::IsActive(), and C4Network2IODiscoverClient::StartDiscovery().

Referenced by OnShown().

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

◆ OnSelChange()

void C4StartupNetDlg::OnSelChange ( class C4GUI::Element pEl)
inlineprotected

Definition at line 176 of file C4StartupNetDlg.h.

176 { UpdateSelection(true); }

Referenced by C4StartupNetDlg().

Here is the caller graph for this function:

◆ OnSelDblClick()

void C4StartupNetDlg::OnSelDblClick ( class C4GUI::Element pEl)
inlineprotected

Definition at line 177 of file C4StartupNetDlg.h.

177 { DoOK(); }

References DoOK().

Referenced by C4StartupNetDlg().

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

◆ OnShown()

void C4StartupNetDlg::OnShown ( )
overrideprotectedvirtual

Reimplemented from C4GUI::Dialog.

Definition at line 764 of file C4StartupNetDlg.cpp.

765 {
766  // callback when shown: Start searching for games
769  UpdateList();
770  UpdateUpdateButton(); // in case update check was finished before callback registration
771  UpdateMasterserver();
772  OnSec1Timer();
773  tLastRefresh = time(nullptr);
774  // also update chat
775  if (pChatCtrl) pChatCtrl->OnShown();
776 }
void OnSec1Timer() override

References CheckVersionUpdate(), OnSec1Timer(), C4ChatControl::OnShown(), and C4GUI::Dialog::OnShown().

Here is the call graph for this function:

◆ OnUserClose()

void C4GUI::Dialog::OnUserClose ( C4GUI::Control btn)
inlineinherited

Definition at line 2205 of file C4Gui.h.

2206  { UserClose(false); }
virtual void UserClose(bool fOK)
Definition: C4Gui.h:2207

References C4GUI::Dialog::UserClose().

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

Here is the call graph for this function:
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::Dialog::RemoveElement ( Element pChild)
overridevirtualinherited

Reimplemented from C4GUI::Container.

Definition at line 427 of file C4GuiDialogs.cpp.

428  {
429  // inherited
430  Window::RemoveElement(pChild);
431  // clear ptr
432  if (pChild == pActiveCtrl) pActiveCtrl = nullptr;
433  }
void RemoveElement(Element *pChild) override

References C4GUI::Dialog::pActiveCtrl, and C4GUI::Container::RemoveElement().

Here is the call graph for this function:

◆ rend()

ReverseIterator C4GUI::Container::rend ( )
inlineinherited

Definition at line 827 of file C4Gui.h.

827 { return ReverseIterator(nullptr); }

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

Here is the caller graph for this function:

◆ ScreenPos2ClientPos()

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

Definition at line 218 of file C4Gui.cpp.

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

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

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

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

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

◆ SetClientSize()

void C4GUI::Dialog::SetClientSize ( int32_t  iToWdt,
int32_t  iToHgt 
)
inherited

Definition at line 769 of file C4GuiDialogs.cpp.

770  {
771  // calc new bounds
772  iToWdt += GetMarginLeft()+GetMarginRight();
773  iToHgt += GetMarginTop()+GetMarginBottom();
774  rcBounds.x += (rcBounds.Wdt - iToWdt)/2;
775  rcBounds.y += (rcBounds.Hgt - iToHgt)/2;
776  rcBounds.Wdt = iToWdt; rcBounds.Hgt = iToHgt;
777  // reflect changes
778  UpdatePos();
779  }
int32_t GetMarginTop() override
Definition: C4Gui.h:2141
int32_t GetMarginBottom() override
Definition: C4Gui.h:2144
int32_t GetMarginRight() override
Definition: C4Gui.h:2143
void UpdatePos() override
int32_t GetMarginLeft() override
Definition: C4Gui.h:2142

References C4GUI::Dialog::GetMarginBottom(), C4GUI::Dialog::GetMarginLeft(), C4GUI::Dialog::GetMarginRight(), C4GUI::Dialog::GetMarginTop(), C4Rect::Hgt, C4GUI::Element::rcBounds, C4GUI::Dialog::UpdatePos(), C4Rect::Wdt, C4Rect::x, and C4Rect::y.

Referenced by C4LeagueSignupDialog::C4LeagueSignupDialog(), and C4GUI::MessageDialog::MessageDialog().

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:

◆ SetDelOnClose()

void C4GUI::Dialog::SetDelOnClose ( bool  fToVal = true)
inlineinherited

Definition at line 2191 of file C4Gui.h.

2191 { fDelOnClose=fToVal; } // dialog will delete itself when closed
bool fDelOnClose
Definition: C4Gui.h:2086

References C4GUI::Dialog::fDelOnClose.

Referenced by C4ChatDlg::C4ChatDlg(), C4ChatInputDialog::C4ChatInputDialog(), C4StartupPlrPropertiesDlg::C4StartupPlrPropertiesDlg(), C4GUI::ConfirmationDialog::ConfirmationDialog(), C4GUI::InputDialog::InputDialog(), C4Network2::OpenSurrenderDialog(), C4Network2::OpenVoteDialog(), C4Network2::QueryClientPassword(), C4Game::ShowGameOverDlg(), and C4GUI::Screen::ShowRemoveDlg().

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:

◆ SetFocus()

void C4GUI::Dialog::SetFocus ( Control pCtrl,
bool  fByMouse 
)
inherited

Definition at line 563 of file C4GuiDialogs.cpp.

564  {
565  // no change?
566  if (pCtrl == pActiveCtrl) return;
567  // leave old focus
568  if (pActiveCtrl)
569  {
570  Control *pC = pActiveCtrl;
571  pActiveCtrl = nullptr;
572  pC->OnLooseFocus();
573  // if leaving the old focus set a new one, abort here because it looks like the control didn't want to lose focus
574  if (pActiveCtrl) return;
575  }
576  // set new
577  if ((pActiveCtrl = pCtrl)) pCtrl->OnGetFocus(fByMouse);
578  }
virtual void OnLooseFocus()
Definition: C4Gui.h:1057

References C4GUI::Control::OnGetFocus(), C4GUI::Control::OnLooseFocus(), and C4GUI::Dialog::pActiveCtrl.

Referenced by C4GUI::Dialog::AdvanceFocus(), C4ChatDlg::C4ChatDlg(), C4GameOverDlg::C4GameOverDlg(), C4LeagueSignupDialog::C4LeagueSignupDialog(), C4StartupModsDlg::C4StartupModsDlg(), C4StartupNetDlg(), C4StartupOptionsDlg::C4StartupOptionsDlg(), C4StartupPlrPropertiesDlg::C4StartupPlrPropertiesDlg(), C4StartupPlrSelDlg::C4StartupPlrSelDlg(), C4StartupScenSelDlg::C4StartupScenSelDlg(), C4GUI::Dialog::CharIn(), C4StartupScenSelDlg::DeselectAll(), DoOK(), C4FileSelDlg::InitElements(), C4GameLobby::MainDlg::MainDlg(), C4GUI::MessageDialog::MessageDialog(), C4GUI::Label::MouseInput(), C4GUI::Control::MouseInput(), C4StartupScenSelDlg::OnButtonScenario(), C4ChatControl::OnConnectBtn(), C4GUI::RenameEdit::OnFinishInput(), C4GUI::Label::OnHotkey(), C4StartupMainDlg::OnShown(), C4StartupScenSelDlg::OpenFolder(), C4GUI::RenameEdit::RenameEdit(), C4GUI::InputDialog::SetCustomEdit(), C4GUI::Container::SetVisibility(), and C4LeagueSignupDialog::UserClose().

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

◆ SetFrameDeco()

void C4GUI::Dialog::SetFrameDeco ( FrameDecoration pNewDeco)
inlineinherited

Definition at line 2194 of file C4Gui.h.

2195  {
2196  if (pFrameDeco) pFrameDeco->Deref();
2197  if ((pFrameDeco = pNewDeco)) pNewDeco->Ref();
2198  UpdateOwnPos(); // margin may have changed; might need to reposition stuff
2199  }
void UpdateOwnPos() override

References C4GUI::FrameDecoration::Deref(), C4GUI::Dialog::pFrameDeco, C4GUI::FrameDecoration::Ref(), and C4GUI::Window::UpdateOwnPos().

Here is the call 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:

◆ SetSubscreen()

virtual bool C4StartupDlg::SetSubscreen ( const char *  szToScreen)
inlinevirtualinherited

Reimplemented in C4StartupModsDlg, and C4StartupOptionsDlg.

Definition at line 100 of file C4Startup.h.

100 { return false; } // go to specified subdialog, e.g. a specific property sheet in the options dlg

Referenced by C4Startup::SwitchDialog().

Here is the caller graph for this function:

◆ SetTitle() [1/2]

void C4GUI::FullscreenDialog::SetTitle ( const char *  szToTitle)
inherited

Definition at line 806 of file C4GuiDialogs.cpp.

807  {
808  if (pFullscreenTitle) { delete pFullscreenTitle; pFullscreenTitle=nullptr; }
809  // change title text; creates or removes title bar if necessary
810  if (szTitle && *szTitle)
811  {
812  // not using dlg label, which is a wooden label
813  if (HasUpperBoard())
815  else
816  // non-woodbar: Title is centered and in big font
819  pFullscreenTitle->SetToolTip(szTitle);
820  }
821  }
#define C4GUI_FullscreenCaptionFontClr
Definition: C4Gui.h:161
const int ACenter
Definition: C4Surface.h:41
int32_t GetMarginTop() override
Definition: C4Gui.h:2247
Label * pFullscreenTitle
Definition: C4Gui.h:2224

References ACenter, C4GUI::Container::AddElement(), ALeft, C4GUI_CaptionFontClr, C4GUI_FullscreenCaptionFontClr, C4UpperBoardHeight, C4GUI::Window::GetClientRect(), CStdFont::GetLineHeight(), C4GUI::FullscreenDialog::GetMarginTop(), GraphicsResource, C4GUI::FullscreenDialog::HasUpperBoard(), C4GUI::FullscreenDialog::pFullscreenTitle, C4GUI::Element::SetToolTip(), and C4GraphicsResource::TitleFont.

Referenced by C4GUI::FullscreenDialog::FullscreenDialog().

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

◆ SetTitle() [2/2]

void C4GUI::Dialog::SetTitle ( const char *  szToTitle,
bool  fShowCloseButton = true 
)
inherited

Definition at line 336 of file C4GuiDialogs.cpp.

337  {
338  // always keep local copy of title
339  TitleString.Copy(szTitle);
340  // console mode dialogs: Use window bar
342  {
343  if (pWindow) pWindow->SetTitle(szTitle ? szTitle : "");
344  return;
345  }
346  // set new
347  if (szTitle && *szTitle)
348  {
350  if (pTitle)
351  {
352  pTitle->GetBounds() = C4Rect(-GetMarginLeft(), -iTextHgt, rcBounds.Wdt, iTextHgt);
353  // noupdate if title is same - this is necessary to prevent scrolling reset when refilling internal menus
354  if (SEqual(pTitle->GetText(), szTitle)) return;
355  pTitle->SetText(szTitle);
356  }
357  else
358  AddElement(pTitle = new WoodenLabel(szTitle, C4Rect(-GetMarginLeft(), -iTextHgt, rcBounds.Wdt, iTextHgt), C4GUI_CaptionFontClr, &::GraphicsResource.TextFont, ALeft, false));
359  pTitle->SetToolTip(szTitle);
360  pTitle->SetDragTarget(this);
362  if (fShowCloseButton)
363  {
364  pTitle->SetRightIndent(20); // for close button
365  if (!pCloseBtn)
366  {
367  AddElement(pCloseBtn = new CallbackButton<Dialog, IconButton>(Ico_Close, pTitle->GetToprightCornerRect(16,16,4,4,0), '\0', &Dialog::OnUserClose));
368  pCloseBtn->SetToolTip(LoadResStr("IDS_MNU_CLOSE"));
369  }
370  else
371  pCloseBtn->GetBounds() = pTitle->GetToprightCornerRect(16,16,4,4,0);
372  }
373  }
374  else
375  {
376  if (pTitle) { delete pTitle; pTitle=nullptr; }
377  if (pCloseBtn) { delete pCloseBtn; pCloseBtn = nullptr; }
378  }
379  }
#define C4GUI_TitleAutoScrollTime
Definition: C4Gui.h:146
bool SEqual(const char *szStr1, const char *szStr2)
Definition: Standard.h:93
CallbackButton< Dialog, C4GUI::IconButton > * pCloseBtn
Definition: C4Gui.h:2080
bool IsViewportDialog()
Definition: C4Gui.h:2173
void OnUserClose(C4GUI::Control *btn)
Definition: C4Gui.h:2205
WoodenLabel * pTitle
Definition: C4Gui.h:2079
void SetDragTarget(Window *pToWindow)
Definition: C4Gui.h:464
C4Rect GetToprightCornerRect(int32_t iWidth=16, int32_t iHeight=16, int32_t iHIndent=4, int32_t iVIndent=4, int32_t iIndexX=0)
Definition: C4Gui.cpp:399
const char * GetText()
Definition: C4Gui.h:503
void SetRightIndent(int32_t iNewIndent)
Definition: C4Gui.h:540
void SetAutoScrollTime(uint32_t tDelay)
Definition: C4Gui.h:537
void SetTitle(const char *Title)
Definition: C4AppT.cpp:114
void Copy()
Definition: StdBuf.h:467
@ Ico_Close
Definition: C4Gui.h:678

References C4GUI::Container::AddElement(), ALeft, Application, C4GUI_CaptionFontClr, C4GUI_TitleAutoScrollTime, StdStrBuf::Copy(), C4GUI::Element::GetBounds(), C4GUI::WoodenLabel::GetDefaultHeight(), C4GUI::Dialog::GetMarginLeft(), C4GUI::Label::GetText(), C4GUI::Element::GetToprightCornerRect(), GraphicsResource, C4GUI::Ico_Close, C4Application::isEditor, C4GUI::Dialog::IsViewportDialog(), LoadResStr(), C4GUI::Dialog::OnUserClose(), C4GUI::Dialog::pCloseBtn, C4GUI::Dialog::pTitle, C4GUI::Dialog::pWindow, C4GUI::Element::rcBounds, SEqual(), C4GUI::WoodenLabel::SetAutoScrollTime(), C4GUI::Element::SetDragTarget(), C4GUI::WoodenLabel::SetRightIndent(), C4GUI::Label::SetText(), C4Window::SetTitle(), C4GUI::Element::SetToolTip(), C4GraphicsResource::TextFont, C4GUI::Dialog::TitleString, and C4Rect::Wdt.

Referenced by C4GUI::Dialog::Dialog(), C4ChatDlg::OnChatTitleChange(), C4StartupModsDownloader::OnConfirmInstallation(), C4Menu::SetSelection(), C4ScoreboardDlg::Update(), and C4Menu::UpdateElementPositions().

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 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(), 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  }
bool IsParentOf(Element *pEl) override
virtual void SetVisibility(bool fToValue)
Definition: C4Gui.cpp:207

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

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

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

◆ Show()

bool C4GUI::Dialog::Show ( Screen pOnScreen,
bool  fCB 
)
inherited

Definition at line 614 of file C4GuiDialogs.cpp.

615  {
616  // already shown?
617  if (fShow) return false;
618  // default screen
619  if (!pOnScreen) if (!(pOnScreen = Screen::GetScreenS())) return false;
620  // show there
621  pOnScreen->ShowDialog(this, false);
622  fVisible = true;
623  // developer mode: Create window
625  if (!CreateConsoleWindow()) return false;
626  // CB
627  if (fCB) OnShown();
628  return true;
629  }
bool CreateConsoleWindow()

References Application, C4GUI::Dialog::CreateConsoleWindow(), C4GUI::Dialog::fShow, C4GUI::Element::fVisible, C4GUI::Screen::GetScreenS(), C4Application::isEditor, C4GUI::Dialog::IsViewportDialog(), C4GUI::Dialog::OnShown(), and C4GUI::Screen::ShowDialog().

Referenced by C4Network2::FinalInit(), C4Game::InitNetworkFromAddress(), C4Network2::LeaguePlrAuth(), C4Network2::LeagueStart(), C4Network2::OpenSurrenderDialog(), C4Network2::OpenVoteDialog(), C4Network2::RetrieveRes(), C4ChatDlg::ShowChat(), C4Game::ShowGameOverDlg(), C4DownloadDlg::ShowModal(), C4GUI::Screen::ShowModalDlg(), C4GUI::Screen::ShowProgressDlg(), C4GUI::Screen::ShowRemoveDlg(), and C4Startup::SwitchDialog().

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

◆ StartDragging()

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

Definition at line 259 of file C4Gui.cpp.

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

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

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

Here is the caller graph for this function:

◆ StopDragging()

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

Definition at line 282 of file C4Gui.cpp.

283  {
284  // move element pos
285  DoDragging(rMouse, iX, iY, dwKeyParam);
286  }
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::FullscreenDialog::UpdateOwnPos ( )
overrideprotectedvirtualinherited

Reimplemented from C4GUI::Window.

Definition at line 830 of file C4GuiDialogs.cpp.

831  {
832  // inherited to update client rect
834  }

References C4GUI::Window::UpdateOwnPos().

Here is the call graph for this function:

◆ UpdatePos()

void C4GUI::Dialog::UpdatePos ( )
overrideprotectedvirtualinherited

Reimplemented from C4GUI::Element.

Definition at line 416 of file C4GuiDialogs.cpp.

417  {
418  // Dialogs with their own windows can only be at 0/0
419  if (pWindow)
420  {
421  rcBounds.x = 0;
422  rcBounds.y = 0;
423  }
425  }

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

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

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

◆ UpdateSize()

void C4GUI::Dialog::UpdateSize ( )
overrideprotectedvirtualinherited

Reimplemented from C4GUI::Element.

Definition at line 398 of file C4GuiDialogs.cpp.

399  {
400  // update title bar position
401  if (pTitle)
402  {
404  pTitle->SetBounds(C4Rect(-GetMarginLeft(), -iTextHgt, rcBounds.Wdt, iTextHgt));
405  if (pCloseBtn) pCloseBtn->SetBounds(pTitle->GetToprightCornerRect(16,16,4,4,0));
406  }
407  // inherited
409  // update assigned window
410  if (pWindow)
411  {
413  }
414  }
void SetSize(unsigned int cx, unsigned int cy)
Definition: C4AppT.cpp:113

References C4GUI::WoodenLabel::GetDefaultHeight(), C4GUI::Dialog::GetMarginLeft(), C4GUI::Element::GetToprightCornerRect(), GraphicsResource, C4Rect::Hgt, C4GUI::Dialog::pCloseBtn, C4GUI::Dialog::pTitle, C4GUI::Dialog::pWindow, C4GUI::Element::rcBounds, C4GUI::Element::SetBounds(), C4Window::SetSize(), C4GraphicsResource::TextFont, C4GUI::Element::UpdateSize(), and C4Rect::Wdt.

Referenced by C4StartupAboutDlg::C4StartupAboutDlg(), C4StartupLegalDlg::C4StartupLegalDlg(), C4StartupModsDlg::C4StartupModsDlg(), C4StartupNetDlg(), C4StartupOptionsDlg::C4StartupOptionsDlg(), C4StartupPlrPropertiesDlg::C4StartupPlrPropertiesDlg(), C4StartupPlrSelDlg::C4StartupPlrSelDlg(), C4StartupScenSelDlg::C4StartupScenSelDlg(), and C4FileSelDlg::InitElements().

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

◆ UserClose()

virtual void C4GUI::Dialog::UserClose ( bool  fOK)
inlinevirtualinherited

Reimplemented in C4LeagueSignupDialog, C4StartupPlrPropertiesDlg, C4StartupOptionsDlg, C4Menu, C4FileSelDlg, and C4DownloadDlg.

Definition at line 2207 of file C4Gui.h.

2207 { Close(fOK); }
void Close(bool fOK)

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

Referenced by C4GUI::Dialog::OnEnter(), C4GUI::Dialog::OnEscape(), C4GameOverDlg::OnEscape(), C4ChatDlg::OnExitBtn(), C4GUI::CloseButton::OnPress(), C4GUI::CloseIconButton::OnPress(), and C4GUI::Dialog::OnUserClose().

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

Member Data Documentation

◆ eFade

Fade C4GUI::Dialog::eFade
protectedinherited

◆ fDelOnClose

bool C4GUI::Dialog::fDelOnClose
protectedinherited

◆ fDragging

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

Definition at line 380 of file C4Gui.h.

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

◆ fOK

◆ fShow

◆ fViewportDlg

bool C4GUI::Dialog::fViewportDlg
protectedinherited

Definition at line 2088 of file C4Gui.h.

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

◆ fVisible

◆ iDlgMarginX

int32_t C4GUI::FullscreenDialog::iDlgMarginX
protectedinherited

◆ iDlgMarginY

int32_t C4GUI::FullscreenDialog::iDlgMarginY
protectedinherited

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

◆ iFade

int32_t C4GUI::Dialog::iFade
protectedinherited

◆ pActiveCtrl

◆ pCloseBtn

CallbackButton<Dialog, C4GUI::IconButton>* C4GUI::Dialog::pCloseBtn
protectedinherited

Definition at line 2080 of file C4Gui.h.

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

◆ pContextHandler

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

◆ pDragTarget

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

◆ pFirst

◆ pFrameDeco

◆ pFullscreenTitle

Label* C4GUI::FullscreenDialog::pFullscreenTitle
protectedinherited

Definition at line 2224 of file C4Gui.h.

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

◆ pLast

◆ pNext

◆ pParent

◆ pPrev

◆ pSubTitle

Label * C4GUI::FullscreenDialog::pSubTitle
protectedinherited

◆ pTitle

WoodenLabel* C4GUI::Dialog::pTitle
protectedinherited

◆ pWindow

◆ 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

◆ TitleString

StdStrBuf C4GUI::Dialog::TitleString
protectedinherited

Definition at line 2087 of file C4Gui.h.

Referenced by C4GUI::Dialog::CreateConsoleWindow(), and C4GUI::Dialog::SetTitle().


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