OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4StartupNetDlg Class Reference

#include <C4StartupNetDlg.h>

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

Public Member Functions

 C4StartupNetDlg ()
 
 ~C4StartupNetDlg ()
 
bool DoOK ()
 
bool DoBack ()
 
void DoRefresh ()
 
void CreateGame ()
 
void OnReferenceEntryAdd (C4StartupNetListEntry *pEntry)
 
void OnSec1Timer ()
 
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)
 
virtual void RemoveElement (Element *pChild)
 
virtual void Draw (C4TargetFacet &cgo)
 
virtual void ApplyElementOffset (int32_t &riX, int32_t &riY)
 
virtual void ApplyInvElementOffset (int32_t &riX, int32_t &riY)
 
virtual bool IsFocused (Control *pCtrl)
 
void SetFocus (Control *pCtrl, bool fByMouse)
 
ControlGetFocus ()
 
virtual DialogGetDlg ()
 
virtual DialogWindow * GetDialogWindow ()
 
virtual bool CharIn (const char *c)
 
virtual void MouseInput (CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam)
 
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 ()
 
virtual bool IsExternalDrawDialog ()
 
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 ()
 
virtual ContextHandler * GetContextHandler ()
 
void SetPos (int32_t iXPos, int32_t iYPos)
 
virtual C4RectGetClientRect ()
 
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)
 
virtual ElementGetFirstContained ()
 
virtual ElementGetLastContained ()
 
virtual ElementGetFirstNestedElement (bool fBackwards)
 
Iterator begin ()
 
Iterator end ()
 
ReverseIterator rbegin ()
 
ReverseIterator rend ()
 
ElementGetFirst ()
 
ElementGetLast ()
 
virtual ContainerGetContainer ()
 
ElementGetElementByIndex (int32_t i)
 
int32_t GetElementCount ()
 
virtual void SetVisibility (bool fToValue)
 
virtual bool IsSelectedChild (Element *pChild)
 
virtual bool IsParentOf (Element *pEl)
 
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
 

Protected Member Functions

virtual bool HasBackground ()
 
virtual void DrawElement (C4TargetFacet &cgo)
 
virtual C4GUI::ControlGetDefaultControl ()
 
C4GUI::ControlGetDlgModeFocusControl ()
 
virtual bool OnEnter ()
 
virtual bool OnEscape ()
 
bool KeyBack ()
 
bool KeyRefresh ()
 
bool KeyForward ()
 
virtual void OnShown ()
 
virtual void OnClosed (bool fOK)
 
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)
 
virtual const char * GetID ()
 
virtual bool IsComponentOutsideClientArea ()
 
virtual bool HasUpperBoard ()
 
virtual bool IsFullscreenDialog ()
 
virtual bool DoPlacement (Screen *pOnScreen, const C4Rect &rPreferredDlgRect)
 
virtual int32_t GetMarginTop ()
 
virtual int32_t GetMarginLeft ()
 
virtual int32_t GetMarginRight ()
 
virtual int32_t GetMarginBottom ()
 
virtual void UpdateOwnPos ()
 
void DrawBackground (C4TargetFacet &cgo, C4Facet &rFromFct)
 
bool CreateConsoleWindow ()
 
void DestroyConsoleWindow ()
 
virtual void UpdateSize ()
 
virtual void UpdatePos ()
 
virtual void ElementSizeChanged (Element *pOfElement)
 
virtual void ElementPosChanged (Element *pOfElement)
 
virtual void AfterElementRemoval ()
 
virtual bool OnHotkey (uint32_t cHotkey)
 
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
 
ElementpPrev
 
ElementpNext
 
WindowpDragTarget
 
int32_t iDragX
 
int32_t iDragY
 
bool fDragging
 
ContextHandler * pContextHandler
 
C4Rect rcBounds
 

Private Member Functions

virtual bool Execute (int, pollfd *)
 
void Set ()
 
void SetDelay (uint32_t inDelay)
 
bool CheckAndReset ()
 
virtual C4TimeMilliseconds GetNextTick (C4TimeMilliseconds tNow)
 
virtual uint32_t TimerInterval ()
 
void Changed ()
 
bool ExecuteUntil (int iTimeout=-1)
 
virtual void GetFDs (std::vector< struct pollfd > &)
 
bool IsSignaled ()
 
virtual bool IsLowPriority ()
 
virtual bool IsNotify ()
 

Detailed Description

Definition at line 126 of file C4StartupNetDlg.h.

Constructor & Destructor Documentation

C4StartupNetDlg::C4StartupNetDlg ( )

Definition at line 595 of file C4StartupNetDlg.cpp.

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::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(), C4GUI::Container::SetVisibility(), C4Network2IODiscoverClient::StartDiscovery(), C4GUI::Tabular::tbNone, C4GraphicsResource::TextFont, C4GUI::ListBox::UpdateElementPositions(), C4GUI::Dialog::UpdateSize(), and C4Rect::Wdt.

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

Here is the call graph for this function:

C4StartupNetDlg::~C4StartupNetDlg ( )

Definition at line 744 of file C4StartupNetDlg.cpp.

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

745 {
746  // disable notifies
748  Application.InteractiveThread.RemoveProc(&pUpdateClient);
749 
750  DiscoverClient.Close();
751  Application.Remove(this);
752  if (pMasterserverClient) delete pMasterserverClient;
753  // dtor
754  delete pKeyBack;
755  delete pKeyRefresh;
756 }
void ClearCallback(C4InteractiveEventType eEvent, Callback *pnNetworkCallback)
void RemoveProc(StdSchedulerProc *pProc)
void Remove(StdSchedulerProc *pProc)
C4Application Application
Definition: C4Globals.cpp:44
virtual bool Close()
Definition: C4NetIO.cpp:2001
C4InteractiveThread InteractiveThread
Definition: C4Application.h:45

Here is the call graph for this function:

Member Function Documentation

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

Definition at line 118 of file C4GuiContainers.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 581 of file C4GuiDialogs.cpp.

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented in C4GUI::ListBox.

Definition at line 756 of file C4Gui.h.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

void C4GUI::Dialog::ApplyElementOffset ( int32_t &  riX,
int32_t &  riY 
)
virtualinherited

Reimplemented from C4GUI::Window.

Definition at line 744 of file C4GuiDialogs.cpp.

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

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

Here is the call graph for this function:

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

Reimplemented from C4GUI::Window.

Definition at line 757 of file C4GuiDialogs.cpp.

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

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

Here is the call graph for this function:

Iterator C4GUI::Container::begin ( )
inlineinherited

Definition at line 824 of file C4Gui.h.

Referenced by C4ScriptGuiWindow::ClearPointers(), and C4ScriptGuiWindow::DrawChildren().

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

Here is the caller graph for this function:

bool C4GUI::Dialog::CharIn ( const char *  c)
virtualinherited

Definition at line 520 of file C4GuiDialogs.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented in C4StartupScenSelDlg::ScenListItem.

Definition at line 407 of file C4Gui.h.

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

407 { return false; }

Here is the caller graph for this function:

void C4StartupNetDlg::CheckVersionUpdate ( )

