41#ifndef INCLUDE_GUARD_URANIA_COMMONDLG_H
42#define INCLUDE_GUARD_URANIA_COMMONDLG_H
72 wchar_t name_[MAX_PATH];
73 wchar_t initDir_[MAX_PATH];
78 FileDialog(
const std::wstring& flt,
const std::wstring& ext);
85 std::wstring
getFileName()
const {
return name_ + ofn_.nFileOffset; }
89 wchar_t tmp[MAX_PATH];
90 std::wcsncpy(tmp, name_, ofn_.nFileOffset);
91 tmp[ofn_.nFileOffset] = L
'\0';
97 if (!ofn_.nFileExtension)
100 return name_ + ofn_.nFileExtension;
107 std::wcsncpy(name_, path.c_str(), MAX_PATH);
108 name_[MAX_PATH - 1] = L
'\0';
113 wcsncpy(initDir_, path.c_str(), MAX_PATH);
114 initDir_[MAX_PATH - 1] = L
'\0';
118 std::unique_ptr<FileDialog>
119 create(
const std::wstring& flt,
const std::wstring& ext =L
"")
120 {
return std::unique_ptr<FileDialog>(
new FileDialog(flt, ext)); }
コモンダイアログ基底クラス
Definition cmndlg.h:54
CommonDialogBase()=default
virtual ~CommonDialogBase()=default
ファイルダイアログ
Definition cmndlg.h:69
bool doModalOpenFile(const urania::WndBase *win)
Definition cmndlg.cpp:65
std::wstring getFileExt() const
Definition cmndlg.h:95
void clearFilePath()
Definition cmndlg.h:103
void setFilePath(const std::wstring &path)
Definition cmndlg.h:105
FileDialog(const std::wstring &flt, const std::wstring &ext)
Definition cmndlg.cpp:46
std::wstring getFileName() const
Definition cmndlg.h:85
static std::unique_ptr< FileDialog > create(const std::wstring &flt, const std::wstring &ext=L"")
Definition cmndlg.h:119
void setInitDir(const std::wstring &path)
Definition cmndlg.h:111
bool doModalSaveFile(const urania::WndBase *win)
Definition cmndlg.cpp:91
std::wstring getFilePath() const
Definition cmndlg.h:84
std::wstring getFileDir() const
Definition cmndlg.h:87
HWND管理用基底クラス
Definition wbase.h:55