wxwidgets/include/wx/msw/filedlg.h
Vadim Zeitlin 0a1714b709 Start using IFileDialogEvents to get notifications about changes
For now only update the currently selected file type using this
interface, but it will be used for more notifications later.
2022-06-03 01:35:30 +01:00

86 lines
2.9 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/filedlg.h
// Purpose: wxFileDialog class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FILEDLG_H_
#define _WX_FILEDLG_H_
class wxFileDialogMSWData;
//-------------------------------------------------------------------------
// wxFileDialog
//-------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxFileDialog: public wxFileDialogBase
{
public:
wxFileDialog(wxWindow *parent,
const wxString& message = wxASCII_STR(wxFileSelectorPromptStr),
const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = wxEmptyString,
const wxString& wildCard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
long style = wxFD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
const wxString& name = wxASCII_STR(wxFileDialogNameStr));
virtual ~wxFileDialog();
virtual void GetPaths(wxArrayString& paths) const wxOVERRIDE;
virtual void GetFilenames(wxArrayString& files) const wxOVERRIDE;
virtual bool SupportsExtraControl() const wxOVERRIDE { return true; }
virtual int ShowModal() wxOVERRIDE;
protected:
virtual void DoMoveWindow(int x, int y, int width, int height) wxOVERRIDE;
virtual void DoCentre(int dir) wxOVERRIDE;
virtual void DoGetSize( int *width, int *height ) const wxOVERRIDE;
virtual void DoGetPosition( int *x, int *y ) const wxOVERRIDE;
private:
// Allow it to call MSWOnXXX() functions below.
friend class wxFileDialogMSWData;
// called when the dialog is created
void MSWOnInitDialogHook(WXHWND hwnd);
// called from the hook procedure on CDN_INITDONE reception
void MSWOnInitDone(WXHWND hDlg);
// called from the hook procedure on CDN_SELCHANGE.
void MSWOnSelChange(WXHWND hDlg);
// called when the currently selected type of files changes in the dialog
void MSWOnTypeChange(int nFilterIndex);
// The real implementation of ShowModal() using traditional common dialog
// functions.
int ShowCommFileDialog(WXHWND owner);
// And another one using IFileDialog.
int ShowIFileDialog(WXHWND owner);
// Get the data object, allocating it if necessary.
wxFileDialogMSWData& MSWData();
wxArrayString m_fileNames;
// Extra data, possibly null if not needed, use MSWData() to access it if
// it should be created on demand.
wxFileDialogMSWData* m_data;
wxDECLARE_DYNAMIC_CLASS(wxFileDialog);
wxDECLARE_NO_COPY_CLASS(wxFileDialog);
};
#endif // _WX_FILEDLG_H_