Definition at line 1257 of file C4StartupNetDlg.cpp.

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

Referenced by OnShown().

1258 {
1259 #ifdef WITH_AUTOMATIC_UPDATE
1260  StdStrBuf strVersion; strVersion.Format("%d.%d", C4XVER1, C4XVER2);
1261  StdStrBuf strQuery; strQuery.Format("%s?version=%s&platform=%s&action=version", Config.Network.UpdateServerAddress, strVersion.getData(), C4_OS);
1262 
1263  if (pUpdateClient.Init() && pUpdateClient.SetServer(strQuery.getData()) && pUpdateClient.QueryUpdateURL())
1264  {
1265  pUpdateClient.SetNotify(&Application.InteractiveThread);
1266  Application.InteractiveThread.AddProc(&pUpdateClient);
1267  }
1268  fUpdateCheckPending = true;
1269 #endif
1270 }
const char * getData() const
Definition: StdBuf.h:450
C4Config Config
Definition: C4Config.cpp:831
void Format(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O
Definition: StdBuf.cpp:181
C4ConfigNetwork Network
Definition: C4Config.h:256
bool AddProc(StdSchedulerProc *pProc)
void SetNotify(class C4InteractiveThread *pnNotify)
#define C4_OS
virtual bool Init(uint16_t iPort=addr_t::IPPORT_NONE)
Definition: C4NetIO.cpp:824
bool SetServer(const char *szServerAddress)
C4Application Application
Definition: C4Globals.cpp:44
C4InteractiveThread InteractiveThread
Definition: C4Application.h:45

Here is the call graph for this function:

Here is the caller graph for this function:

void C4GUI::Container::Clear ( )
inherited

Definition at line 63 of file C4GuiContainers.cpp.

References C4GUI::Container::ClearChildren().

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

64  {
65  ClearChildren();
66  }

Here is the call graph for this function:

Here is the caller graph for this function:

void C4GUI::Container::ClearChildren ( )
inherited

Definition at line 68 of file C4GuiContainers.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

void C4GUI::Dialog::ClearFrameDeco ( )
inlineinherited

Definition at line 2199 of file C4Gui.h.

References C4GUI::FrameDecoration::Deref().

Referenced by C4Menu::Clear().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 232 of file C4Gui.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 632 of file C4GuiDialogs.cpp.

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(), DialogWinProc(), 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(), C4FileSelDlg::UserClose(), C4StartupPlrPropertiesDlg::UserClose(), and C4GUI::Dialog::UserClose().

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4GUI::Dialog::CreateConsoleWindow ( )
protectedinherited

Definition at line 240 of file C4GuiDialogs.cpp.

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

241  {
242 #ifdef WITH_QT_EDITOR
243  // TODO: Implement these as Qt editor windows.
244  // This currently creates an empty window in Windows and a segfault in Linux.
245  return false;
246 #endif
247  // already created?
248  if (pWindow) return true;
249  // create it!
250  pWindow = new DialogWindow();
252  {
253  delete pWindow;
254  pWindow = nullptr;
255  return false;
256  }
257  // create rendering context
259  pWindow->pDialog = this;
260  return true;
261  }
const char * getData() const
Definition: StdBuf.h:450
C4Surface * pSurface
Definition: C4Window.h:279
virtual const char * GetID()
Definition: C4Gui.h:2107
DialogWindow * pWindow
Definition: C4Gui.h:2088
C4Window * Init(C4AbstractApp *pApp, const char *Title, const C4Rect &rcBounds, const char *szID)
StdStrBuf TitleString
Definition: C4Gui.h:2086
Dialog * pDialog
Definition: C4Gui.h:2032
C4Rect rcBounds
Definition: C4Gui.h:385
C4Application Application
Definition: C4Globals.cpp:44

Here is the call graph for this function:

Here is the caller graph for this function:

void C4StartupNetDlg::CreateGame ( )

Definition at line 1205 of file C4StartupNetDlg.cpp.

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

Referenced by OnCreateGameBtn().

1206 {
1208 }
class C4StartupDlg * SwitchDialog(DialogID eToDlg, bool fFade=true, const char *szSubDialog=nullptr)
Definition: C4Startup.cpp:139
static C4Startup * Get()
Definition: C4Startup.h:133

Here is the call graph for this function:

Here is the caller graph for this function:

void C4GUI::Dialog::DestroyConsoleWindow ( )
protectedinherited

Definition at line 263 of file C4GuiDialogs.cpp.

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

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

264  {
265  if (pWindow)
266  {
267  delete pWindow->pSurface;
268  pWindow->Clear();
269  delete pWindow;
270  pWindow = nullptr;
271  }
272  }
C4Surface * pSurface
Definition: C4Window.h:279
DialogWindow * pWindow
Definition: C4Gui.h:2088
virtual void Clear()
Definition: C4AppT.cpp:100

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4StartupNetDlg::DoBack ( )

Definition at line 1165 of file C4StartupNetDlg.cpp.

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

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

1166 {
1167  // abort dialog: Back to main
1169  return true;
1170 }
class C4StartupDlg * SwitchDialog(DialogID eToDlg, bool fFade=true, const char *szSubDialog=nullptr)
Definition: C4Startup.cpp:139
static C4Startup * Get()
Definition: C4Startup.h:133

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4GUI::Element::DoContext ( )
inherited

Definition at line 418 of file C4Gui.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Definition at line 270 of file C4Gui.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4GUI::Dialog::DoModal ( )
inherited

Definition at line 659 of file C4GuiDialogs.cpp.

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4StartupNetDlg::DoOK ( )

Definition at line 1007 of file C4StartupNetDlg.cpp.

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::getGameVersion(), C4StartupNetListEntry::GetJoinAddress(), C4StartupNetListEntry::GetReference(), C4GUI::ListBox::GetSelectedItem(), StdBuf::getSize(), C4GameVersion::GetString(), C4GUI::Edit::GetText(), C4StartupNetListEntry::GrabReference(), C4GUI::Ico_Error, C4Network2Reference::isEditor(), C4Network2Reference::isJoinAllowed(), LoadResStr(), MakeTempFilename(), C4Game::NetworkActive, C4StartupNetListEntry::NRQT_DirectJoin, C4Application::OpenGame(), pGUI, C4Game::pJoinReference, RestartApplication(), StdBuf::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().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from C4GUI::Dialog.

Definition at line 2244 of file C4Gui.h.

2244 { return true; } // fullscreen dlg already placed
void C4StartupNetDlg::DoRefresh ( )

Definition at line 1172 of file C4StartupNetDlg.cpp.

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

1173 {
1174  // check min refresh timer
1175  time_t tNow = time(0);
1176  if (tLastRefresh && tNow < tLastRefresh + C4NetMinRefreshInterval)
1177  {
1178  // avoid hammering on refresh key
1179  C4GUI::GUISound("UI::Error");
1180  return;
1181  }
1182  tLastRefresh = tNow;
1183  // empty list of all old entries
1184  fUpdatingList = true;
1185  while (pGameSelList->GetFirst()) delete pGameSelList->GetFirst();
1186  pMasterserverClient=nullptr;
1187  // (Re-)Start discovery
1188  if (!DiscoverClient.StartDiscovery())
1189  {
1190  StdCopyStrBuf strNoDiscovery(LoadResStr("IDS_NET_NODISCOVERY"));
1192  FormatString(LoadResStr("IDS_NET_NODISCOVERY_DESC"), DiscoverClient.GetError()).getData(),
1193  strNoDiscovery.getData(),
1196  }
1197  iGameDiscoverInterval = C4NetGameDiscoveryInterval;
1198  // restart masterserver query
1199  UpdateMasterserver();
1200  // done; update stuff
1201  fUpdatingList = false;
1202  UpdateList();
1203 }
const char * getData() const
Definition: StdBuf.h:450
void GUISound(const char *szSound)
Definition: C4Gui.cpp:1178
virtual const char * GetError() const
Definition: C4NetIO.h:285
Element * GetFirst()
Definition: C4Gui.h:1571
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
C4GUIScreen * pGUI
Definition: C4Gui.cpp:1194
bool ShowMessageModal(const char *szMessage, const char *szCaption, DWORD dwButtons, Icons icoIcon, int32_t *piConfigDontShowAgainSetting=nullptr)
const int C4NetGameDiscoveryInterval
const int C4NetMinRefreshInterval
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:277

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from C4GUI::Window.

Reimplemented in C4Menu, and C4ScoreboardDlg.

Definition at line 436 of file C4GuiDialogs.cpp.

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(), C4Rect::Hgt, C4Facet::Hgt, C4GUI::Dialog::iFade, C4Surface::PageFlip(), pDraw, C4Window::pSurface, C4GUI::Dialog::pWindow, C4GUI::Screen::RecheckActiveDialog(), C4TargetFacet::Set(), C4Facet::Surface, C4Rect::Wdt, C4Facet::Wdt, C4Rect::x, C4Facet::X, C4Rect::y, and C4Facet::Y.

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 292 of file C4Gui.cpp.

References C4GUI_BorderColor1, C4GUI_BorderColor2, C4GUI_BorderColor3, C4Draw::DrawLineDw(), C4Rect::Hgt, pDraw, C4GUI::Element::rcBounds, C4Facet::Surface, C4TargetFacet::TargetX, C4TargetFacet::TargetY, C4Rect::Wdt, C4Rect::x, and C4Rect::y.

Referenced by C4GUI::ProgressBar::DrawElement(), C4GUI::GroupBox::DrawElement(), C4GUI::Edit::DrawElement(), C4GUI::ListBox::DrawElement(), C4GUI::Tabular::DrawElement(), C4GUI::TextWindow::DrawElement(), C4GUI::ContextMenu::DrawElement(), C4GUI::ComboBox::DrawElement(), and C4GUI::Dialog::DrawElement().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 837 of file C4GuiDialogs.cpp.

References C4Facet::DrawFullScreen().

Referenced by C4StartupScenSelDlg::DrawElement().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 309 of file C4Gui.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

void C4StartupNetDlg::DrawElement ( C4TargetFacet cgo)
protectedvirtual

Reimplemented from C4GUI::FullscreenDialog.

Definition at line 758 of file C4StartupNetDlg.cpp.

759 {
760  // draw background
761  typedef C4GUI::FullscreenDialog Base;
762  Base::DrawElement(cgo);
763 }
void C4GUI::Element::DrawHBarByVGfx ( C4TargetFacet cgo,
DynBarFacet rFacets 
)
protectedinherited

Definition at line 366 of file C4Gui.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 376 of file C4Gui.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 360 of file C4Gui.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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.

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

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

Here is the caller graph for this function:

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

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

Definition at line 753 of file C4Gui.h.

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

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

Here is the caller graph for this function:

Iterator C4GUI::Container::end ( )
inlineinherited

Definition at line 825 of file C4Gui.h.

Referenced by C4ScriptGuiWindow::ClearPointers(), and C4ScriptGuiWindow::DrawChildren().

825 { return Iterator(nullptr); }

Here is the caller graph for this function:

bool C4GUI::Dialog::Execute ( )
inherited

Definition at line 681 of file C4GuiDialogs.cpp.

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

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

682  {
683  // process messages
684  if (!Application.ScheduleProcs(0))
685  return false;
686  // check status
687  if (!fShow) return false;
688  return true;
689  }
bool fShow
Definition: C4Gui.h:2081
bool ScheduleProcs(int iTimeout=1000/36)
C4Application Application
Definition: C4Globals.cpp:44

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4GUI::Dialog::Execute2 ( )
inherited

Definition at line 691 of file C4GuiDialogs.cpp.

References C4GUI::Dialog::Execute().

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

Here is the call graph for this function:

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

Definition at line 715 of file C4GuiDialogs.cpp.

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 729 of file C4GuiDialogs.cpp.

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 445 of file C4Gui.h.

References C4GUI::Element::rcBounds.

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

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

Here is the caller graph for this function:

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

Reimplemented from C4GUI::Element.

Definition at line 864 of file C4Gui.h.

References C4GUI::Window::rcClientRect.

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

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

Here is the caller graph for this function:

C4Rect C4GUI::Element::GetContainedClientRect ( )
inlineinherited
virtual Container* C4GUI::Container::GetContainer ( )
inlinevirtualinherited

Reimplemented from C4GUI::Element.

Definition at line 831 of file C4Gui.h.

831 { return this; } // returns parent for elements; this for containers
virtual ContextHandler* C4GUI::Dialog::GetContextHandler ( )
inlinevirtualinherited

Reimplemented from C4GUI::Element.

Definition at line 2211 of file C4Gui.h.

References C4GUI::Element::pContextHandler.

2212  { return pContextHandler; }
ContextHandler * pContextHandler
Definition: C4Gui.h:381
C4GUI::Control * C4StartupNetDlg::GetDefaultControl ( )
protectedvirtual

Reimplemented from C4GUI::Dialog.

Definition at line 786 of file C4StartupNetDlg.cpp.

References C4ChatControl::GetDefaultControl().

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

Here is the call graph for this function:

int32_t C4GUI::Dialog::GetDefaultTitleHeight ( )
staticinherited

Definition at line 331 of file C4GuiDialogs.cpp.

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

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

Here is the call graph for this function:

virtual DialogWindow* C4GUI::Dialog::GetDialogWindow ( )
inlinevirtualinherited

Reimplemented from C4GUI::Element.

Definition at line 2117 of file C4Gui.h.

References C4GUI::Dialog::pWindow.

2117 { return pWindow; }
DialogWindow * pWindow
Definition: C4Gui.h:2088
virtual Dialog* C4GUI::Dialog::GetDlg ( )
inlinevirtualinherited

Reimplemented from C4GUI::Element.

Definition at line 2116 of file C4Gui.h.

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

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

Here is the caller graph for this function:

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

Definition at line 797 of file C4StartupNetDlg.cpp.

References C4ChatControl::GetDefaultControl().

Referenced by C4StartupNetDlg().

798 {
799  // default control depends on whether dlg is in chat or game list mode
800  if (GetDlgMode() == SNDM_Chat && pChatCtrl)
801  // chat mode: Chat input edit
802  return pChatCtrl->GetDefaultControl();
803  else
804  // game list mode: Game list box
805  return pGameSelList;
806 }
virtual class C4GUI::Control * GetDefaultControl()
Definition: C4ChatDlg.cpp:426

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 223 of file C4GuiContainers.cpp.

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

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

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

Here is the caller graph for this function:

int32_t C4GUI::Container::GetElementCount ( )
inherited

Definition at line 232 of file C4GuiContainers.cpp.

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

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

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

Here is the caller graph for this function:

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

Reimplemented from C4GUI::Element.

Definition at line 773 of file C4Gui.h.

References C4GUI::Container::pFirst.

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

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

Here is the caller graph for this function:

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

Reimplemented from C4GUI::Element.

Definition at line 204 of file C4GuiContainers.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 2115 of file C4Gui.h.

References C4GUI::Dialog::pActiveCtrl.

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

2115 { return pActiveCtrl; }
Control * pActiveCtrl
Definition: C4Gui.h:2080

Here is the caller graph for this function:

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

Definition at line 2201 of file C4Gui.h.

References C4GUI::Dialog::pFrameDeco.

2201 { return pFrameDeco; }
FrameDecoration * pFrameDeco
Definition: C4Gui.h:2089
int32_t C4GUI::Element::GetHeight ( )
inlineinherited

Definition at line 444 of file C4Gui.h.

References C4Rect::Hgt.

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

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

Here is the caller graph for this function:

virtual const char* C4GUI::FullscreenDialog::GetID ( )
inlineprotectedvirtualinherited

Reimplemented from C4GUI::Dialog.

Definition at line 2226 of file C4Gui.h.

2226 { return 0; } // no ID needed, because it's never created as a window
Element* C4GUI::Container::GetLast ( )
inlineinherited

Definition at line 830 of file C4Gui.h.

References C4GUI::Container::pLast.

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

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

Here is the caller graph for this function:

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

Definition at line 774 of file C4Gui.h.

References C4GUI::Container::pLast.

774 { return pLast; }
Element * pLast
Definition: C4Gui.h:750
virtual int32_t C4GUI::Element::GetListItemTopSpacing ( )
inlinevirtualinherited

Reimplemented in C4StartupNetListEntry.

Definition at line 461 of file C4Gui.h.

References C4GUI_DefaultListSpacing.

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

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

Here is the caller graph for this function:

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

Definition at line 462 of file C4Gui.h.

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

462 { return false; }

Here is the caller graph for this function:

virtual int32_t C4GUI::FullscreenDialog::GetMarginBottom ( )
inlineprotectedvirtualinherited

Reimplemented from C4GUI::Dialog.

Definition at line 2249 of file C4Gui.h.

References C4GUI::FullscreenDialog::iDlgMarginY.

2249 { return iDlgMarginY; }
virtual int32_t C4GUI::FullscreenDialog::GetMarginLeft ( )
inlineprotectedvirtualinherited

Reimplemented from C4GUI::Dialog.

Definition at line 2247 of file C4Gui.h.

References C4GUI::FullscreenDialog::iDlgMarginX.

2247 { return iDlgMarginX; }
virtual int32_t C4GUI::FullscreenDialog::GetMarginRight ( )
inlineprotectedvirtualinherited

Reimplemented from C4GUI::Dialog.

Definition at line 2248 of file C4Gui.h.

References C4GUI::FullscreenDialog::iDlgMarginX.

2248 { return iDlgMarginX; }
virtual int32_t C4GUI::FullscreenDialog::GetMarginTop ( )
inlineprotectedvirtualinherited

Reimplemented from C4GUI::Dialog.

Reimplemented in C4StartupScenSelDlg, and C4StartupPlrSelDlg.

Definition at line 2246 of file C4Gui.h.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 171 of file C4GuiContainers.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 440 of file C4Gui.h.

References StdStrBuf::getData().

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

Here is the call graph for this function:

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

Definition at line 450 of file C4Gui.h.

References C4GUI::Element::pPrev.

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

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

Here is the caller graph for this function:

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

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

Definition at line 290 of file C4Gui.cpp.

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(), and C4ChatControl::UserQueryQuit().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 424 of file C4Gui.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 400 of file C4Gui.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented in C4Menu.

Definition at line 2171 of file C4Gui.h.

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

2171 { return nullptr; }

Here is the caller graph for this function:

int32_t C4GUI::Element::GetWidth ( )
inlineinherited

Definition at line 443 of file C4Gui.h.

References C4Rect::Wdt.

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

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

Here is the caller graph for this function:

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

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

Definition at line 2181 of file C4Gui.h.

References C4GUI_Z_DEFAULT.

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

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

Here is the caller graph for this function:

virtual bool C4StartupNetDlg::HasBackground ( )
inlineprotectedvirtual

Reimplemented from C4GUI::Dialog.

Definition at line 158 of file C4StartupNetDlg.h.

158 { return false; }
virtual bool C4GUI::FullscreenDialog::HasUpperBoard ( )
inlineprotectedvirtualinherited

Definition at line 2241 of file C4Gui.h.

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

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

Here is the caller graph for this function:

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

Definition at line 150 of file C4GuiContainers.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4GUI::Dialog::IsAborted ( )
inlineinherited

Definition at line 2149 of file C4Gui.h.

References C4GUI::Dialog::fOK.

Referenced by C4Network2::DoLobby(), C4Network2::FinalInit(), and C4Network2::RetrieveRes().

2149 { return !fShow && !fOK; } // returns whether dialog has been aborted
bool fShow
Definition: C4Gui.h:2081
bool fOK
Definition: C4Gui.h:2082

Here is the caller graph for this function:

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

Definition at line 700 of file C4GuiDialogs.cpp.

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented in C4ChatInputDialog.

Definition at line 2161 of file C4Gui.h.

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

2161 { return false; }

Here is the caller graph for this function:

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

Reimplemented from C4GUI::Dialog.

Definition at line 2239 of file C4Gui.h.

2239 { return true; }
virtual bool C4GUI::Dialog::IsExclusiveDialog ( )
inlinevirtualinherited

Reimplemented in C4ChatDlg, C4GameOverDlg, C4ChatInputDialog, and C4AbortGameDialog.

Definition at line 2164 of file C4Gui.h.

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

2164 { return false; }

Here is the caller graph for this function:

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

Reimplemented from C4GUI::Element.

Reimplemented in C4Menu.

Definition at line 2178 of file C4Gui.h.

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

2178 { return false; }

Here is the caller graph for this function:

bool C4GUI::Dialog::IsFading ( )
inlineinherited

Definition at line 2151 of file C4Gui.h.

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

2151 { return eFade != eFadeNone; }
Fade eFade
Definition: C4Gui.h:2084

Here is the caller graph for this function:

virtual bool C4GUI::Dialog::IsFocused ( Control pCtrl)
inlinevirtualinherited

Reimplemented from C4GUI::Container.

Definition at line 2113 of file C4Gui.h.

References C4GUI::Dialog::pActiveCtrl.

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

2113 { return pCtrl == pActiveCtrl; }
Control * pActiveCtrl
Definition: C4Gui.h:2080

Here is the caller graph for this function:

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

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

Definition at line 432 of file C4Gui.h.

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

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

Here is the caller graph for this function:

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

Reimplemented in C4ChatDlg, C4GameOverDlg, C4ChatInputDialog, and C4AbortGameDialog.

Definition at line 2158 of file C4Gui.h.

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

2158 { return false; }

Here is the caller graph for this function:

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

Reimplemented from C4GUI::Dialog.

Definition at line 2243 of file C4Gui.h.

2243 { return true; }
bool C4GUI::Element::IsImmediateToolTip ( ) const
inlineinherited

Definition at line 441 of file C4Gui.h.

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

441 { return is_immediate_tooltip; }

Here is the caller graph for this function:

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

Definition at line 436 of file C4Gui.cpp.

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

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

437  {
438  // get dlg
439  Dialog *pDlg=GetDlg();
440  if (!pDlg) return false;
441  // check if dlg is active
442  return pDlg->IsActive(fForKeyboard);
443  }
virtual class Dialog * GetDlg()
Definition: C4Gui.cpp:289

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Definition at line 403 of file C4Gui.h.

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

403 { return false; }

Here is the caller graph for this function:

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

Reimplemented in C4Menu, C4ChatInputDialog, and C4ScoreboardDlg.

Definition at line 2168 of file C4Gui.h.

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

2168 { return true; }

Here is the caller graph for this function:

bool C4GUI::Dialog::IsOK ( )
inlineinherited

Definition at line 2148 of file C4Gui.h.

References C4GUI::Dialog::fOK.

2148 { return fOK; } // returns whether user pressed OK
bool fOK
Definition: C4Gui.h:2082
virtual bool C4GUI::Element::IsOwnPtrElement ( )
inlineprotectedvirtualinherited

Reimplemented in C4Menu.

Definition at line 401 of file C4Gui.h.

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

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

Here is the caller graph for this function:

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

Reimplemented from C4GUI::Element.

Definition at line 239 of file C4GuiContainers.cpp.

References C4GUI::Element::GetParent().

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Definition at line 837 of file C4Gui.h.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4GUI::Dialog::IsShown ( )
inlineinherited

Definition at line 2147 of file C4Gui.h.

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

2147 { return fShow; } // returns whether dlg is on screen (may be invisible)
bool fShow
Definition: C4Gui.h:2081

Here is the caller graph for this function:

bool C4GUI::Dialog::IsViewportDialog ( )
inlineinherited

Definition at line 2172 of file C4Gui.h.

References C4GUI::Dialog::fViewportDlg.

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

2172 { return fViewportDlg; }
bool fViewportDlg
Definition: C4Gui.h:2087

Here is the caller graph for this function:

bool C4GUI::Element::IsVisible ( )
inherited

Definition at line 202 of file C4Gui.cpp.

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

Referenced by C4GUI::Dialog::AdvanceFocus(), C4GUI::Screen::CharIn(), C4GUI::ControlKeyDlgCB< TargetClass >::CheckCondition(), C4ScriptGuiWindow::Draw(), C4GUI::Container::Draw(), C4GUI::Window::Draw(), C4GUI::Screen::Draw(), C4ScriptGuiWindow::DrawAll(), C4ScriptGuiWindow::DrawChildren(), C4ChatControl::GetDefaultControl(), C4GUI::Screen::GetFullscreenDialog(), C4GUI::Element::IsVisible(), C4ScriptGuiWindow::IsVisibleTo(), C4GUI::Window::MouseInput(), C4GUI::Control::MouseInput(), C4GUI::Screen::MouseInput(), C4GUI::Container::OnHotkey(), C4ScriptGuiWindow::ProcessMouseInput(), C4Menu::SetPosition(), C4Menu::UpdateElementPositions(), and C4GUI::TextWindow::UpdateSize().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 2138 of file C4Gui.h.

References C4GUI::Dialog::AdvanceFocus().

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4StartupNetDlg::KeyBack ( )
inlineprotected

Definition at line 166 of file C4StartupNetDlg.h.

References DoBack().

Referenced by C4StartupNetDlg().

166 { return DoBack(); }

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4GUI::Dialog::KeyEnter ( )
inlineinherited

Definition at line 2133 of file C4Gui.h.

References C4GUI::Dialog::OnEnter().

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4GUI::Dialog::KeyEscape ( )
inlineinherited

Definition at line 2135 of file C4Gui.h.

References C4GUI::Dialog::OnEscape().

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4StartupNetDlg::KeyForward ( )
inlineprotected

Definition at line 168 of file C4StartupNetDlg.h.

References DoOK().

168 { DoOK(); return true; }

Here is the call graph for this function:

bool C4StartupNetDlg::KeyRefresh ( )
inlineprotected

Definition at line 167 of file C4StartupNetDlg.h.

References DoRefresh().

Referenced by C4StartupNetDlg().

167 { DoRefresh(); return true; }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 106 of file C4GuiContainers.cpp.

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

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

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

Here is the caller graph for this function:

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

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

Definition at line 413 of file C4Gui.h.

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

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

Here is the caller graph for this function:

void C4GUI::Dialog::MouseInput ( CMouse rMouse,
int32_t  iButton,
int32_t  iX,
int32_t  iY,
DWORD  dwKeyParam 
)
virtualinherited

Reimplemented from C4GUI::Window.

Definition at line 558 of file C4GuiDialogs.cpp.

References C4GUI::Window::MouseInput().

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Definition at line 414 of file C4Gui.h.

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

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

Here is the caller graph for this function:

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

Definition at line 172 of file C4StartupNetDlg.h.

References DoBack().

Referenced by C4StartupNetDlg().

172 { DoBack(); }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 815 of file C4StartupNetDlg.cpp.

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

Referenced by C4StartupNetDlg().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 808 of file C4StartupNetDlg.cpp.

References C4GUI::Tabular::SelectSheet().

Referenced by C4StartupNetDlg().

809 {
810  // switch to game list dialog
811  pMainTabular->SelectSheet(SNDM_GameList, true);
812  UpdateDlgMode();
813 }
void SelectSheet(int32_t iIndex, bool fByUser)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 834 of file C4StartupNetDlg.cpp.

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

Referenced by C4StartupNetDlg().

835 {
836  // toggle masterserver game search
838  UpdateMasterserver();
839 }
C4Config Config
Definition: C4Config.cpp:831
C4ConfigNetwork Network
Definition: C4Config.h:256
int32_t MasterServerSignUp
Definition: C4Config.h:148

Here is the caller graph for this function:

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

Definition at line 841 of file C4StartupNetDlg.cpp.

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

Referenced by C4StartupNetDlg().

842 {
843  // toggle league signup flag
844  bool fCheck = !Game.Record;
845  Game.Record = fCheck;
846  Config.General.DefRec = fCheck;
848 }
C4Config Config
Definition: C4Config.cpp:831
C4Game Game
Definition: C4Globals.cpp:52
C4ConfigGeneral General
Definition: C4Config.h:252
int32_t DefRec
Definition: C4Config.h:48
bool Record
Definition: C4Game.h:125
void SetIcon(Icons eUseIcon)

Here is the call graph for this function:

Here is the caller graph for this function:

void C4StartupNetDlg::OnChatTitleChange ( const StdStrBuf sNewTitle)
protected

Definition at line 1272 of file C4StartupNetDlg.cpp.

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

Referenced by C4StartupNetDlg().

1273 {
1274  // update label
1275  if (pChatTitleLabel) pChatTitleLabel->SetText(FormatString("%s - %s", LoadResStr("IDS_DLG_CHAT"), sNewTitle.getData()).getData());
1276 }
const char * getData() const
Definition: StdBuf.h:450
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
void SetText(const char *szToText, bool fAllowHotkey=true)
Definition: C4GuiLabels.cpp:74
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:277

Here is the call graph for this function:

Here is the caller graph for this function:

void C4StartupNetDlg::OnClosed ( bool  fOK)
protectedvirtual

Reimplemented from C4GUI::Dialog.

Definition at line 779 of file C4StartupNetDlg.cpp.

References DoBack().

780 {
781  // dlg abort: return to main screen
782  if (pMasterserverClient) { delete pMasterserverClient; pMasterserverClient=nullptr; }
783  if (!fOK) DoBack();
784 }
bool fOK
Definition: C4Gui.h:2082

Here is the call graph for this function:

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

Definition at line 174 of file C4StartupNetDlg.h.

References CreateGame().

Referenced by C4StartupNetDlg().

174 { CreateGame(); }

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool C4StartupNetDlg::OnEnter ( )
inlineprotectedvirtual

Reimplemented from C4GUI::FullscreenDialog.

Definition at line 164 of file C4StartupNetDlg.h.

References DoOK().

164 { DoOK(); return true; }

Here is the call graph for this function:

virtual bool C4StartupNetDlg::OnEscape ( )
inlineprotectedvirtual

Reimplemented from C4GUI::Dialog.

Definition at line 165 of file C4StartupNetDlg.h.

References DoBack().

165 { DoBack(); return true; }

Here is the call graph for this function:

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

Reimplemented from C4GUI::Element.

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

Definition at line 212 of file C4GuiContainers.cpp.

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

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

Here is the call graph for this function:

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

Reimplemented in C4PortraitSelDlg, and C4DownloadDlg.

Definition at line 2209 of file C4Gui.h.

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

2209 {} // idle proc in DoModal

Here is the caller graph for this function:

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

Definition at line 185 of file C4StartupNetDlg.h.

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:

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

Definition at line 175 of file C4StartupNetDlg.h.

References DoOK().

Referenced by C4StartupNetDlg().

175 { DoOK(); }

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void C4StartupDlg::OnKeyboardLayoutChanged ( )
inlinevirtualinherited

Reimplemented in C4StartupOptionsDlg.

Definition at line 89 of file C4Startup.h.

Referenced by C4Startup::OnKeyboardLayoutChanged().

89 {}

Here is the caller graph for this function:

virtual void C4StartupDlg::OnLeagueOptionChanged ( )
inlinevirtualinherited

Reimplemented in C4StartupScenSelDlg.

Definition at line 90 of file C4Startup.h.

Referenced by C4Startup::OnLeagueOptionChanged().

90 {}

Here is the caller graph for this function:

void C4StartupNetDlg::OnReferenceEntryAdd ( C4StartupNetListEntry pEntry)

Definition at line 1250 of file C4StartupNetDlg.cpp.

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

1251 {
1252  // collapse the new entry if desired
1253  if (fIsCollapsed && pEntry != pGameSelList->GetSelectedItem())
1254  pEntry->UpdateCollapsed(true);
1255 }
void UpdateCollapsed(bool fToCollapseValue)
Element * GetSelectedItem()
Definition: C4Gui.h:1580

Here is the call graph for this function:

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

Definition at line 173 of file C4StartupNetDlg.h.

References DoRefresh().

Referenced by C4StartupNetDlg().

173 { DoRefresh(); }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 187 of file C4StartupNetDlg.h.

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:

void C4StartupNetDlg::OnSec1Timer ( )
virtual

Implements C4ApplicationSec1Timer.

Definition at line 1210 of file C4StartupNetDlg.cpp.

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

Referenced by OnShown().

1211 {
1212  // no updates if dialog is inactive (e.g., because a join password dlg is shown!)
1213  if (!IsActive(true))
1214  return;
1215 
1216  // Execute discovery
1217  if (!iGameDiscoverInterval--)
1218  {
1219  DiscoverClient.StartDiscovery();
1220  iGameDiscoverInterval = C4NetGameDiscoveryInterval;
1221  }
1222  DiscoverClient.Execute(0);
1223 
1224  UpdateList(false);
1225 }
virtual bool Execute(int iMaxTime=TO_INF, pollfd *=0)
Definition: C4NetIO.cpp:2060
const int C4NetGameDiscoveryInterval
bool IsActive(bool fForKeyboard)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 176 of file C4StartupNetDlg.h.

Referenced by C4StartupNetDlg().

176 { UpdateSelection(true); }

Here is the caller graph for this function:

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

Definition at line 177 of file C4StartupNetDlg.h.

References DoOK().

Referenced by C4StartupNetDlg().

177 { DoOK(); }

Here is the call graph for this function:

Here is the caller graph for this function:

void C4StartupNetDlg::OnShown ( )
protectedvirtual

Reimplemented from C4GUI::Dialog.

Definition at line 765 of file C4StartupNetDlg.cpp.

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

766 {
767  // callback when shown: Start searching for games
770  UpdateList();
771  UpdateUpdateButton(); // in case update check was finished before callback registration
772  UpdateMasterserver();
773  OnSec1Timer();
774  tLastRefresh = time(0);
775  // also update chat
776  if (pChatCtrl) pChatCtrl->OnShown();
777 }
virtual void OnShown()
Definition: C4Gui.h:2208
virtual void OnShown()
Definition: C4ChatDlg.cpp:421

Here is the call graph for this function:

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

Definition at line 2204 of file C4Gui.h.

References C4GUI::Dialog::UserClose().

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

ReverseIterator C4GUI::Container::rbegin ( )
inlineinherited

Definition at line 826 of file C4Gui.h.

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

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

Here is the caller graph for this function:

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

Definition at line 134 of file C4GuiContainers.cpp.

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

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

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

Here is the caller graph for this function:

void C4GUI::Dialog::RemoveElement ( Element pChild)
virtualinherited

Reimplemented from C4GUI::Container.

Definition at line 428 of file C4GuiDialogs.cpp.

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

429  {
430  // inherited
431  Window::RemoveElement(pChild);
432  // clear ptr
433  if (pChild == pActiveCtrl) pActiveCtrl = nullptr;
434  }
Control * pActiveCtrl
Definition: C4Gui.h:2080
virtual void RemoveElement(Element *pChild)

Here is the call graph for this function:

ReverseIterator C4GUI::Container::rend ( )
inlineinherited

Definition at line 827 of file C4Gui.h.

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

827 { return ReverseIterator(nullptr); }

Here is the caller graph for this function:

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

Definition at line 219 of file C4Gui.cpp.

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 446 of file C4Gui.h.

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

Referenced by C4GameOptionButtons::C4GameOptionButtons(), C4GoalDisplay::C4GoalDisplay(), C4StartupNetDlg(), 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(), C4Game::OnResolutionChanged(), C4GameLobby::ScenDesc::ScenDesc(), C4StartupScenSelDlg::ScenListItem::ScenListItem(), C4GUI::ScrollWindow::ScrollWindow(), C4GUI::InputDialog::SetCustomEdit(), C4GUI::Tabular::SetGfx(), C4GoalDisplay::SetGoals(), C4StartupNetListEntry::SetReference(), C4StartupNetListEntry::SetRefQuery(), C4GUI::Tabular::Sheet::Sheet(), C4GUI::TextWindow::TextWindow(), C4ScoreboardDlg::Update(), C4Menu::UpdateElementPositions(), C4GUI::ListBox::UpdateElementPositions(), C4GUI::ScrollWindow::UpdateOwnPos(), C4ChatControl::UpdateSize(), C4ChatDlg::UpdateSize(), C4GUI::TextWindow::UpdateSize(), and C4GUI::Dialog::UpdateSize().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 770 of file C4GuiDialogs.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 465 of file C4Gui.h.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 2190 of file C4Gui.h.

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

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

Here is the caller graph for this function:

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

Definition at line 464 of file C4Gui.h.

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

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

Here is the caller graph for this function:

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

Definition at line 564 of file C4GuiDialogs.cpp.

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

Referenced by C4GUI::Dialog::AdvanceFocus(), C4ChatDlg::C4ChatDlg(), C4GameOverDlg::C4GameOverDlg(), C4LeagueSignupDialog::C4LeagueSignupDialog(), 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().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 2193 of file C4Gui.h.

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

2194  {
2195  if (pFrameDeco) pFrameDeco->Deref();
2196  if ((pFrameDeco = pNewDeco)) pNewDeco->Ref();
2197  UpdateOwnPos(); // margin may have changed; might need to reposition stuff
2198  }
FrameDecoration * pFrameDeco
Definition: C4Gui.h:2089
virtual void UpdateOwnPos()

Here is the call graph for this function:

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

Definition at line 860 of file C4Gui.h.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented in C4StartupOptionsDlg.

Definition at line 88 of file C4Startup.h.

Referenced by C4Startup::SwitchDialog().

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

Here is the caller graph for this function:

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

Definition at line 337 of file C4GuiDialogs.cpp.

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, 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(), C4Menu::SetSelection(), C4ScoreboardDlg::Update(), and C4Menu::UpdateElementPositions().

338  {
339  // always keep local copy of title
340  TitleString.Copy(szTitle);
341  // console mode dialogs: Use window bar
343  {
344  if (pWindow) pWindow->SetTitle(szTitle ? szTitle : "");
345  return;
346  }
347  // set new
348  if (szTitle && *szTitle)
349  {
351  if (pTitle)
352  {
353  pTitle->GetBounds() = C4Rect(-GetMarginLeft(), -iTextHgt, rcBounds.Wdt, iTextHgt);
354  // noupdate if title is same - this is necessary to prevent scrolling reset when refilling internal menus
355  if (SEqual(pTitle->GetText(), szTitle)) return;
356  pTitle->SetText(szTitle);
357  }
358  else
359  AddElement(pTitle = new WoodenLabel(szTitle, C4Rect(-GetMarginLeft(), -iTextHgt, rcBounds.Wdt, iTextHgt), C4GUI_CaptionFontClr, &::GraphicsResource.TextFont, ALeft, false));
360  pTitle->SetToolTip(szTitle);
361  pTitle->SetDragTarget(this);
363  if (fShowCloseButton)
364  {
365  pTitle->SetRightIndent(20); // for close button
366  if (!pCloseBtn)
367  {
368  AddElement(pCloseBtn = new CallbackButton<Dialog, IconButton>(Ico_Close, pTitle->GetToprightCornerRect(16,16,4,4,0), '\0', &Dialog::OnUserClose));
369  pCloseBtn->SetToolTip(LoadResStr("IDS_MNU_CLOSE"));
370  }
371  else
372  pCloseBtn->GetBounds() = pTitle->GetToprightCornerRect(16,16,4,4,0);
373  }
374  }
375  else
376  {
377  if (pTitle) { delete pTitle; pTitle=nullptr; }
378  if (pCloseBtn) { delete pCloseBtn; pCloseBtn = nullptr; }
379  }
380  }
#define C4GUI_CaptionFontClr
Definition: C4Gui.h:37
#define C4GUI_TitleAutoScrollTime
Definition: C4Gui.h:146
void SetToolTip(const char *szNewTooltip, bool is_immediate=false)
Definition: C4Gui.cpp:410
void SetTitle(const char *Title)
Definition: C4AppT.cpp:112
Definition: C4Rect.h:29
DialogWindow * pWindow
Definition: C4Gui.h:2088
void AddElement(Element *pChild)
bool IsViewportDialog()
Definition: C4Gui.h:2172
CallbackButton< Dialog, C4GUI::IconButton > * pCloseBtn
Definition: C4Gui.h:2079
C4GraphicsResource GraphicsResource
bool SEqual(const char *szStr1, const char *szStr2)
Definition: Standard.h:97
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
virtual int32_t GetMarginLeft()
Definition: C4Gui.h:2141
int32_t Wdt
Definition: C4Rect.h:32
StdStrBuf TitleString
Definition: C4Gui.h:2086
static int32_t GetDefaultHeight(CStdFont *pUseFont=nullptr)
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:400
C4Rect rcBounds
Definition: C4Gui.h:385
void OnUserClose(C4GUI::Control *btn)
Definition: C4Gui.h:2204
C4Rect & GetBounds()
Definition: C4Gui.h:445
void SetDragTarget(Window *pToWindow)
Definition: C4Gui.h:464
const char * GetText()
Definition: C4Gui.h:503
WoodenLabel * pTitle
Definition: C4Gui.h:2078
void SetAutoScrollTime(uint32_t tDelay)
Definition: C4Gui.h:537
const int ALeft
Definition: C4Surface.h:43
void SetRightIndent(int32_t iNewIndent)
Definition: C4Gui.h:540
void Copy()
Definition: StdBuf.h:475
C4Application Application
Definition: C4Globals.cpp:44
void SetText(const char *szToText, bool fAllowHotkey=true)
Definition: C4GuiLabels.cpp:74

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 807 of file C4GuiDialogs.cpp.

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

808  {
809  if (pFullscreenTitle) { delete pFullscreenTitle; pFullscreenTitle=nullptr; }
810  // change title text; creates or removes title bar if necessary
811  if (szTitle && *szTitle)
812  {
813  // not using dlg label, which is a wooden label
814  if (HasUpperBoard())
816  else
817  // non-woodbar: Title is centered and in big font
819  AddElement(pFullscreenTitle);
820  pFullscreenTitle->SetToolTip(szTitle);
821  }
822  }
#define C4GUI_CaptionFontClr
Definition: C4Gui.h:37
int GetLineHeight() const
Definition: C4FontLoader.h:132
#define C4GUI_FullscreenCaptionFontClr
Definition: C4Gui.h:161
Label * pFullscreenTitle
Definition: C4Gui.h:2223
virtual C4Rect & GetClientRect()
Definition: C4Gui.h:864
void AddElement(Element *pChild)
virtual int32_t GetMarginTop()
Definition: C4Gui.h:2246
const int C4UpperBoardHeight
Definition: C4Constants.h:59
C4GraphicsResource GraphicsResource
virtual bool HasUpperBoard()
Definition: C4Gui.h:2241
const int ACenter
Definition: C4Surface.h:43
const int ALeft
Definition: C4Surface.h:43

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 410 of file C4Gui.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from C4GUI::Element.

Reimplemented in C4StartupNetListEntry.

Definition at line 247 of file C4GuiContainers.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 615 of file C4GuiDialogs.cpp.

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(), C4Network2::OpenSurrenderDialog(), C4Network2::OpenVoteDialog(), C4Network2::RetrieveRes(), C4ChatDlg::ShowChat(), C4Game::ShowGameOverDlg(), C4DownloadDlg::ShowModal(), C4GUI::Screen::ShowModalDlg(), C4GUI::Screen::ShowProgressDlg(), C4GUI::Screen::ShowRemoveDlg(), and C4Startup::SwitchDialog().

616  {
617  // already shown?
618  if (fShow) return false;
619  // default screen
620  if (!pOnScreen) if (!(pOnScreen = Screen::GetScreenS())) return false;
621  // show there
622  pOnScreen->ShowDialog(this, false);
623  fVisible = true;
624  // developer mode: Create window
626  if (!CreateConsoleWindow()) return false;
627  // CB
628  if (fCB) OnShown();
629  return true;
630  }
bool fShow
Definition: C4Gui.h:2081
virtual void OnShown()
Definition: C4Gui.h:2208
static Screen * GetScreenS()
Definition: C4Gui.h:2626
bool IsViewportDialog()
Definition: C4Gui.h:2172
bool CreateConsoleWindow()
bool fVisible
Definition: C4Gui.h:383
C4Application Application
Definition: C4Globals.cpp:44

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 260 of file C4Gui.cpp.

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

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

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

Here is the caller graph for this function:

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

Definition at line 283 of file C4Gui.cpp.

References C4GUI::Element::DoDragging().

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

void C4GUI::FullscreenDialog::UpdateOwnPos ( )
protectedvirtualinherited

Reimplemented from C4GUI::Window.

Definition at line 831 of file C4GuiDialogs.cpp.

References C4GUI::Window::UpdateOwnPos().

832  {
833  // inherited to update client rect
835  }
virtual void UpdateOwnPos()

Here is the call graph for this function:

void C4GUI::Dialog::UpdatePos ( )
protectedvirtualinherited

Reimplemented from C4GUI::Element.

Definition at line 417 of file C4GuiDialogs.cpp.

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

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

418  {
419  // Dialogs with their own windows can only be at 0/0
420  if (pWindow)
421  {
422  rcBounds.x = 0;
423  rcBounds.y = 0;
424  }
426  }
DialogWindow * pWindow
Definition: C4Gui.h:2088
int32_t y
Definition: C4Rect.h:32
C4Rect rcBounds
Definition: C4Gui.h:385
int32_t x
Definition: C4Rect.h:32
virtual void UpdatePos()
Definition: C4Gui.cpp:194

Here is the call graph for this function:

Here is the caller graph for this function:

void C4GUI::Dialog::UpdateSize ( )
protectedvirtualinherited

Reimplemented from C4GUI::Element.

Reimplemented in C4ChatDlg.

Definition at line 399 of file C4GuiDialogs.cpp.

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

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

400  {
401  // update title bar position
402  if (pTitle)
403  {
405  pTitle->SetBounds(C4Rect(-GetMarginLeft(), -iTextHgt, rcBounds.Wdt, iTextHgt));
406  if (pCloseBtn) pCloseBtn->SetBounds(pTitle->GetToprightCornerRect(16,16,4,4,0));
407  }
408  // inherited
410  // update assigned window
411  if (pWindow)
412  {
414  }
415  }
Definition: C4Rect.h:29
DialogWindow * pWindow
Definition: C4Gui.h:2088
virtual void UpdateSize()
Definition: C4Gui.cpp:186
CallbackButton< Dialog, C4GUI::IconButton > * pCloseBtn
Definition: C4Gui.h:2079
C4GraphicsResource GraphicsResource
virtual int32_t GetMarginLeft()
Definition: C4Gui.h:2141
int32_t Wdt
Definition: C4Rect.h:32
void SetSize(unsigned int cx, unsigned int cy)
Definition: C4AppT.cpp:111
static int32_t GetDefaultHeight(CStdFont *pUseFont=nullptr)
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:400
C4Rect rcBounds
Definition: C4Gui.h:385
WoodenLabel * pTitle
Definition: C4Gui.h:2078
void SetBounds(const C4Rect &rcNewBound)
Definition: C4Gui.h:446
int32_t Hgt
Definition: C4Rect.h:32

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Definition at line 2206 of file C4Gui.h.

References C4GUI::Dialog::Close().

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

2206 { Close(fOK); }
void Close(bool fOK)
bool fOK
Definition: C4Gui.h:2082

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Fade C4GUI::Dialog::eFade
protectedinherited
bool C4GUI::Dialog::fDelOnClose
protectedinherited

Definition at line 2085 of file C4Gui.h.

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

bool C4GUI::Element::fDragging
protectedinherited

Definition at line 380 of file C4Gui.h.

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

bool C4GUI::Dialog::fViewportDlg
protectedinherited

Definition at line 2087 of file C4Gui.h.

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

int32_t C4GUI::FullscreenDialog::iDlgMarginX
protectedinherited
int32_t C4GUI::FullscreenDialog::iDlgMarginY
protectedinherited
int32_t C4GUI::Element::iDragX
protectedinherited

Definition at line 379 of file C4Gui.h.

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

int32_t C4GUI::Element::iDragY
protectedinherited

Definition at line 379 of file C4Gui.h.

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

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

Definition at line 2079 of file C4Gui.h.

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

ContextHandler* C4GUI::Element::pContextHandler
protectedinherited
Window* C4GUI::Element::pDragTarget
protectedinherited

Definition at line 378 of file C4Gui.h.

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

FrameDecoration* C4GUI::Dialog::pFrameDeco
protectedinherited
Label* C4GUI::FullscreenDialog::pFullscreenTitle
protectedinherited

Definition at line 2223 of file C4Gui.h.

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

Label * C4GUI::FullscreenDialog::pSubTitle
protectedinherited
WoodenLabel* C4GUI::Dialog::pTitle
protectedinherited
C4Rect C4GUI::Element::rcBounds
protectedinherited

Definition at line 385 of file C4Gui.h.

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

StdStrBuf C4GUI::Dialog::TitleString
protectedinherited

Definition at line 2086 of file C4Gui.h.

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


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