本文整理汇总了C++中wxGBSpan函数的典型用法代码示例。如果您正苦于以下问题:C++ wxGBSpan函数的具体用法?C++ wxGBSpan怎么用?C++ wxGBSpan使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wxGBSpan函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RunConfigDialog
RunConfigDialog(wxWindow* parent, string title, string name, string params, bool custom = true) : wxDialog(parent, -1, title)
{
// Setup sizer
wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
SetSizer(sizer);
wxGridBagSizer* gb_sizer = new wxGridBagSizer(8, 4);
sizer->Add(gb_sizer, 1, wxEXPAND|wxALL, 10);
// Config name
gb_sizer->Add(new wxStaticText(this, -1, "Config Name:"), wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
text_name = new wxTextCtrl(this, -1, name);
text_name->Enable(custom);
gb_sizer->Add(text_name, wxGBPosition(0, 1), wxDefaultSpan, wxEXPAND);
// Config params
gb_sizer->Add(new wxStaticText(this, -1, "Parameters:"), wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
text_params = new wxTextCtrl(this, -1, params);
gb_sizer->Add(text_params, wxGBPosition(1, 1), wxDefaultSpan, wxEXPAND);
wxStaticText* label_help = new wxStaticText(this, -1, "");
gb_sizer->Add(label_help, wxGBPosition(2, 0), wxGBSpan(1, 2), wxEXPAND);
gb_sizer->Add(CreateStdDialogButtonSizer(wxOK|wxCANCEL), wxGBPosition(3, 0), wxGBSpan(1, 2), wxALIGN_RIGHT);
gb_sizer->AddGrowableCol(1);
gb_sizer->AddGrowableRow(2);
label_help->SetLabel("%i - Base resource archive\n%r - Resource archive(s)\n%a - Current archive\n%mn - Map name\n%mw - Map number (eg. E1M1 = 1 1, MAP02 = 02)");
label_help->Wrap(300);
text_params->SetInsertionPoint(0);
}
示例2: WXUNUSED
void DiffPanel::OnButtonSwap(wxCommandEvent& WXUNUSED(event)) {
m_mainSizer->Detach(m_leftEditor);
m_mainSizer->Detach(m_rightEditor);
EditorCtrl* temp = m_leftEditor;
m_leftEditor = m_rightEditor;
m_rightEditor = temp;
m_mainSizer->Add(m_leftEditor, wxGBPosition(1,1), wxGBSpan(1,1), wxEXPAND);
m_mainSizer->Add(m_rightEditor, wxGBPosition(1,3), wxGBSpan(1,1), wxEXPAND);
m_leftEditor->SetScrollbarLeft(true);
m_rightEditor->SetScrollbarLeft(false);
m_leftEditor->SetGutterRight(false);
m_rightEditor->SetGutterRight(true);
m_leftMarkBar->SetEditor(m_leftEditor);
m_rightMarkBar->SetEditor(m_rightEditor);
m_diffBar->Swap();
Freeze();
m_leftTitle->SetValue(m_leftEditor->GetPath());
m_rightTitle->SetValue(m_rightEditor->GetPath());
m_mainSizer->Layout();
m_leftEditor->ReDraw();
m_rightEditor->ReDraw();
Thaw();
}
示例3: wxDialog
ListSelectDialog::ListSelectDialog(wxWindow *parent, const wxString& title)
: wxDialog(parent, wxID_ANY, title, wxDefaultPosition, wxSize(400, 420))
{
wxBoxSizer *dlgSizer = new wxBoxSizer(wxVERTICAL);
SetSizer(dlgSizer);
wxPanel *mainPanel = new wxPanel(this);
dlgSizer->Add(mainPanel, wxSizerFlags(1).Expand().Border(wxALL, 8));
wxGridBagSizer *mainSz = new wxGridBagSizer();
mainSz->AddGrowableCol(0, 0);
mainSz->AddGrowableRow(0, 0);
mainPanel->SetSizer(mainSz);
list = new wxListBox(mainPanel, -1, wxDefaultPosition, wxDefaultSize,
wxArrayString(), wxLB_SINGLE);
mainSz->Add(list, wxGBPosition(0, 0), wxGBSpan(1, 2), wxEXPAND | wxALL, 4);
wxButton *refreshButton = new wxButton(mainPanel, ID_RefreshList, _("&Refresh"));
mainSz->Add(refreshButton, wxGBPosition(1, 1), wxGBSpan(1, 1), wxALL, 3);
wxSizer *btnSz = CreateButtonSizer(wxOK | wxCANCEL);
dlgSizer->Add(btnSz, wxSizerFlags(0).Border(wxBOTTOM | wxRIGHT, 8).
Align(wxALIGN_RIGHT | wxALIGN_BOTTOM));
SetControlEnable(this, wxID_OK, false);
}
示例4: wxPanel
/* MapDisplayPrefsPanel::setupThingsTab
* Sets up the things tab
*******************************************************************/
void MapDisplayPrefsPanel::setupThingsTab()
{
// Add tab
wxPanel* panel = new wxPanel(nb_pages, -1);
nb_pages->AddPage(panel, "Things");
wxBoxSizer* sz_border = new wxBoxSizer(wxVERTICAL);
panel->SetSizer(sz_border);
wxGridBagSizer* gb_sizer = new wxGridBagSizer(4, 4);
sz_border->Add(gb_sizer, 1, wxEXPAND|wxALL, 8);
int row = 0;
// Thing style
gb_sizer->Add(new wxStaticText(panel, -1, "Thing style: "), wxGBPosition(row, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
string t_types[] = { "Square", "Round", "Sprite", "Square + Sprite", "Framed Sprite" };
choice_thing_drawtype = new wxChoice(panel, -1, wxDefaultPosition, wxDefaultSize, 5, t_types);
gb_sizer->Add(choice_thing_drawtype, wxGBPosition(row++, 1), wxDefaultSpan, wxEXPAND);
// When not in things mode
gb_sizer->Add(new wxStaticText(panel, -1, "When not in things mode: "), wxGBPosition(row, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
string nonmodeshow[] = { "Hide", "Show", "Fade" };
choice_things_always = new wxChoice(panel, -1, wxDefaultPosition, wxDefaultSize, 3, nonmodeshow);
gb_sizer->Add(choice_things_always, wxGBPosition(row++, 1), wxDefaultSpan, wxEXPAND);
// Shadow opacity
gb_sizer->Add(new wxStaticText(panel, -1, "Thing shadow opacity: "), wxGBPosition(row, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
slider_thing_shadow = new wxSlider(panel, -1, thing_shadow*10, 0, 10, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS);
gb_sizer->Add(slider_thing_shadow, wxGBPosition(row++, 1), wxDefaultSpan, wxEXPAND);
// Arrow opacity
gb_sizer->Add(new wxStaticText(panel, -1, "Thing angle arrow opacity: "), wxGBPosition(row, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
slider_thing_arrow_alpha = new wxSlider(panel, -1, thing_shadow*10, 0, 10, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS);
gb_sizer->Add(slider_thing_arrow_alpha, wxGBPosition(row++, 1), wxDefaultSpan, wxEXPAND);
// Halo width
gb_sizer->Add(new wxStaticText(panel, -1, "Halo extra width: "), wxGBPosition(row, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
slider_halo_width = new wxSlider(panel, -1, halo_width, 0, 10, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS);
gb_sizer->Add(slider_halo_width, wxGBPosition(row++, 1), wxDefaultSpan, wxEXPAND);
// Always show angles
cb_thing_force_dir = new wxCheckBox(panel, -1, "Always show thing angles");
gb_sizer->Add(cb_thing_force_dir, wxGBPosition(row++, 0), wxGBSpan(1, 2), wxEXPAND);
// Colour angle arrows
cb_thing_arrow_colour = new wxCheckBox(panel, -1, "Colour thing angle arrows");
gb_sizer->Add(cb_thing_arrow_colour, wxGBPosition(row++, 0), wxGBSpan(1, 2), wxEXPAND);
// Force square hilight/selection
cb_thing_overlay_square = new wxCheckBox(panel, -1, "Force square thing hilight/selection overlay");
gb_sizer->Add(cb_thing_overlay_square, wxGBPosition(row++, 0), wxGBSpan(1, 2), wxEXPAND);
// Use zeth icons
cb_use_zeth_icons = new wxCheckBox(panel, -1, "Use ZETH thing type icons");
gb_sizer->Add(cb_use_zeth_icons, wxGBPosition(row++, 0), wxGBSpan(1, 2), wxEXPAND);
gb_sizer->AddGrowableCol(1, 1);
}
示例5: wxStaticText
// adds a property row to the dialog
void CDlgItemProperties::addProperty(const wxString& name, const wxString& value) {
wxStaticText* staticText = new wxStaticText( m_scrolledWindow, wxID_ANY, name, wxDefaultPosition, wxDefaultSize, 0 );
staticText->Wrap( -1 );
m_gbSizer->Add( staticText, wxGBPosition( m_current_row, 0 ), wxGBSpan( 1, 1 ), wxALL, 3 );
staticText = new wxStaticText( m_scrolledWindow, wxID_ANY, value, wxDefaultPosition, wxDefaultSize, 0 );
staticText->Wrap( -1 );
m_gbSizer->Add( staticText, wxGBPosition( m_current_row, 1 ), wxGBSpan( 1, 1 ), wxALL|wxEXPAND, 3 );
m_current_row++;
}
示例6: wxDialog
CARCodeAddEdit::CARCodeAddEdit(int _selection, std::vector<ActionReplay::ARCode>* _arCodes, wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style)
: wxDialog(parent, id, title, position, size, style)
, arCodes(_arCodes)
, selection(_selection)
{
Bind(wxEVT_BUTTON, &CARCodeAddEdit::SaveCheatData, this, wxID_OK);
ActionReplay::ARCode tempEntries;
wxString currentName;
if (selection == wxNOT_FOUND)
{
tempEntries.name = "";
}
else
{
currentName = StrToWxStr(arCodes->at(selection).name);
tempEntries = arCodes->at(selection);
}
wxBoxSizer* sEditCheat = new wxBoxSizer(wxVERTICAL);
wxStaticBoxSizer* sbEntry = new wxStaticBoxSizer(wxVERTICAL, this, _("Cheat Code"));
wxGridBagSizer* sgEntry = new wxGridBagSizer(0, 0);
wxStaticText* EditCheatNameText = new wxStaticText(this, wxID_ANY, _("Name:"));
wxStaticText* EditCheatCodeText = new wxStaticText(this, wxID_ANY, _("Code:"));
EditCheatName = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
EditCheatName->SetValue(currentName);
EntrySelection = new wxSpinButton(this);
EntrySelection->SetRange(1, std::max((int)arCodes->size(), 1));
EntrySelection->SetValue((int)(arCodes->size() - selection));
EntrySelection->Bind(wxEVT_SPIN, &CARCodeAddEdit::ChangeEntry, this);
EditCheatCode = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(300, 100), wxTE_MULTILINE);
UpdateTextCtrl(tempEntries);
sgEntry->Add(EditCheatNameText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER | wxALL, 5);
sgEntry->Add(EditCheatCodeText, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALIGN_CENTER | wxALL, 5);
sgEntry->Add(EditCheatName, wxGBPosition(0, 1), wxGBSpan(1, 1), wxEXPAND | wxALL, 5);
sgEntry->Add(EntrySelection, wxGBPosition(0, 2), wxGBSpan(2, 1), wxEXPAND | wxALL, 5);
sgEntry->Add(EditCheatCode, wxGBPosition(1, 1), wxGBSpan(1, 1), wxEXPAND | wxALL, 5);
sgEntry->AddGrowableCol(1);
sgEntry->AddGrowableRow(1);
sbEntry->Add(sgEntry, 1, wxEXPAND | wxALL);
sEditCheat->Add(sbEntry, 1, wxEXPAND | wxALL, 5);
sEditCheat->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxEXPAND | wxALL, 5);
SetSizerAndFit(sEditCheat);
SetFocus();
}
示例7: wxDialog
Connect::Connect( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizer5;
bSizer5 = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizer2;
sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Host") ), wxVERTICAL );
wxGridBagSizer* gbSizer1;
gbSizer1 = new wxGridBagSizer( 0, 0 );
gbSizer1->SetFlexibleDirection( wxBOTH );
gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticText3 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Host:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3->Wrap( -1 );
gbSizer1->Add( m_staticText3, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_server = new wxComboBox( sbSizer2->GetStaticBox(), wxID_ANY, _("localhost"), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_SORT );
gbSizer1->Add( m_server, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALL|wxEXPAND, 5 );
m_staticText4 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Port:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText4->Wrap( -1 );
gbSizer1->Add( m_staticText4, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_port = new wxComboBox( sbSizer2->GetStaticBox(), wxID_ANY, _("4000"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_port->Append( _("4000") );
m_port->Append( _("23") );
gbSizer1->Add( m_port, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALL|wxEXPAND, 5 );
gbSizer1->AddGrowableCol( 1 );
sbSizer2->Add( gbSizer1, 1, wxALL, 5 );
bSizer5->Add( sbSizer2, 0, wxALL|wxEXPAND, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );
m_sdbSizer1->AddButton( m_sdbSizer1OK );
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize();
bSizer5->Add( m_sdbSizer1, 0, wxALL|wxEXPAND|wxTOP, 5 );
this->SetSizer( bSizer5 );
this->Layout();
}
示例8: wxPopupTransientWindow
// {{{ PropertyTipWindow::PropertyTipWindow(wxWindow *parent, const DBGp::Property *prop)
PropertyTipWindow::PropertyTipWindow(wxWindow *parent, const DBGp::Property *prop) : wxPopupTransientWindow(parent) {
wxGridBagSizer *sizer = new wxGridBagSizer(0, 3);
SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOTEXT));
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOBK));
wxStaticText *name = new wxStaticText(this, -1, prop->GetFullName() + wxT(" (") + prop->GetType().GetName() + wxT(") :"));
wxFont font(name->GetFont());
font.SetWeight(wxFONTWEIGHT_BOLD);
name->SetFont(font);
sizer->Add(name, wxGBPosition(0, 0), wxGBSpan(1, 3));
if (prop->HasChildren()) {
/* We'll do a shallow dump, since detailed information is
* available through the properties panel and context menu. */
const DBGp::Property::PropertyMap children = prop->GetChildren();
int numShown = 0;
sizer->Add(20, 10, wxGBPosition(1, 0));
for (DBGp::Property::PropertyMap::const_iterator i = children.begin(); i != children.end(); i++) {
DBGp::Property *child = i->second;
sizer->Add(new wxStaticText(this, -1, child->GetName() + wxT(" (") + child->GetType().GetName() << wxT(")")), wxGBPosition(++numShown, 1));
if (child->HasChildren()) {
sizer->Add(new wxStaticText(this, -1, wxString(wxT(": ")) + _("<complex data structure>")), wxGBPosition(numShown, 2));
}
else {
sizer->Add(new wxStaticText(this, -1, wxString(wxT(": ")) + TruncateValue(child->GetData())), wxGBPosition(numShown, 2));
}
// We'll truncate at an arbitrarily chosen 20 elements.
if (numShown >= MAXIMUM_CHILD_ELEMENTS) {
wxString rem;
rem.Printf(_("<remaining %d element(s) omitted>"), children.size() - MAXIMUM_CHILD_ELEMENTS);
sizer->Add(new wxStaticText(this, -1, rem), wxGBPosition(++numShown, 0), wxGBSpan(1, 3));
break;
}
}
}
else {
sizer->Add(new wxStaticText(this, -1, TruncateValue(prop->GetData())), wxGBPosition(0, 3));
}
SetAutoLayout(true);
SetSizer(sizer);
sizer->SetSizeHints(this);
}
示例9: wxPanel
/* TextureEditorPanel::createTextureControls
* Creates/sets up a panel with controls to edit texture properties
*******************************************************************/
wxPanel* TextureEditorPanel::createTextureControls(wxWindow* parent)
{
wxPanel* panel = new wxPanel(parent, -1);
// Setup tex controls panel sizer
wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
panel->SetSizer(sizer);
// "Texture Properties" frame
wxStaticBox* frame = new wxStaticBox(panel, -1, "Texture Properties");
wxStaticBoxSizer* framesizer = new wxStaticBoxSizer(frame, wxVERTICAL);
sizer->Add(framesizer, 0, wxEXPAND|wxALL, 4);
wxGridBagSizer* gb_sizer = new wxGridBagSizer(4, 4);
framesizer->Add(gb_sizer, 1, wxEXPAND|wxALL, 4);
// Name
text_tex_name = new wxTextCtrl(panel, -1);
text_tex_name->SetMaxLength(8);
gb_sizer->Add(new wxStaticText(panel, -1, "Name:"), wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
gb_sizer->Add(text_tex_name, wxGBPosition(0, 1), wxGBSpan(1, 2), wxEXPAND);
// Size
spin_tex_width = new wxSpinCtrl(panel, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxALIGN_RIGHT|wxTE_PROCESS_ENTER, 0, SHRT_MAX);
spin_tex_height = new wxSpinCtrl(panel, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxALIGN_RIGHT|wxTE_PROCESS_ENTER, 0, SHRT_MAX);
gb_sizer->Add(new wxStaticText(panel, -1, "Size:"), wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
gb_sizer->Add(spin_tex_width, wxGBPosition(1, 1), wxDefaultSpan);
gb_sizer->Add(spin_tex_height, wxGBPosition(1, 2), wxDefaultSpan);
// Scale
spin_tex_scalex = new wxSpinCtrl(panel, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxALIGN_RIGHT|wxTE_PROCESS_ENTER, 0, UCHAR_MAX);
spin_tex_scaley = new wxSpinCtrl(panel, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxALIGN_RIGHT|wxTE_PROCESS_ENTER, 0, UCHAR_MAX);
gb_sizer->Add(new wxStaticText(panel, -1, "Scale:"), wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
gb_sizer->Add(spin_tex_scalex, wxGBPosition(2, 1), wxDefaultSpan);
gb_sizer->Add(spin_tex_scaley, wxGBPosition(2, 2), wxDefaultSpan);
// Scaled size
label_scaled_size = new wxStaticText(panel, -1, "Scaled Size: N/A");
gb_sizer->Add(label_scaled_size, wxGBPosition(3, 0), wxGBSpan(1, 2), wxALIGN_CENTER_VERTICAL);
// World panning
cb_tex_world_panning = new wxCheckBox(panel, -1, "World Panning");
gb_sizer->Add(cb_tex_world_panning, wxGBPosition(3, 2), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
// Bind events
spin_tex_scalex->Bind(wxEVT_SPINCTRL, &TextureEditorPanel::onTexScaleXChanged, this);
spin_tex_scaley->Bind(wxEVT_SPINCTRL, &TextureEditorPanel::onTexScaleYChanged, this);
cb_tex_world_panning->Bind(wxEVT_CHECKBOX, &TextureEditorPanel::onTexWorldPanningChanged, this);
return panel;
}
示例10: wxDialog
RunCmdDlg::RunCmdDlg(wxWindow *parent)
: wxDialog (parent, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER) {
SetTitle (_("Filter Through Command"));
wxGridBagSizer* gridBagSizer = new wxGridBagSizer(5,5);
wxStaticText* cmdLabel = new wxStaticText(this, wxID_ANY, _("Command:"));
gridBagSizer->Add(cmdLabel, wxGBPosition(0,0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
m_cmdCtrl = new wxTextCtrl(this, wxID_ANY);
gridBagSizer->Add(m_cmdCtrl, wxGBPosition(0,1), wxGBSpan(1,2), wxGROW);
wxArrayString inputOptions;
inputOptions.Add(_("None"));
inputOptions.Add(_("Selection"));
inputOptions.Add(_("Document"));
m_inputBox = new wxRadioBox(this, wxID_ANY, _("Input"), wxDefaultPosition, wxDefaultSize, inputOptions, 1);
m_inputBox->SetSelection(1);
gridBagSizer->Add(m_inputBox, wxGBPosition(1,1));
wxArrayString outputOptions;
outputOptions.Add(_("Discard"));
outputOptions.Add(_("Replace Selection"));
outputOptions.Add(_("Replace Document"));
outputOptions.Add(_("Insert as Text"));
outputOptions.Add(_("Insert as Snippet"));
outputOptions.Add(_("Show as HTML"));
outputOptions.Add(_("Show as Tooltip"));
outputOptions.Add(_("Create New Document"));
m_outputBox = new wxRadioBox(this, wxID_ANY, _("Output"), wxDefaultPosition, wxDefaultSize, outputOptions, 1);
m_outputBox->SetSelection(1);
gridBagSizer->Add(m_outputBox, wxGBPosition(1,2), wxDefaultSpan, wxGROW);
wxButton* cancelButton = new wxButton(this, wxID_CANCEL);
wxButton* executeButton = new wxButton(this, wxID_OK, _("Execute"));
executeButton->SetDefault();
wxStdDialogButtonSizer* buttonSizer = new wxStdDialogButtonSizer;
buttonSizer->AddButton(cancelButton);
buttonSizer->AddButton(executeButton);
buttonSizer->Realize();
gridBagSizer->Add(buttonSizer, wxGBPosition(2,1), wxGBSpan(1,2), wxALIGN_BOTTOM);
gridBagSizer->AddGrowableCol(2);
gridBagSizer->AddGrowableRow(2);
SetSizer(gridBagSizer);
gridBagSizer->SetSizeHints(this);
Centre();
}
示例11: wxGridBagSizer
void DatabaseRegistrationDialog::layoutControls()
{
// create sizer for controls
wxGridBagSizer* sizerControls = new wxGridBagSizer(styleguide().getRelatedControlMargin(wxVERTICAL),
styleguide().getControlLabelMargin());
sizerControls->Add(label_name, wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
sizerControls->Add(text_ctrl_name, wxGBPosition(0, 1), wxGBSpan(1, 3), wxALIGN_CENTER_VERTICAL | wxEXPAND);
sizerControls->Add(label_dbpath, wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
wxBoxSizer* sizer_r1c1_3 = new wxBoxSizer(wxHORIZONTAL);
sizer_r1c1_3->Add(text_ctrl_dbpath, 1, wxALIGN_CENTER_VERTICAL);
sizer_r1c1_3->Add(button_browse, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, styleguide().getBrowseButtonMargin());
sizerControls->Add(sizer_r1c1_3, wxGBPosition(1, 1), wxGBSpan(1, 3), wxEXPAND);
sizerControls->Add(label_authentication, wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
sizerControls->Add(choice_authentication, wxGBPosition(2, 1), wxGBSpan(1, 3), wxALIGN_CENTER_VERTICAL | wxEXPAND);
int dx = styleguide().getUnrelatedControlMargin(wxHORIZONTAL) - styleguide().getControlLabelMargin();
if (dx < 0)
dx = 0;
sizerControls->Add(label_username, wxGBPosition(3, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
sizerControls->Add(text_ctrl_username, wxGBPosition(3, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxEXPAND);
sizerControls->Add(label_password, wxGBPosition(3, 2), wxDefaultSpan, wxLEFT | wxALIGN_CENTER_VERTICAL, dx);
sizerControls->Add(text_ctrl_password, wxGBPosition(3, 3), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxEXPAND);
sizerControls->Add(label_charset, wxGBPosition(4, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
sizerControls->Add(combobox_charset, wxGBPosition(4, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxEXPAND);
sizerControls->Add(label_role, wxGBPosition(4, 2), wxDefaultSpan, wxLEFT | wxALIGN_CENTER_VERTICAL, dx);
sizerControls->Add(text_ctrl_role, wxGBPosition(4, 3), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxEXPAND);
if (createM)
{
sizerControls->Add(label_pagesize, wxGBPosition(5, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
sizerControls->Add(choice_pagesize, wxGBPosition(5, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxEXPAND);
sizerControls->Add(label_dialect, wxGBPosition(5, 2), wxDefaultSpan, wxLEFT | wxALIGN_CENTER_VERTICAL, dx);
sizerControls->Add(choice_dialect, wxGBPosition(5, 3), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxEXPAND);
}
sizerControls->AddGrowableCol(1);
sizerControls->AddGrowableCol(3);
// create sizer for buttons -> styleguide class will align it correctly
wxSizer* sizerButtons = styleguide().createButtonSizer(button_ok, button_cancel);
// use method in base class to set everything up
layoutSizers(sizerControls, sizerButtons);
}
示例12: GetSize
wxGBSpan wxSizerXmlHandler::GetGBSpan(const wxString& param)
{
wxSize sz = GetSize(param);
if (sz.x < 1) sz.x = 1;
if (sz.y < 1) sz.y = 1;
return wxGBSpan(sz.x, sz.y);
}
示例13: ResizePanel
ResizePanel(wxPanel *parent, PicProcessor *proc, wxString params): PicProcPanel(parent, proc, params)
{
wxSizerFlags flags = wxSizerFlags().Left().Border(wxLEFT|wxRIGHT|wxTOP|wxBOTTOM).Expand();
wxArrayString algos;
algos.Add("box");
algos.Add("bilinear");
algos.Add("bspline");
algos.Add("bicubic");
algos.Add("catmullrom");
algos.Add("lanczos3");
wxArrayString p = split(params,",");
g->Add(new wxStaticText(this,wxID_ANY, "width: "), wxGBPosition(0,0), wxDefaultSpan, wxALIGN_LEFT | wxALL, 3);
widthedit = new wxSpinCtrl(this, wxID_ANY, p[0], wxDefaultPosition, wxSize(100,25),wxTE_PROCESS_ENTER | wxSP_ARROW_KEYS,0,10000);
widthedit->SetToolTip("width in pixels, 0 preserves aspect.\nIf you use the spin arrows, type Enter to update the image.");
g->Add(widthedit, wxGBPosition(0,1), wxDefaultSpan, wxALIGN_LEFT | wxALL, 3);
g->Add(new wxStaticText(this,-1, "height: "), wxGBPosition(1,0), wxDefaultSpan, wxALIGN_LEFT | wxALL, 3);
heightedit = new wxSpinCtrl(this, wxID_ANY, p[1], wxDefaultPosition, wxSize(100,25),wxTE_PROCESS_ENTER | wxSP_ARROW_KEYS,0,10000);
heightedit->SetToolTip("height in pixels, 0 preserves aspect. \nIf you use the spin arrows, type Enter to update the image.");
g->Add(heightedit, wxGBPosition(1,1), wxDefaultSpan, wxALIGN_LEFT | wxALL, 3);
algoselect = new wxRadioBox (this, wxID_ANY, "Resize Algorithm", wxDefaultPosition, wxDefaultSize, algos, 1, wxRA_SPECIFY_COLS);
if (p.size() >=3) {
for (int i=0; i<algos.size(); i++) {
if (p[2] == algos[i]) algoselect->SetSelection(i);
}
}
g->Add(algoselect, wxGBPosition(2,0), wxGBSpan(1,2), wxALIGN_LEFT | wxALL, 3);
SetSizerAndFit(g);
g->Layout();
Refresh();
Update();
SetFocus();
Bind(wxEVT_TEXT_ENTER,&ResizePanel::paramChanged, this);
//Bind(wxEVT_SPINCTRL,&ResizePanel::paramChanged, this);
Bind(wxEVT_RADIOBOX,&ResizePanel::paramChanged, this);
}
示例14: GetPairInts
wxGBSpan wxSizerXmlHandler::GetGBSpan()
{
wxSize sz = GetPairInts(wxS("cellspan"));
if (sz.x < 1) sz.x = 1;
if (sz.y < 1) sz.y = 1;
return wxGBSpan(sz.x, sz.y);
}
示例15: FromDIP
wxStaticBoxSizer* InfoPanel::CreateISODetailsSizer()
{
std::vector<std::pair<wxString, wxTextCtrl*&>> controls = {{
{_("Internal Name:"), m_internal_name},
{_("Game ID:"), m_game_id},
{_("Country:"), m_country},
{_("Maker ID:"), m_maker_id},
{_("Revision:"), m_revision},
{_("Apploader Date:"), m_date},
}};
if (m_opened_iso->GetTMD(m_opened_iso->GetGamePartition()).IsValid())
controls.emplace_back(_("IOS Version:"), m_ios_version);
const int space_10 = FromDIP(10);
auto* const iso_details = new wxGridBagSizer(space_10, space_10);
size_t row = 0;
for (auto& control : controls)
{
auto* const text = new wxStaticText(this, wxID_ANY, control.first);
iso_details->Add(text, wxGBPosition(row, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL);
control.second = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
wxTE_READONLY);
iso_details->Add(control.second, wxGBPosition(row, 1), wxGBSpan(1, 2), wxEXPAND);
++row;
}
auto* const md5_sum_text = new wxStaticText(this, wxID_ANY, _("MD5 Checksum:"));
m_md5_sum = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
wxTE_READONLY);
m_md5_sum_compute = new wxButton(this, wxID_ANY, _("Compute"));
iso_details->Add(md5_sum_text, wxGBPosition(row, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL);
iso_details->Add(m_md5_sum, wxGBPosition(row, 1), wxGBSpan(1, 1), wxEXPAND);
iso_details->Add(m_md5_sum_compute, wxGBPosition(row, 2), wxGBSpan(1, 1), wxEXPAND);
++row;
iso_details->AddGrowableCol(1);
const int space_5 = FromDIP(5);
auto* const iso_details_sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("ISO Details"));
iso_details_sizer->AddSpacer(space_5);
iso_details_sizer->Add(iso_details, 0, wxEXPAND | wxLEFT | wxRIGHT, space_5);
iso_details_sizer->AddSpacer(space_5);
return iso_details_sizer;
}