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
// For compilers that support precompilation, includes "wx/wx.h".
25
#include "wx/wxprec.h"
31
// for all others, include the necessary headers (this file is usually all you
32
// need because it includes almost all "standard" wxWindows headers
36
//-----------------------------------------------------------------------------
37
// -*- C++ -*- generated by wxGlade 0.2.2 on Tue Aug 31 13:11:27 2004
40
#include "FieldPropertiesFrame.h"
43
FieldPropertiesFrame::FieldPropertiesFrame(wxWindow* parent, int id, wxString title, YTable *table, const wxPoint& pos, const wxSize& size, long style):
44
BaseFrame(parent, id, title, pos, size, style)
51
// begin wxGlade: FieldPropertiesFrame::FieldPropertiesFrame
52
panel_1 = new wxPanel(this, -1);
53
label_8 = new wxStaticText(panel_1, -1, _("Field"));
54
textctrl_fieldname = new wxTextCtrl(panel_1, ID_textctrl_fieldname, wxT(""));
55
label_1 = new wxStaticText(panel_1, -1, _("Domain"));
56
const wxString cb_domains_choices[] = {
57
wxT(""), // ugly hack. The control doesn't want to show big list for selection if initial list is short
58
wxT(""), // so it looks really ugly on the screen
68
cb_domains = new wxComboBox(panel_1, ID_cb_domains, wxT(""), wxDefaultPosition, wxDefaultSize, 10, cb_domains_choices, wxCB_DROPDOWN | wxCB_READONLY );
69
button_edit_domain = new wxButton(panel_1, ID_button_edit_domain, _("Edit domain"));
70
label_2 = new wxStaticText(panel_1, -1, _("Datatype"));
71
const wxString cb_datatypes_choices[] = {
79
wxT("Double precision"),
87
cb_datatypes = new wxComboBox(panel_1, -1, wxT(""), wxDefaultPosition, wxDefaultSize, 13, cb_datatypes_choices, wxCB_DROPDOWN|wxCB_READONLY );
88
label_3 = new wxStaticText(panel_1, -1, _("Size"));
89
textctrl_size = new wxTextCtrl(panel_1, -1, wxT(""));
90
label_4 = new wxStaticText(panel_1, -1, _("Scale"));
91
textctrl_scale = new wxTextCtrl(panel_1, -1, wxT(""));
92
cb_notnull = new wxCheckBox(panel_1, -1, _("Not null"));
93
label_5 = new wxStaticText(panel_1, -1, _("Charset"));
94
const wxString cb_charset_choices[] = {
122
cb_charset = new wxComboBox(panel_1, ID_cb_charset, wxT(""), wxDefaultPosition, wxDefaultSize, 26, cb_charset_choices, wxCB_DROPDOWN | wxCB_READONLY);
123
label_6 = new wxStaticText(panel_1, -1, _("Collate"));
124
const wxString cb_collate_choices[] = {
125
wxT(""), // ugly hack. The control doesn't want to show big list for selection if initial list is short
126
wxT(""), // so it looks really ugly on the screen
136
cb_collate = new wxComboBox(panel_1, -1, wxT(""), wxDefaultPosition, wxDefaultSize, 10, cb_collate_choices, wxCB_DROPDOWN|wxCB_READONLY );
137
static_line_1 = new wxStaticLine(panel_1, -1);
138
label_7 = new wxStaticText(panel_1, -1, _("Autoincrement"));
139
radio_new = new wxRadioButton(panel_1, ID_radio_new, _("Create new generator, named: "));
140
textctrl_generatorname = new wxTextCtrl(panel_1, ID_textctrl_generatorname, wxT(""));
141
radio_existing = new wxRadioButton(panel_1, ID_radio_existing, _("Use existing generator"));
142
const wxString cb_generators_choices[] = {
143
wxT(""), // ugly hack. The control doesn't want to show big list for selection if initial list is short
144
wxT(""), // so it looks really ugly on the screen
154
cb_generators = new wxComboBox(panel_1, ID_cb_generators, wxT(""), wxDefaultPosition, wxDefaultSize, 10, cb_generators_choices, wxCB_DROPDOWN|wxCB_READONLY );
155
cb_trigger = new wxCheckBox(panel_1, ID_cb_trigger, _("Create trigger"));
156
textctrl_sql = new wxTextCtrl(panel_1, -1, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY);
157
button_ok = new wxButton(panel_1, ID_button_ok, _("OK"));
158
button_cancel = new wxButton(panel_1, ID_button_cancel, _("Cancel"));
164
wxBitmap bmp = getImage32(ntColumn);
166
icon.CopyFromBitmap(bmp);
169
button_cancel->SetFocus();
171
//-----------------------------------------------------------------------------
172
void FieldPropertiesFrame::set_properties()
174
// begin wxGlade: FieldPropertiesFrame::set_properties
175
SetSize(wxSize(397, 386));
176
cb_domains->SetSelection(0);
177
cb_datatypes->SetSelection(0);
178
cb_charset->SetSelection(0);
179
label_7->SetFont(wxFont(9, wxDEFAULT, wxNORMAL, wxBOLD, 0, wxT("")));
180
radio_existing->SetValue(1);
181
cb_generators->SetSelection(0);
182
textctrl_sql->SetSize(wxSize(383, 150));
185
//-----------------------------------------------------------------------------
186
void FieldPropertiesFrame::do_layout()
188
// begin wxGlade: FieldPropertiesFrame::do_layout
189
wxBoxSizer* sizer_1 = new wxBoxSizer(wxVERTICAL);
190
wxBoxSizer* sizer_2 = new wxBoxSizer(wxVERTICAL);
191
wxBoxSizer* sizer_3 = new wxBoxSizer(wxHORIZONTAL);
192
wxBoxSizer* sizer_8 = new wxBoxSizer(wxHORIZONTAL);
193
wxBoxSizer* sizer_9 = new wxBoxSizer(wxHORIZONTAL);
194
wxBoxSizer* sizer_10 = new wxBoxSizer(wxHORIZONTAL);
195
wxBoxSizer* sizer_7 = new wxBoxSizer(wxHORIZONTAL);
196
wxBoxSizer* sizer_6 = new wxBoxSizer(wxHORIZONTAL);
197
wxBoxSizer* sizer_5 = new wxBoxSizer(wxHORIZONTAL);
198
wxBoxSizer* sizer_4 = new wxBoxSizer(wxHORIZONTAL);
199
sizer_4->Add(label_8, 0, wxALL|wxALIGN_CENTER_VERTICAL, 4);
200
sizer_4->Add(textctrl_fieldname, 1, wxALL, 3);
201
sizer_2->Add(sizer_4, 0, wxALL|wxEXPAND, 2);
202
sizer_5->Add(label_1, 0, wxALL, 4);
203
sizer_5->Add(cb_domains, 0, wxALL, 1);
204
sizer_5->Add(button_edit_domain, 0, wxLEFT, 2);
205
sizer_2->Add(sizer_5, 0, wxALL, 2);
206
sizer_6->Add(label_2, 0, wxALL, 4);
207
sizer_6->Add(cb_datatypes, 0, 0, 0);
208
sizer_6->Add(label_3, 0, wxALL, 4);
209
sizer_6->Add(textctrl_size, 0, 0, 0);
210
sizer_6->Add(label_4, 0, wxALL, 4);
211
sizer_6->Add(textctrl_scale, 0, 0, 0);
212
sizer_2->Add(sizer_6, 0, wxALL, 2);
213
sizer_7->Add(cb_notnull, 0, wxALL, 4);
214
sizer_7->Add(35, 10, 0, 0, 0);
215
sizer_7->Add(label_5, 0, wxALL, 4);
216
sizer_7->Add(cb_charset, 0, wxRIGHT, 10);
217
sizer_7->Add(label_6, 0, wxALL, 4);
218
sizer_7->Add(cb_collate, 0, 0, 0);
219
sizer_2->Add(sizer_7, 0, wxALL, 2);
220
sizer_2->Add(static_line_1, 0, wxALL|wxEXPAND, 5);
221
sizer_2->Add(label_7, 0, wxALL, 4);
222
sizer_10->Add(radio_new, 0, wxALL, 3);
223
sizer_10->Add(textctrl_generatorname, 1, 0, 0);
224
sizer_2->Add(sizer_10, 0, wxALL|wxEXPAND, 2);
225
sizer_9->Add(radio_existing, 0, wxALL, 3);
226
sizer_9->Add(cb_generators, 1, 0, 0);
227
sizer_2->Add(sizer_9, 0, wxALL|wxEXPAND, 2);
228
sizer_8->Add(cb_trigger, 0, wxLEFT, 3);
229
sizer_2->Add(sizer_8, 0, wxALL, 2);
230
sizer_2->Add(textctrl_sql, 1, wxALL|wxEXPAND, 3);
231
sizer_3->Add(button_ok, 0, wxALL, 3);
232
sizer_3->Add(button_cancel, 0, wxALL, 3);
233
sizer_2->Add(sizer_3, 0, wxALIGN_CENTER_HORIZONTAL, 0);
234
panel_1->SetAutoLayout(true);
235
panel_1->SetSizer(sizer_2);
236
sizer_2->Fit(panel_1);
237
sizer_2->SetSizeHints(panel_1);
238
sizer_1->Add(panel_1, 1, wxEXPAND, 0);
242
sizer_1->SetSizeHints(this);
246
//-----------------------------------------------------------------------------