~ubuntu-branches/ubuntu/utopic/pgadmin3/utopic-proposed

« back to all changes in this revision

Viewing changes to pgadmin/include/dlg/dlgClasses.h

  • Committer: Bazaar Package Importer
  • Author(s): Gerfried Fuchs
  • Date: 2011-06-07 23:03:54 UTC
  • mfrom: (1.3.1 upstream) (13 sid)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: james.westby@ubuntu.com-20110607230354-3td4j9y71u4ahcvj
Tags: 1.14.0~beta1-1
* New upstream development release, adding Build-Depends on
  postgresql-server-dev-all >= 117~.
* Add Build-Depends on quilt, (un)patch to debian/rules and patch for fixing
  the include for kwlist.h in pgadmin/db/keywords.c.
* Add pg_config --includedir-server output to CPPFLAGS.
* Remove unrecognized configure options: --with-wx-config,
  --with-pgsql-include, --enable-gtk2, --enable-unicode.
* Clean up manually the files that are left behind after the broken
  distclean.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//////////////////////////////////////////////////////////////////////////
2
2
//
3
3
// pgAdmin III - PostgreSQL Tools
4
 
// 
5
 
// Copyright (C) 2002 - 2010, The pgAdmin Development Team
 
4
//
 
5
// Copyright (C) 2002 - 2011, The pgAdmin Development Team
6
6
// This software is released under the PostgreSQL Licence
7
7
//
8
 
// dlgClasses.h - Some dialogue base classes 
 
8
// dlgClasses.h - Some dialogue base classes
9
9
//
10
10
//////////////////////////////////////////////////////////////////////////
11
11
 
29
29
class pgDialog : public wxDialog
30
30
{
31
31
public:
32
 
    pgDialog() { statusBar = 0; }
33
 
    void RestorePosition(int defaultX=-1, int defaultY=-1, int defaultW=-1, int defaultH=-1, int minW=-1, int minH=-1);
34
 
    void SavePosition();
35
 
    void LoadResource(wxWindow *parent, const wxChar *name=0);
 
32
        pgDialog()
 
33
        {
 
34
                statusBar = 0;
 
35
        }
 
36
        void RestorePosition(int defaultX = -1, int defaultY = -1, int defaultW = -1, int defaultH = -1, int minW = -1, int minH = -1);
 
37
        void SavePosition();
 
38
        void LoadResource(wxWindow *parent, const wxChar *name = 0);
36
39
 
37
40
protected:
38
 
    void OnCancel(wxCommandEvent& ev);
39
 
    void OnClose(wxCloseEvent& event);
40
 
    void AddStatusBar();
41
 
 
42
 
    void PostCreation();
43
 
    wxString dlgName;
44
 
    wxStatusBar *statusBar;
45
 
 
46
 
    DECLARE_EVENT_TABLE()
 
41
        void OnCancel(wxCommandEvent &ev);
 
42
        void OnClose(wxCloseEvent &event);
 
43
        void AddStatusBar();
 
44
 
 
45
        void PostCreation();
 
46
        wxString dlgName;
 
47
        wxStatusBar *statusBar;
 
48
 
 
49
        DECLARE_EVENT_TABLE()
47
50
};
48
51
 
49
52
 
