2
The contents of this file are subject to the Initial Developer's Public
3
License Version 1.0 (the "License"); you may not use this file except in
4
compliance with the License. You may obtain a copy of the License here:
5
http://www.flamerobin.org/license.html.
7
Software distributed under the License is distributed on an "AS IS"
8
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
9
License for the specific language governing rights and limitations under
12
The Original Code is FlameRobin (TM).
14
The Initial Developer of the Original Code is Milan Babuskov.
16
Portions created by the original developer
17
are Copyright (C) 2004 Milan Babuskov.
21
Contributor(s): Nando Dessena
24
// -*- C++ -*- generated by wxGlade 0.2.2 on Fri Jun 04 12:31:56 2004
28
#include <wx/stc/stc.h>
30
#ifndef EXECUTESQLFRAME_H
31
#define EXECUTESQLFRAME_H
33
// begin wxGlade: dependencies
34
#include <wx/splitter.h>
35
#include <wx/notebook.h>
40
#include "metadata/database.h"
42
#include "myDataGrid.h"
43
#include "BaseFrame.h"
45
class ExecuteSqlFrame: public BaseFrame, public YxObserver {
47
void setDatabase(YDatabase *db);
49
// begin wxGlade: ExecuteSqlFrame::ids
54
ID_button_execute = 104,
55
ID_button_commit = 105,
56
ID_button_rollback = 106,
57
ID_button_toggle = 107,
59
ID_my_data_grid = 200,
64
void executeAllStatements(bool autoExecute = false);
65
void setSql(wxString sql);
67
ExecuteSqlFrame(wxWindow* parent, int id, wxString title, const wxPoint& pos=wxDefaultPosition,
68
const wxSize& size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE);
71
std::vector<std::string> executedStatementsM;
73
typedef enum { ttNormal, ttSql, ttError } TextType;
74
void log(wxString s, TextType type = ttNormal); // write messages to textbox
78
bool execute(std::string sql);
80
IBPP::Transaction transactionM;
81
IBPP::Statement statementM;
82
void InTransaction(bool started); // changes controls (enable/disable)
83
void commitTransaction();
85
void setupEditor(); // Setup the Scintilla editor
86
void OnSqlEditUpdateUI(wxStyledTextEvent &event);
88
void OnSqlEditCharAdded(wxStyledTextEvent &event); // autocomplete stuff
89
wxString keywordsM; // text used for autocomplete
93
void OnClose(wxCloseEvent& event);
94
void OnKeyDown(wxKeyEvent &event);
95
void OnButtonNewClick(wxCommandEvent &event);
96
void OnButtonLoadClick(wxCommandEvent &event);
97
void OnButtonSaveClick(wxCommandEvent &event);
98
void OnButtonExecuteClick(wxCommandEvent &event);
99
void OnButtonCommitClick(wxCommandEvent &event);
100
void OnButtonRollbackClick(wxCommandEvent &event);
101
void OnButtonToggleClick(wxCommandEvent &event);
102
void OnButtonWrapClick(wxCommandEvent &event);
104
// begin wxGlade: ExecuteSqlFrame::methods
105
void set_properties();
110
void removeObservedObject(YxSubject *object);
112
bool closeWhenTransactionDoneM;
114
// begin wxGlade: ExecuteSqlFrame::attributes
115
wxStatusBar* execute_sql_frame_statusbar;
116
wxBitmapButton* button_new;
117
wxBitmapButton* button_load;
118
wxBitmapButton* button_save;
120
wxButton* button_execute;
121
wxButton* button_commit;
122
wxButton* button_rollback;
123
wxButton* button_toggle;
124
wxButton* button_wrap;
125
wxStyledTextCtrl* sql_edit;
126
wxPanel* window_1_pane_1;
127
wxStyledTextCtrl* stats_text_ctrl;
128
wxPanel* notebook_pane_1;
129
myDataGrid* data_grid;
130
wxPanel* notebook_1_pane_2;
131
wxNotebook* notebook_1;
132
wxPanel* window_1_pane_2;
133
wxSplitterWindow* window_1;
137
DECLARE_EVENT_TABLE()
138
virtual const std::string getName() const;
139
virtual void doReadConfigSettings(const std::string& prefix);
140
virtual void doWriteConfigSettings(const std::string& prefix) const;
141
virtual const wxRect getDefaultRect() const;
145
#endif // EXECUTESQLFRAME_H