~mapopa/flamerobin/master

« back to all changes in this revision

Viewing changes to src/ReorderFieldsDialog.cpp

  • Committer: Michael Hieke
  • Date: 2004-11-22 11:34:42 UTC
  • Revision ID: git-v1:8153b493d66ee7aae55e7b34e0d7bddacf4999ef
Initial revision

svn path=/trunk/flamerobin/; revision=13

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
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.
 
6
 
 
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
 
10
  the License.
 
11
 
 
12
  The Original Code is FlameRobin (TM).
 
13
 
 
14
  The Initial Developer of the Original Code is Milan Babuskov.
 
15
 
 
16
  Portions created by the original developer
 
17
  are Copyright (C) 2004 Milan Babuskov.
 
18
 
 
19
  All Rights Reserved.
 
20
 
 
21
  Contributor(s):
 
22
*/
 
23
 
 
24
// For compilers that support precompilation, includes "wx/wx.h".
 
25
#include "wx/wxprec.h"
 
26
 
 
27
#ifdef __BORLANDC__
 
28
    #pragma hdrstop
 
29
#endif
 
30
 
 
31
// for all others, include the necessary headers (this file is usually all you
 
32
// need because it includes almost all "standard" wxWindows headers
 
33
#ifndef WX_PRECOMP
 
34
    #include "wx/wx.h"
 
35
#endif
 
36
 
 
37
// -*- C++ -*- generated by wxGlade 0.2.2 on Thu Sep 09 11:22:32 2004
 
38
 
 
39
#include "ugly.h"
 
40
#include "ReorderFieldsDialog.h"
 
41
 
 
42
//! included xpm files, so that icons are compiled into executable
 
43
namespace reorder_icons {
 
44
#include "up.xpm"
 
45
#include "down.xpm"
 
46
};
 
47
 
 
48
ReorderFieldsDialog::ReorderFieldsDialog(wxWindow* parent, YTable *table):
 
49
    wxDialog(parent, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize)
 
50
{
 
51
        tableM = table;
 
52
        tableM->checkAndLoadColumns();
 
53
        tableM->attach(this);
 
54
 
 
55
    // begin wxGlade: ReorderFieldsDialog::ReorderFieldsDialog
 
56
    panel_1 = new wxPanel(this, -1);
 
57
    const wxString list_box_1_choices[] = {
 
58
        _("List of fields")
 
59
    };
 
60
    list_box_1 = new wxListBox(panel_1, -1, wxDefaultPosition, wxDefaultSize, 1, list_box_1_choices, wxLB_SINGLE);
 
61
    button_up = new wxBitmapButton(panel_1, ID_button_up, wxBitmap(reorder_icons::up_xpm));
 
62
    button_down = new wxBitmapButton(panel_1, ID_button_down, wxBitmap(reorder_icons::down_xpm));
 
63
    button_ok = new wxButton(panel_1, ID_button_ok, _("OK"));
 
64
    button_cancel = new wxButton(panel_1, ID_button_cancel, _("Cancel"));
 
65
 
 
66
    set_properties();
 
67
    do_layout();
 
68
    // end wxGlade
 
69
 
 
70
    SetTitle(_("Reordering fields of table ") + std2wx(table->getName()));
 
71
        update();
 
72
}
 
73
 
 
74
 
 
75
void ReorderFieldsDialog::set_properties()
 
76
{
 
77
    // begin wxGlade: ReorderFieldsDialog::set_properties
 
78
    SetSize(wxSize(303, 281));
 
79
    list_box_1->SetSelection(0);
 
80
    button_up->SetSize(wxSize(23, 23));
 
81
    button_down->SetSize(wxSize(23, 23));
 
82
    button_ok->SetDefault();
 
83
    // end wxGlade
 
84
}
 
85
 
 
86
 
 
87
void ReorderFieldsDialog::do_layout()
 
88
{
 
89
    // begin wxGlade: ReorderFieldsDialog::do_layout
 
90
    wxBoxSizer* sizer_1 = new wxBoxSizer(wxHORIZONTAL);
 
91
    wxBoxSizer* sizer_2 = new wxBoxSizer(wxVERTICAL);
 
92
    wxBoxSizer* sizer_3 = new wxBoxSizer(wxHORIZONTAL);
 
93
    wxBoxSizer* sizer_4 = new wxBoxSizer(wxVERTICAL);
 
94
    wxBoxSizer* sizer_5 = new wxBoxSizer(wxHORIZONTAL);
 
95
    sizer_2->Add(list_box_1, 1, wxALL|wxEXPAND, 5);
 
96
    sizer_3->Add(button_up, 0, wxALL, 3);
 
97
    sizer_3->Add(button_down, 0, wxALL, 3);
 
98
    sizer_5->Add(button_ok, 0, wxALL, 3);
 
99
    sizer_5->Add(button_cancel, 0, wxALL, 3);
 
100
    sizer_4->Add(sizer_5, 1, wxALIGN_RIGHT, 0);
 
101
    sizer_3->Add(sizer_4, 1, wxEXPAND, 0);
 
102
    sizer_2->Add(sizer_3, 0, wxALL|wxEXPAND, 2);
 
103
    panel_1->SetAutoLayout(true);
 
104
    panel_1->SetSizer(sizer_2);
 
105
    sizer_2->Fit(panel_1);
 
106
    sizer_2->SetSizeHints(panel_1);
 
107
    sizer_1->Add(panel_1, 1, wxEXPAND, 0);
 
108
    SetAutoLayout(true);
 
109
    SetSizer(sizer_1);
 
110
    Layout();
 
111
    // end wxGlade
 
112
}