52
55
class pgFrame : public wxFrame
53
56
{
54
57
public:
55
 
    pgFrame(wxFrame *parent, const wxString &title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long flags=wxDEFAULT_FRAME_STYLE) ;
56
 
    ~pgFrame();
57
 
    void RemoveFrame(wxWindow *frame);
58
 
    void AddFrame(wxWindow *wnd) { frames.Append(wnd); }
59
 
    void RestorePosition(int defaultX=-1, int defaultY=-1, int defaultW=-1, int defaultH=-1, int minW=100, int minH=70);
60
 
    void SavePosition();
61
 
    void OnAction(wxCommandEvent& event);
62
 
                
63
 
    void UpdateRecentFiles(bool updatefile=true);
64
 
 
65
 
        menuFactoryList *GetMenuFactories() { return menuFactories; }
 
58
        pgFrame(wxFrame *parent, const wxString &title, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long flags = wxDEFAULT_FRAME_STYLE) ;
 
59
        ~pgFrame();
 
60
        void RemoveFrame(wxWindow *frame);
 
61
        void AddFrame(wxWindow *wnd)
 
62
        {
 
63
                frames.Append(wnd);
 
64
        }
 
65
        void RestorePosition(int defaultX = -1, int defaultY = -1, int defaultW = -1, int defaultH = -1, int minW = 100, int minH = 70);
 
66
        void SavePosition();
 
67
        void OnAction(wxCommandEvent &event);
 
68
 
 
69
        void UpdateRecentFiles(bool updatefile = true);
 
70
 
 
71
        menuFactoryList *GetMenuFactories()
 
72
        {
 
73
                return menuFactories;
 
74
        }
66
75
 
67
76
protected:
68
77
 
69
 
    void OnKeyDown(wxKeyEvent& event);
70
 
    void OnExit(wxCommandEvent& event);
71
 
    void OnRecent(wxCommandEvent& event);
72
 
    void OnHelp(wxCommandEvent& event);
73
 
 
74
 
    virtual void OpenLastFile() {}
75
 
    virtual bool CheckChanged(bool canVeto) { return false; }
76
 
    virtual wxString GetHelpPage() const { return wxEmptyString; }
77
 
 
78
 
    windowList frames;
79
 
    menuFactoryList *menuFactories;
80
 
    wxString dlgName;
81
 
    wxString lastFilename, lastDir, lastPath;
82
 
    wxString recentKey;
83
 
    wxMenu *fileMenu, *editMenu, *viewMenu, *recentFileMenu, *helpMenu;
84
 
    wxStatusBar *statusBar;
85
 
    wxMenuBar *menuBar;
86
 
    ctlMenuToolbar *toolBar;
87
 
    bool changed;
88
 
 
89
 
    DECLARE_EVENT_TABLE()
 
78
        void OnKeyDown(wxKeyEvent &event);
 
79
        void OnExit(wxCommandEvent &event);
 
80
        void OnRecent(wxCommandEvent &event);
 
81
        void OnHelp(wxCommandEvent &event);
 
82
 
 
83
        virtual void OpenLastFile() {}
 
84
        virtual bool CheckChanged(bool canVeto)
 
85
        {
 
86
                return false;
 
87
        }
 
88
        virtual wxString GetHelpPage() const
 
89
        {
 
90
                return wxEmptyString;
 
91
        }
 
92
 
 
93
        windowList frames;
 
94
        menuFactoryList *menuFactories;
 
95
        wxString dlgName;
 
96
        wxString lastFilename, lastDir, lastPath;
 
97
        wxString recentKey;
 
98
        wxMenu *fileMenu, *editMenu, *viewMenu, *recentFileMenu, *helpMenu;
 
99
        wxStatusBar *statusBar;
 
100
        wxMenuBar *menuBar;
 
101
        ctlMenuToolbar *toolBar;
 
102
        bool changed;
 
103
 
 
104
        DECLARE_EVENT_TABLE()
90
105
};
91
106
 
92
107
 
93
108
class DialogWithHelp : public pgDialog
94
109
{
95
110
public:
96
 
    DialogWithHelp(frmMain *frame);
 
111
        DialogWithHelp(frmMain *frame);
97
112
 
98
113
protected:
99
 
    frmMain *mainForm;
100
 
    void OnHelp(wxCommandEvent& ev);
 
114
        frmMain *mainForm;
 
115
        void OnHelp(wxCommandEvent &ev);
101
116
 
102
117
private:
103
 
    virtual wxString GetHelpPage() const = 0;
104
 
    DECLARE_EVENT_TABLE()
 
118
        virtual wxString GetHelpPage() const = 0;
 
119
        DECLARE_EVENT_TABLE()
105
120
};
106
121
 
