C4GUI::ComboBox_FillCB Class Referenceabstract

#include <C4Gui.h>

Inheritance diagram for C4GUI::ComboBox_FillCB:

Public Member Functions

virtual ~ComboBox_FillCB ()=default
void FillDropDown (ComboBox *pComboBox, ContextMenu *pDropdownList)
virtual void FillDropDownCB ()=0
virtual bool OnComboSelChange (ComboBox *pForCombo, int32_t idNewSelection)=0
void AddEntry (const char *szText, int32_t id)
bool FindEntry (const char *szText)
void ClearEntries ()
void SelectEntry (int32_t iEntry)

Detailed Description

Definition at line 1923 of file C4Gui.h.

Constructor & Destructor Documentation

◆ ~ComboBox_FillCB()

virtual C4GUI::ComboBox_FillCB::~ComboBox_FillCB ( )

Member Function Documentation

◆ AddEntry()

void C4GUI::ComboBox_FillCB::AddEntry ( const char *  szText,
int32_t  id 

Definition at line 34 of file C4GuiComboBox.cpp.

References C4GUI::ContextMenu::AddItem(), FormatString(), C4GUI::Ico_Empty, LoadResStr(), and C4GUI::ComboBox::OnCtxComboSelect().

Referenced by C4TeamList::FillTeamDistOptions(), C4StartupOptionsDlg::OnClosed(), C4FileSelDlg::OnLocationComboFill(), and C4StartupOptionsDlg::SetSubscreen().

35  {
36  if (!szText) szText = "";
38  Handler *pHandler = new Handler(pCombo, &ComboBox::OnCtxComboSelect);
39  pHandler->SetExtra(ComboBox::ComboMenuCBStruct(szText, id));
40  pDrop->AddItem(szText, FormatString(LoadResStr("IDS_MSG_SELECT"), szText).getData(), Ico_Empty, pHandler);
41  }
void AddItem(const char *szText, const char *szToolTip=nullptr, Icons icoIcon=Ico_None, MenuHandler *pMenuHandler=nullptr, ContextHandler *pSubmenuHandler=nullptr)
Definition: C4Gui.h:1873
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
void OnCtxComboSelect(C4GUI::Element *pListItem, const ComboMenuCBStruct &rNewSel)
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:270
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ClearEntries()

void C4GUI::ComboBox_FillCB::ClearEntries ( )

Definition at line 56 of file C4GuiComboBox.cpp.

References C4GUI::Container::Clear().

Referenced by C4StartupOptionsDlg::OnClosed().

57  {
58  pDrop->Clear();
59  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FillDropDown()

void C4GUI::ComboBox_FillCB::FillDropDown ( ComboBox pComboBox,
ContextMenu pDropdownList 

Definition at line 1930 of file C4Gui.h.

Referenced by C4GUI::ComboBox::SetComboCB().

1931  { pCombo = pComboBox; pDrop = pDropdownList; FillDropDownCB(); }
virtual void FillDropDownCB()=0
Here is the caller graph for this function:

◆ FillDropDownCB()

virtual void C4GUI::ComboBox_FillCB::FillDropDownCB ( )
pure virtual

◆ FindEntry()

bool C4GUI::ComboBox_FillCB::FindEntry ( const char *  szText)

Definition at line 43 of file C4GuiComboBox.cpp.

References C4GUI::ContextMenu::GetIndexedEntry(), C4GUI::ContextMenu::Entry::GetText(), and SEqual().

Referenced by C4StartupOptionsDlg::OnClosed().

44  {
45  // check for entry with same name
46  ContextMenu::Entry *pEntry; int32_t idx=0;
47  while ((pEntry = pDrop->GetIndexedEntry(idx++))) if (SEqual(pEntry->GetText(), szText)) return true;
48  return false;
49  }
bool SEqual(const char *szStr1, const char *szStr2)
Definition: Standard.h:93
Entry * GetIndexedEntry(int32_t iIndex)
Definition: C4Gui.h:1879
friend class Entry
Definition: C4Gui.h:1888
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnComboSelChange()

virtual bool C4GUI::ComboBox_FillCB::OnComboSelChange ( ComboBox pForCombo,
int32_t  idNewSelection 
pure virtual

Implemented in C4GUI::ComboBox_FillCallback< CB >.

Referenced by C4GUI::ComboBox::OnCtxComboSelect().

Here is the caller graph for this function:

◆ SelectEntry()

void C4GUI::ComboBox_FillCB::SelectEntry ( int32_t  iEntry)

Definition at line 51 of file C4GuiComboBox.cpp.

References C4GUI::ContextMenu::SelectItem().

52  {
53  pDrop->SelectItem(iEntry);
54  }
void SelectItem(int32_t iIndex)
Definition: C4GuiMenu.cpp:549
Here is the call graph for this function:

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