OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4GUI::ComboBox_FillCB Class Referenceabstract

#include <C4Gui.h>

Inheritance diagram for C4GUI::ComboBox_FillCB:
[legend]

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

virtual C4GUI::ComboBox_FillCB::~ComboBox_FillCB ( )
virtualdefault

Member Function Documentation

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(), and C4FileSelDlg::OnLocationComboFill().

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:

void C4GUI::ComboBox_FillCB::ClearEntries ( )

Definition at line 56 of file C4GuiComboBox.cpp.

References C4GUI::Container::Clear().

57  {
58  pDrop->Clear();
59  }

Here is the call graph for this function:

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

Definition at line 1930 of file C4Gui.h.

References FillDropDownCB().

1931  { pCombo = pComboBox; pDrop = pDropdownList; FillDropDownCB(); }
virtual void FillDropDownCB()=0

Here is the call graph for this function:

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

Implemented in C4GUI::ComboBox_FillCallback< CB >.

Referenced by FillDropDown().

Here is the caller graph for this function:

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

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:

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:

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: