void ReorderFieldsDialog::createControls()
{
    const wxString fields_choices[] = {
        _("List of fields")
    };
    list_box_fields = new wxListBox(getControlsPanel(), ID_list_box_fields,
        wxDefaultPosition, wxDefaultSize, 1, fields_choices, wxLB_SINGLE);
    wxSize bmpSize(16, 16);
    // TODO: ART_GO_UP_FIRST missing
    button_first = new wxBitmapButton(getControlsPanel(), ID_button_first, wxBitmap(reorder_icons::up_xpm));
    button_up = new wxBitmapButton(getControlsPanel(), ID_button_up,
        wxArtProvider::GetBitmap(wxART_GO_UP, wxART_TOOLBAR, bmpSize));
    button_down = new wxBitmapButton(getControlsPanel(), ID_button_down,
        wxArtProvider::GetBitmap(wxART_GO_DOWN, wxART_TOOLBAR, bmpSize));
    // TODO: ART_GO_DOWN_LAST missing
    button_last = new wxBitmapButton(getControlsPanel(), ID_button_last, wxBitmap(reorder_icons::down_xpm));
    button_ok = new wxButton(getControlsPanel(), wxID_OK, _("Reorder"));
    button_cancel = new wxButton(getControlsPanel(), wxID_CANCEL, _("Cancel"));
}
Exemple #2
0
void UserDialog::createControls()
{
    labelUserNameM = new wxStaticText(getControlsPanel(), wxID_ANY,
        "User name:");
    textUserNameM = new wxTextCtrl(getControlsPanel(), ID_textctrl_username);
    labelFirstNameM = new wxStaticText(getControlsPanel(), wxID_ANY,
        "First name:");
    textFirstNameM = new wxTextCtrl(getControlsPanel(), wxID_ANY);
    labelMiddleNameM = new wxStaticText(getControlsPanel(), wxID_ANY,
        "Middle name:");
    textMiddleNameM = new wxTextCtrl(getControlsPanel(), wxID_ANY);
    labelLastNameM = new wxStaticText(getControlsPanel(), wxID_ANY,
        "Last name:");
    textLastNameM = new wxTextCtrl(getControlsPanel(), wxID_ANY);

    labelPasswordM = new wxStaticText(getControlsPanel(), wxID_ANY,
        "Password:"******"Confirm password:"******"Unix user ID:");
    spinctrlUserIdM = new wxSpinCtrl(getControlsPanel(), wxID_ANY, "0",
        wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 30000, 0);
    labelGroupIdM = new wxStaticText(getControlsPanel(), wxID_ANY,
        "Unix group ID:");
    spinctrlGroupIdM = new wxSpinCtrl(getControlsPanel(), wxID_ANY, "0",
        wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 30000, 0);

    buttonOkM = new wxButton(getControlsPanel(), wxID_SAVE,
        (isNewUserM) ? _("Create") : _("Save"));
    buttonCancelM = new wxButton(getControlsPanel(), wxID_CANCEL, _("Cancel"));
}
void FieldPropertiesDialog::createControls()
{
    label_fieldname = new wxStaticText(getControlsPanel(), wxID_ANY,
        _("Field name:"));
    textctrl_fieldname = new wxTextCtrl(getControlsPanel(),
        ID_textctrl_fieldname, wxEmptyString);

    label_domain = new wxStaticText(getControlsPanel(), wxID_ANY,
        _("Domain:"));
    choice_domain = new wxChoice(getControlsPanel(), ID_choice_domain,
        wxDefaultPosition, wxDefaultSize, 0, 0);
    button_edit_domain = new wxButton(getControlsPanel(),
        ID_button_edit_domain, _("Edit domain"));

    label_datatype = new wxStaticText(getControlsPanel(), wxID_ANY,
        _("Datatype:"));
    wxArrayString datatypes_choices;
    datatypes_choices.Alloc(datatypescnt);
    for (size_t n = 0; n < datatypescnt; n++)
        datatypes_choices.Add(datatypes[n].name);
    choice_datatype = new wxChoice(getControlsPanel(), ID_choice_datatype,
        wxDefaultPosition, wxDefaultSize, datatypes_choices);
    label_size = new wxStaticText(getControlsPanel(), wxID_ANY, _("Size:"));
    textctrl_size = new wxTextCtrl(getControlsPanel(), wxID_ANY, wxEmptyString);
    label_scale = new wxStaticText(getControlsPanel(), wxID_ANY, _("Scale:"));
    textctrl_scale = new wxTextCtrl(getControlsPanel(), wxID_ANY, wxEmptyString);

    label_charset = new wxStaticText(getControlsPanel(), wxID_ANY, _("Charset:"));
    const wxString charset_choices[] = {
        "NONE"
    };
    choice_charset = new wxChoice(getControlsPanel(), ID_choice_charset,
        wxDefaultPosition, wxDefaultSize,
        sizeof(charset_choices) / sizeof(wxString), charset_choices);
    label_collate = new wxStaticText(getControlsPanel(), wxID_ANY, _("Collate:"));
    choice_collate = new wxChoice(getControlsPanel(), ID_choice_collate,
        wxDefaultPosition, wxDefaultSize, 0, 0);

    checkbox_notnull = new wxCheckBox(getControlsPanel(), wxID_ANY, _("Not null"));

    static_line_autoinc = new wxStaticLine(getControlsPanel());
    label_autoinc = new wxStaticText(getControlsPanel(), wxID_ANY, _("Autoincrement"));

    radio_generator_new = new wxRadioButton(getControlsPanel(),
        ID_radio_generator_new, _("Create new generator:"));
    textctrl_generator_name = new wxTextCtrl(getControlsPanel(),
        ID_textctrl_generator_name, wxEmptyString);

    radio_generator_existing = new wxRadioButton(getControlsPanel(),
        ID_radio_generator_existing, _("Use existing generator:"));
    choice_generator = new wxChoice(getControlsPanel(), ID_choice_generator,
        wxDefaultPosition, wxDefaultSize, 0, 0);

    checkbox_trigger = new wxCheckBox(getControlsPanel(), ID_checkbox_trigger,
        _("Create trigger"));
    textctrl_sql = new wxTextCtrl(getControlsPanel(), wxID_ANY, wxEmptyString,
        wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY);

    button_ok = new wxButton(getControlsPanel(), wxID_OK, _("Execute"));
    button_cancel = new wxButton(getControlsPanel(), wxID_CANCEL, _("Cancel"));
}
StatementHistoryDialog::StatementHistoryDialog(wxWindow *parent,
    StatementHistory *history, const wxString& title)
    :BaseDialog(parent, -1, title), historyM(history),
     isSearchingM(false)
{
    wxBoxSizer *innerSizer = new wxBoxSizer(wxVERTICAL);
    wxBoxSizer *topSizer = new wxBoxSizer(wxHORIZONTAL);
    m_staticText2 = new wxStaticText(getControlsPanel(), wxID_ANY,
        _("Search for:"), wxDefaultPosition, wxDefaultSize, 0);
    topSizer->Add(m_staticText2, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT,
        styleguide().getControlLabelMargin());

    textctrl_search = new wxTextCtrl(getControlsPanel(), wxID_ANY, "");
    button_search = new wxButton(getControlsPanel(), ID_button_search,
        _("&Search"));
    button_delete = new wxButton(getControlsPanel(), ID_button_delete,
        _("&Delete Selected"), wxDefaultPosition, wxDefaultSize, 0);
    topSizer->Add(textctrl_search, 1, wxRIGHT|wxALIGN_CENTER_VERTICAL,
        styleguide().getRelatedControlMargin(wxHORIZONTAL));
    topSizer->Add(button_search, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL,
        styleguide().getUnrelatedControlMargin(wxHORIZONTAL));
    topSizer->Add(button_delete, 0, wxALIGN_CENTER_VERTICAL, 0);
    innerSizer->Add(topSizer, 0, wxEXPAND, 5);

    int gaugeHeight = wxSystemSettings::GetMetric(wxSYS_HSCROLL_Y);
    gauge_progress = new wxGauge(getControlsPanel(), wxID_ANY, 100,
        wxDefaultPosition, wxSize(100, gaugeHeight),
        wxGA_HORIZONTAL | wxGA_SMOOTH);
    innerSizer->Add(gauge_progress, 0, wxTOP|wxEXPAND,
        styleguide().getRelatedControlMargin(wxVERTICAL));

    mainSplitter = new wxSplitterWindow( getControlsPanel(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );
    leftSplitterPanel = new wxPanel( mainSplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    wxBoxSizer* leftSplitterSizer = new wxBoxSizer( wxVERTICAL );

    leftSplitterPanel->SetSizer( leftSplitterSizer );
    rightSplitterPanel = new wxPanel( mainSplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    wxBoxSizer* rightSplitterSizer = new wxBoxSizer( wxVERTICAL );
    rightSplitterPanel->SetSizer( rightSplitterSizer );

    mainSplitter->SplitVertically( leftSplitterPanel, rightSplitterPanel, 0 );

    listbox_search = new wxListBox(leftSplitterPanel, ID_listbox_search,
        wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_MULTIPLE);
    leftSplitterSizer->Add(listbox_search, 1, wxTOP|wxEXPAND,
        styleguide().getRelatedControlMargin(wxVERTICAL));
    dateTimeTextM = new wxStaticText(leftSplitterPanel, wxID_ANY,
        _("Date and time of selected item"), wxDefaultPosition, wxDefaultSize, 0);
    leftSplitterSizer->Add(dateTimeTextM, 0, wxTOP|wxEXPAND,
        styleguide().getRelatedControlMargin(wxVERTICAL));

    textctrl_statement = new wxStyledTextCtrl(rightSplitterPanel, wxID_ANY,
        wxDefaultPosition, wxDefaultSize, wxBORDER_THEME);
    textctrl_statement->SetWrapMode(wxSTC_WRAP_WORD);
    textctrl_statement->SetMarginWidth(1, 0);  // turn off the folding margin
    textctrl_statement->StyleSetForeground(1, *wxWHITE);
    textctrl_statement->StyleSetBackground(1, *wxRED);
    textctrl_statement->SetText(_("Selected SQL statement"));
    rightSplitterSizer->Add(textctrl_statement, 1, wxTOP|wxEXPAND,
        styleguide().getRelatedControlMargin(wxVERTICAL));

    leftSplitterPanel->Layout();
    leftSplitterSizer->Fit( leftSplitterPanel );
    rightSplitterPanel->Layout();
    rightSplitterSizer->Fit( rightSplitterPanel );
    innerSizer->Add( mainSplitter, 1, wxEXPAND, 0 );

    button_copy = new wxButton(getControlsPanel(), ID_button_copy,
        _("C&opy Selection To Editor"), wxDefaultPosition, wxDefaultSize, 0);
    button_cancel = new wxButton(getControlsPanel(), wxID_CANCEL,
        _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0);

    wxSizer* sizerButtons = styleguide().createButtonSizer(
        button_copy, button_cancel);

    // use method in base class to set everything up
    layoutSizers(innerSizer, sizerButtons, true);

    // TODO: size(32, 32) missing for HISTORY icon
    #include "history.xpm"
    wxBitmap bmp = wxBitmap(history_xpm);
    wxIcon icon;
    icon.CopyFromBitmap(bmp);
    SetIcon(icon);

    button_search->SetDefault();
    button_copy->Enable(false);
    button_delete->Enable(false);
    textctrl_search->SetFocus();
    // center on parent
    SetSize(620, 400);
    Centre();
}
Exemple #5
0
FindDialog::FindDialog(SearchableEditor *editor, wxWindow* parent, const wxString& title, FindFlags *allowedFlags)
    :BaseDialog(parent, -1, title)
{
    parentEditorM = editor;
    FindFlags flags;
    if (allowedFlags)
        flags = *allowedFlags;    // copy settings

    label_find = new wxStaticText(getControlsPanel(), -1, _("Fi&nd:"));
    text_ctrl_find = new wxTextCtrl(getControlsPanel(), -1);
    label_replace = new wxStaticText(getControlsPanel(), -1, _("Re&place with:"));
    text_ctrl_replace = new wxTextCtrl(getControlsPanel(), -1);

    checkbox_wholeword = checkbox_matchcase = checkbox_regexp = checkbox_convertbs = checkbox_wrap = checkbox_fromtop = 0;
    if (flags.has(se::WHOLE_WORD))
        checkbox_wholeword = new wxCheckBox(getControlsPanel(), -1, _("Whole &word only"));
    if (flags.has(se::MATCH_CASE))
        checkbox_matchcase = new wxCheckBox(getControlsPanel(), -1, _("&Match case"));
    if (flags.has(se::REGULAR_EXPRESSION))
        checkbox_regexp    = new wxCheckBox(getControlsPanel(), -1, _("Regular e&xpression"));
    if (flags.has(se::CONVERT_BACKSLASH))
        checkbox_convertbs = new wxCheckBox(getControlsPanel(), -1, _("Convert &backslashes"));
    if (flags.has(se::WRAP))
        checkbox_wrap      = new wxCheckBox(getControlsPanel(), -1, _("Wrap ar&ound"));
    if (flags.has(se::FROM_TOP))
        checkbox_fromtop   = new wxCheckBox(getControlsPanel(), -1, _("Start search from &top"));

    button_find = new wxButton(getControlsPanel(), wxID_FIND, _("&Find"));
    button_replace = new wxButton(getControlsPanel(), wxID_REPLACE,
        _("&Replace"));
    button_replace_all = new wxButton(getControlsPanel(), wxID_REPLACE_ALL,
        _("Replace &all"));
    button_replace_in_selection = new wxButton(getControlsPanel(),
        ID_button_replace_in_selection, _("In &selection"));
    button_close = new wxButton(getControlsPanel(), wxID_CANCEL, _("&Close"));

    do_layout();
    button_find->SetDefault();
    text_ctrl_find->SetFocus();
}
//! implementation details
void DatabaseRegistrationDialog::createControls()
{
    label_name = new wxStaticText(getControlsPanel(), -1, _("Display name:"));
    text_ctrl_name = new wxTextCtrl(getControlsPanel(),
        ID_textcontrol_name, wxEmptyString);
    label_dbpath = new wxStaticText(getControlsPanel(), -1,
        _("Database path:"));
    text_ctrl_dbpath = new FileTextControl(getControlsPanel(),
        ID_textcontrol_dbpath, wxEmptyString);
    button_browse = new wxButton(getControlsPanel(), ID_button_browse,
        "...", wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);

    label_authentication = new wxStaticText(getControlsPanel(), -1,
        _("Authentication:"));
    choice_authentication = new wxChoice(getControlsPanel(),
        ID_choice_authentication, wxDefaultPosition, wxDefaultSize,
        getAuthenticationChoices());

    label_username = new wxStaticText(getControlsPanel(), -1, _("User name:"));
    text_ctrl_username = new wxTextCtrl(getControlsPanel(),
        ID_textcontrol_username, wxEmptyString);
    label_password = new wxStaticText(getControlsPanel(), -1, _("Password:"******"Charset:"));
    long comboStyle =  wxCB_DROPDOWN;
#ifndef __WXMAC__
    // Not supported on OSX/Cocoa presently
    comboStyle |= wxCB_SORT;
#endif
    combobox_charset = new wxComboBox(getControlsPanel(), -1, "NONE",
        wxDefaultPosition, wxDefaultSize, getDatabaseCharsetChoices(), comboStyle);

    label_role = new wxStaticText(getControlsPanel(), -1, _("Role:"));
    text_ctrl_role = new wxTextCtrl(getControlsPanel(), -1, "");

    if (createM)
    {
        label_pagesize = new wxStaticText(getControlsPanel(), -1,
            _("Page size:"));
        choice_pagesize = new wxChoice(getControlsPanel(), -1,
            wxDefaultPosition, wxDefaultSize, getDatabasePagesizeChoices());
        label_dialect = new wxStaticText(getControlsPanel(), -1,
            _("SQL dialect:"));
        choice_dialect = new wxChoice(getControlsPanel(), -1,
            wxDefaultPosition, wxDefaultSize, getDatabaseDialectChoices());
    }

    button_ok = new wxButton(getControlsPanel(), wxID_SAVE,
        (createM ? _("Create") : _("Save")));
    button_cancel = new wxButton(getControlsPanel(), wxID_CANCEL, _("Cancel"));
}