18 #ifndef INC_C4FileSelDlg
19 #define INC_C4FileSelDlg
38 typedef void (CB::*
FileSelFunc)(
const char *szFilename, int32_t idToken);
46 {
if (pCBClass && SelFunc) (pCBClass->*SelFunc)(szFilename, idToken); }
72 virtual bool IsGrayed()
const {
return false; }
94 bool IsGrayed()
const override {
return fGrayed; }
116 Location *pLocations;
117 int32_t iLocationCount;
118 int32_t iCurrentLocationIndex;
121 ListItem *pSelection;
124 void UpdateFileList();
133 virtual bool IsItemGrayed(
const char *szFilename)
const {
return false; }
148 void AddLocation(
const char *szName,
const char *szPath);
162 void SetPath(
const char *szNewPath,
bool fRefresh=
true);
163 void SetSelection(
const char *szNewSelection,
bool fFilenameOnly);
188 bool IsItemGrayed(
const char *szFilename)
const override;
217 ListItem(
const char *szFilename);
226 std::list<ListItem *> LoadItems;
229 LoaderThread() =
default;
230 ~LoaderThread()
override {
Stop(); }
232 void ClearLoadItems();
233 void AddLoadItem(ListItem *pItem);
240 LoaderThread ImageLoader;
#define C4CFN_PlayerFiles
const char * GetFileMask() const override
bool IsItemGrayed(const char *szFilename) const override
C4GUI::Icons GetFileItemIcon() const override
C4DefinitionSelDlg(C4FileSel_BaseCB *pSelCallback, const char *szFixedSelection)
static bool SelectDefinitions(C4GUI::Screen *pOnScreen, StdStrBuf *pSelection)
bool IsMultiSelection() const override
C4FileSel_BaseCB()=default
virtual void OnFileSelected(const char *szFilename)=0
virtual ~C4FileSel_BaseCB()=default
C4FileSel_CBEx(CB *pCBClass, FileSelFunc SelFunc, int32_t idToken)
void OnFileSelected(const char *szFilename) override
void(CB::* FileSelFunc)(const char *szFilename, int32_t idToken)
void SetChecked(bool fChecked) override
DefaultListItem(const char *szFilename, bool fTruncateExtension, bool fCheckbox, bool fGrayed, C4GUI::Icons eIcon)
void UpdateOwnPos() override
bool IsGrayed() const override
bool UserToggleCheck() override
bool IsChecked() const override
~DefaultListItem() override
const char * GetFilename()
virtual void SetChecked(bool fChecked)
virtual bool UserToggleCheck()
virtual bool IsGrayed() const
bool IsFocusOnClick() override
virtual bool IsChecked() const
ListItem(const char *szFilename)
void AddCheckedLocation(const char *szName, const char *szPath)
void OnLocationComboFill(C4GUI::ComboBox_FillCB *pFiller)
virtual int32_t GetFileSelColWidth() const
void SetCurrentLocation(int32_t idx, bool fRefresh)
bool OnLocationComboSelChange(C4GUI::ComboBox *pForCombo, int32_t idNewSelection)
void OnSelChange(class C4GUI::Element *pEl)
virtual const char * GetFileMask() const
virtual C4GUI::Icons GetFileItemIcon() const
virtual void BeginFileListUpdate()
virtual bool IsMultiSelection() const
virtual bool IsItemGrayed(const char *szFilename) const
virtual bool HasPreviewArea() const
void SetPath(const char *szNewPath, bool fRefresh=true)
virtual void AddExtraOptions(const C4Rect &rcOptionsRect)
StdStrBuf GetSelection(const char *szFixedSelection, bool fFilenameOnly) const
void AddLocation(const char *szName, const char *szPath)
virtual void EndFileListUpdate()
void UserClose(bool fOK) override
virtual ListItem * CreateListItem(const char *szFilename)
int32_t GetCurrentLocationIndex() const
virtual bool HasNoneItem() const
void SetSelection(const char *szNewSelection, bool fFilenameOnly)
void OnClosed(bool fOK) override
C4FileSelDlg(const char *szRootPath, const char *szTitle, C4FileSel_BaseCB *pSelCallback, bool fInitElements=true)
void OnSelDblClick(class C4GUI::Element *pEl)
virtual void UpdateSelection()
virtual bool HasExtraOptions() const
void DrawElement(C4TargetFacet &cgo) override
C4PlayerSelDlg(C4FileSel_BaseCB *pSelCallback)
const char * GetFileMask() const override
C4GUI::Icons GetFileItemIcon() const override
bool HasNoneItem() const override
C4FileSelDlg::ListItem * CreateListItem(const char *szFilename) override
void EndFileListUpdate() override
int32_t GetFileSelColWidth() const override
bool HasPreviewArea() const override
const char * GetFileMask() const override
void OnClosed(bool fOK) override
static bool SelectPortrait(C4GUI::Screen *pOnScreen, StdStrBuf *pSelection)
void BeginFileListUpdate() override
C4PortraitSelDlg(C4FileSel_BaseCB *pSelCallback)
const char * getData() const