107
122
class ExecutionDialog : public DialogWithHelp
108
123
{
109
124
public:
110
 
    ExecutionDialog(frmMain *frame, pgObject *_object);
111
 
    virtual wxString GetSql()=0;
112
 
 
113
 
    void OnOK(wxCommandEvent& ev);
114
 
    void OnCancel(wxCommandEvent& ev);
115
 
    void OnClose(wxCloseEvent& event);
116
 
 
117
 
    void Abort();
 
125
        ExecutionDialog(frmMain *frame, pgObject *_object);
 
126
        virtual wxString GetSql() = 0;
 
127
 
 
128
        void OnOK(wxCommandEvent &ev);
 
129
        void OnCancel(wxCommandEvent &ev);
 
130
        void OnClose(wxCloseEvent &event);
 
131
 
 
132
        void Abort();
118
133
 
119
134
protected:
120
135
 
121
 
    void EnableOK(const bool enable);
 
136
        void EnableOK(const bool enable);
122
137
 
123
 
    pgConn *conn;
124
 
    pgObject *object;
125
 
    pgQueryThread *thread;
126
 
    wxTextCtrl *txtMessages;
 
138
        pgConn *conn;
 
139
        pgObject *object;
 
140
        pgQueryThread *thread;
 
141
        wxTextCtrl *txtMessages;
127
142
 
128
143
private:
129
 
    DECLARE_EVENT_TABLE()
 
144
        DECLARE_EVENT_TABLE()
130
145
};
131
146
 
132
147
 
138
153
class ExternProcessDialog : public DialogWithHelp
139
154
{
140
155
public:
141
 
    ExternProcessDialog(frmMain *frame);
142
 
    ~ExternProcessDialog();
143
 
    virtual wxString GetDisplayCmd(int version)=0;
144
 
    virtual wxString GetCmd(int step)=0;
145
 
    bool Execute(int step=0, bool finalStep=true);
146
 
    void Abort();
 
156
        ExternProcessDialog(frmMain *frame);
 
157
        ~ExternProcessDialog();
 
158
        virtual wxString GetDisplayCmd(int version) = 0;
 
159
        virtual wxString GetCmd(int step) = 0;
 
160
        bool Execute(int step = 0, bool finalStep = true);
 
161
        void Abort();
147
162
 
148
163
protected:
149
 
    wxTextCtrl *txtMessages;
150
 
    sysProcess *process;
151
 
    bool done, final;
152
 
    wxArrayString environment;
 
164
        wxTextCtrl *txtMessages;
 
165
        sysProcess *process;
 
166
        bool done, final;
 
167
        wxArrayString environment;
153
168
 
154
169
#if __GNUC__ >= 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
155
170
public:
156
171
#endif
157
 
    void OnOK(wxCommandEvent& ev);
158
 
    void OnCancel(wxCommandEvent& ev);
159
 
    void OnClose(wxCloseEvent& event);
 
172
        void OnOK(wxCommandEvent &ev);
 
173
        void OnCancel(wxCommandEvent &ev);
 
174
        void OnClose(wxCloseEvent &event);
160
175
protected:
161
176
 
162
 
    void OnEndProcess(wxProcessEvent& event);
163
 
    void OnPollProcess(wxTimerEvent& event);
164
 
    void checkStreams();
 
177
        void OnEndProcess(wxProcessEvent &event);
 
178
        void OnPollProcess(wxTimerEvent &event);
 
179
        void checkStreams();
165
180
 
166
 
    wxTimer *timer;
167
 
    DECLARE_EVENT_TABLE()
 
181
        wxTimer *timer;
 
182
        DECLARE_EVENT_TABLE()
168
183
};
169
184
 
170
185
#endif