File: filedlg.h

package info (click to toggle)
wxpython4.0 4.2.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 232,540 kB
  • sloc: cpp: 958,937; python: 233,059; ansic: 150,441; makefile: 51,662; sh: 8,687; perl: 1,563; javascript: 584; php: 326; xml: 200
file content (89 lines) | stat: -rw-r--r-- 3,045 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/////////////////////////////////////////////////////////////////////////////
// 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 when the dialog initialization is fully done
    void MSWOnInitDone(WXHWND hDlg);

    // called when the currently selected file changes in the dialog
    void MSWOnSelChange(const wxString& selectedFilename);

    // called when the currently selected type of files changes in the dialog
    void MSWOnTypeChange(int nFilterIndex);

    // called when the dialog is accepted, i.e. a file is chosen in it
    void MSWOnFileOK();

    // 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_