本文整理汇总了C++中wxGBPosition函数的典型用法代码示例。如果您正苦于以下问题:C++ wxGBPosition函数的具体用法?C++ wxGBPosition怎么用?C++ wxGBPosition使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wxGBPosition函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isFindDlg
void FindReplaceDialog::ShowReplaceControls(bool show)
{
// detach the find string & its label from the gridbag sizer
bool isFindDlg(false);
isFindDlg = gbSizer->GetItemPosition(sz) == wxGBPosition(1, 0);
if(show == false) {
// is this dialog is already a 'Find' dialog?
if(isFindDlg) { return; }
// remove 'Replace' dialog items
gbSizer->Detach(m_replaceWithLabel);
gbSizer->Detach(m_replaceString);
// reposition the options static sizer
gbSizer->Detach(sz);
gbSizer->Add(sz, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL | wxEXPAND, 5);
} else {
// is this dialog is already a 'Replace' dialog?
if(!isFindDlg) { return; }
// remmove the 'Options' item frmo pos 1,0
gbSizer->Detach(sz);
gbSizer->Add(m_replaceWithLabel, wxGBPosition(1, 0), wxDefaultSpan, wxALL | wxEXPAND, 5);
gbSizer->Add(m_replaceString, wxGBPosition(1, 1), wxDefaultSpan, wxALL | wxEXPAND, 5);
gbSizer->Add(sz, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL | wxEXPAND, 5);
}
wxString label = show ? wxT("Replace") : wxT("Find");
m_replace->Show(show);
m_replaceAll->Show(show);
m_replaceString->Show(show);
m_replacementsMsg->Show(show);
m_replaceWithLabel->Show(show);
m_selectionOnly->Show(show);
SetLabel(label);
this->Fit();
GetSizer()->Layout();
}
示例2: pos
// Assumes a 10x10 grid, and returns the first empty cell found. This is
// really stupid but it is only used by the Add methods that match the base
// class virtuals, which should normally not be used anyway...
wxGBPosition wxGridBagSizer::FindEmptyCell()
{
int row, col;
for (row=0; row<10; row++)
for (col=0; col<10; col++)
{
wxGBPosition pos(row, col);
if ( !CheckForIntersection(pos, wxDefaultSpan) )
return pos;
}
return wxGBPosition(-1, -1);
}
示例3: wxStaticText
void thirdPagePanel::pageFilling()
{
thirdPageDivider->Add(graphBlock,3, wxALL | wxEXPAND, 5);
parent->SetStatusText(wxT("Figure 3.1 - LMFC of the given system"));
thirdPageDivider->Add(hintFrameScrollWin,1, wxALL | wxEXPAND, 5);
hintFrameSizer->Add(new wxStaticText(hintFrameScrollWin,-1,wxT("some text\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nyup,text")),wxGBPosition(0,0),wxGBSpan(1,1),wxGROW);
hintFrameSizer->Add(thirdPageProceed,wxGBPosition(1,0),wxGBSpan(1,1),wxGROW);
hintFrameSizer->AddGrowableCol(0);
hintFrameSizer->AddGrowableRow(0);
hintFrameSizer->Layout();
return;
}
示例4: wxT
MyAboutDlg::MyAboutDlg(wxWindow* parent):wxDialog(parent, wxID_ANY,
wxT("(Onega) libraries of coreinfo"), wxDefaultPosition,
wxSize(600, 480), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
wxGridBagSizer *gbsizer=new wxGridBagSizer();
main = new wxTextCtrl(this, wxID_ANY,
wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxHSCROLL);
main->SetWindowStyle(main->GetWindowStyle() & ~wxTE_DONTWRAP | wxTE_BESTWRAP);
gbsizer->Add(main, wxGBPosition(0,0), wxDefaultSpan, wxGROW);
gbsizer->AddGrowableRow(0);
gbsizer->AddGrowableCol(0);
SetSizer(gbsizer);
sprintf(cmdbuf, "grep so /proc/%d/maps |awk '{print $6}' | uniq | sort", getpid());
main->SetValue(exec_cmd(cmdbuf));
}
示例5: wxPanel
ThingTypeReplacePanel::ThingTypeReplacePanel(wxWindow* parent) : wxPanel(parent, -1) {
// Setup sizer
wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
SetSizer(sizer);
wxGridBagSizer* gbsizer = new wxGridBagSizer(4, 4);
sizer->AddStretchSpacer();
sizer->Add(gbsizer, 0, wxALIGN_CENTER|wxALL, 4);
sizer->AddStretchSpacer();
// From type
gbsizer->Add(new wxStaticText(this, -1, "Replace Type:"), wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT);
spin_from = new wxSpinCtrl(this, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 999999);
gbsizer->Add(spin_from, wxGBPosition(0, 1), wxDefaultSpan, wxEXPAND);
//btn_browse_from = new wxButton(this, -1, "...", wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
//gbsizer->Add(btn_browse_from, wxGBPosition(0, 2), wxDefaultSpan, wxEXPAND);
// To type
gbsizer->Add(new wxStaticText(this, -1, "With Type:"), wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT);
spin_to = new wxSpinCtrl(this, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 999999);
gbsizer->Add(spin_to, wxGBPosition(1, 1), wxDefaultSpan, wxEXPAND);
//btn_browse_to = new wxButton(this, -1, "...", wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
//gbsizer->Add(btn_browse_to, wxGBPosition(1, 2), wxDefaultSpan, wxEXPAND);
}
示例6: wxPanel
/* ThingPropsPanel::setupExtraFlagsTab
* Creates and sets up the 'Extra Flags' tab
*******************************************************************/
wxPanel* ThingPropsPanel::setupExtraFlagsTab()
{
// Create panel
wxPanel* panel = new wxPanel(stc_tabs, -1);
// Setup sizer
wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
panel->SetSizer(sizer);
// Init flags
wxGridBagSizer* gb_sizer_flags = new wxGridBagSizer(4, 4);
sizer->Add(gb_sizer_flags, 1, wxEXPAND|wxALL, 10);
int row = 0;
int col = 0;
// Get all extra flag names
vector<string> flags;
for (unsigned a = 0; a < udmf_flags_extra.size(); a++)
{
UDMFProperty* prop = theGameConfiguration->getUDMFProperty(udmf_flags_extra[a], MOBJ_THING);
flags.push_back(prop->getName());
}
// Add flag checkboxes
int flag_mid = flags.size() / 3;
if (flags.size() % 3 == 0) flag_mid--;
for (unsigned a = 0; a < flags.size(); a++)
{
wxCheckBox* cb_flag = new wxCheckBox(panel, -1, flags[a], wxDefaultPosition, wxDefaultSize, wxCHK_3STATE);
gb_sizer_flags->Add(cb_flag, wxGBPosition(row++, col), wxDefaultSpan, wxEXPAND);
cb_flags_extra.push_back(cb_flag);
if (row > flag_mid)
{
row = 0;
col++;
}
}
gb_sizer_flags->AddGrowableCol(0, 1);
gb_sizer_flags->AddGrowableCol(1, 1);
gb_sizer_flags->AddGrowableCol(2, 1);
return panel;
}
示例7: wxPanel
DiffPanel::DiffPanel(wxWindow* parent, EditorFrame& parentFrame, CatalystWrapper& cw, wxBitmap& bitmap):
wxPanel(parent, wxID_ANY, wxPoint(-100,-100)),
m_parentFrame(&parentFrame), m_leftEditor(NULL), m_rightEditor(NULL), m_currentEditor(NULL)
{
Hide(); // Hidden during construction
// Create ctrls
m_leftEditor = new EditorCtrl(cw, bitmap, this, parentFrame);
m_rightEditor = new EditorCtrl(cw, bitmap, this, parentFrame);
m_leftEditor->SetScrollbarLeft();
m_rightEditor->SetGutterRight();
m_diffBar = new DiffBar(this, cw, m_leftEditor, m_rightEditor);
m_leftMarkBar = new DiffMarkBar(this, m_diffBar->GetLineMatches(), m_leftEditor, true);
m_rightMarkBar = new DiffMarkBar(this, m_diffBar->GetLineMatches(), m_rightEditor, false);
m_leftTitle = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
m_rightTitle = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
wxButton* swapButton = new wxButton(this, ID_BUTTON_SWAP, wxT("<->"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
m_currentEditor = m_leftEditor; // default focus is left
// Layout sizers
m_mainSizer = new wxGridBagSizer();
{
m_mainSizer->AddGrowableRow(1);
m_mainSizer->AddGrowableCol(1);
m_mainSizer->AddGrowableCol(3);
m_mainSizer->Add(m_leftTitle, wxGBPosition(0,0), wxGBSpan(1,2), wxEXPAND);
m_mainSizer->Add(swapButton, wxGBPosition(0,2));
m_mainSizer->Add(m_rightTitle, wxGBPosition(0,3), wxGBSpan(1,2), wxEXPAND);
m_mainSizer->Add(m_leftMarkBar, wxGBPosition(1,0), wxGBSpan(1,1), wxEXPAND);
m_mainSizer->Add(m_leftEditor, wxGBPosition(1,1), wxGBSpan(1,1), wxEXPAND);
m_mainSizer->Add(m_diffBar, wxGBPosition(1,2), wxGBSpan(1,1), wxEXPAND);
m_mainSizer->Add(m_rightEditor, wxGBPosition(1,3), wxGBSpan(1,1), wxEXPAND);
m_mainSizer->Add(m_rightMarkBar, wxGBPosition(1,4), wxGBSpan(1,1), wxEXPAND);
}
SetSizer(m_mainSizer);
}
示例8: wxDialog
CLoginDlg::CLoginDlg(wxDialog *parent, const wxString &title)
: wxDialog(parent, wxID_ANY, title)
{
wxIcon icoApp(wxString::FromUTF8("./images/icon/jo_browser.ico"), wxBITMAP_TYPE_ICO);
SetIcon(icoApp);
SetBackgroundColour(wxColor(242, 243, 247));
SetInitialSize(wxSize(500, 300));
wxGridBagSizer *bCtrlSizer = new wxGridBagSizer(3, 4);
///服务器信息
m_staticTextServer = new wxStaticText(this, wxID_ANY, wxT(" 服务器"), wxDefaultPosition, wxSize(100, -1), wxALIGN_RIGHT);
m_textServer = new wxTextCtrl(this, wxID_ANY, wxT("192.168.1.106"), wxDefaultPosition, wxSize(200, -1), wxALIGN_LEFT);
bCtrlSizer->Add(m_staticTextServer, wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
bCtrlSizer->Add(m_textServer, wxGBPosition(0, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT);
///用户名
m_staticTextUser = new wxStaticText(this, wxID_ANY, wxT("用户名称"), wxDefaultPosition, wxSize(100, -1), wxALIGN_RIGHT);
m_textUser = new wxTextCtrl(this, wxID_ANY, wxT("admin"), wxDefaultPosition, wxSize(200, -1), wxALIGN_LEFT);
bCtrlSizer->Add(m_staticTextUser, wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
bCtrlSizer->Add(m_textUser, wxGBPosition(1, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT);
///密码
m_staticTextPassw = new wxStaticText(this, wxID_ANY, wxT(" 密码"), wxDefaultPosition, wxSize(100, -1), wxALIGN_RIGHT);
m_textPassw = new wxTextCtrl(this, wxID_ANY, wxT("admin"), wxDefaultPosition, wxSize(200, -1), wxTE_PASSWORD | wxALIGN_LEFT);
bCtrlSizer->Add(m_staticTextPassw, wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
bCtrlSizer->Add(m_textPassw, wxGBPosition(2, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT);
wxBoxSizer *btnSizer = new wxBoxSizer(wxHORIZONTAL);
///登录取消
m_btnLogin = new wxButton(this, wxID_OK, wxT("登录"), wxDefaultPosition, wxDefaultSize, 0);
m_btnLogin->SetDefault();
m_btnCancel = new wxButton(this, wxID_CANCEL, wxT("取消"), wxDefaultPosition, wxDefaultSize, 0);
btnSizer-> AddSpacer(240);
btnSizer->Add(m_btnLogin, 0, wxALIGN_CENTER);
btnSizer->AddSpacer(15);
btnSizer->Add(m_btnCancel, 1, wxALIGN_CENTER);
///对话框
wxBoxSizer* dlgSizer = new wxBoxSizer(wxVERTICAL);
dlgSizer->AddSpacer(60);
dlgSizer->Add(bCtrlSizer, 0, wxALIGN_CENTRE);
//dlgSizer->AddSpacer(5);
dlgSizer->Add(btnSizer, 1, wxALIGN_CENTRE);
SetSizer(dlgSizer);
Layout();
CenterOnScreen();
m_textServer->SetFocus();
}
示例9: wxT
ThroughputDetail::ThroughputDetail(wxWindow *parent, int row)
:TestDetailDialog( parent, wxID_DIALOG_THROUGHPUT_DETAIL, wxT("Detaljer för Genomströmning"), wxDefaultPosition, wxSize(700,400), wxDEFAULT_DIALOG_STYLE )
{
m_List = new wxListCtrl(
this,
wxID_ANY,
wxDefaultPosition,
wxSize( 700, 400 ),
wxLC_REPORT | wxLC_SINGLE_SEL );
m_List->InsertColumn(0, wxT("Typ"), wxLIST_FORMAT_LEFT, 130);
m_List->InsertColumn(1, wxT("Adress"), wxLIST_FORMAT_LEFT, 300);
m_List->InsertColumn(2, wxT("Genomströmning"), wxLIST_FORMAT_LEFT, 200);
m_SizerMain->Add( m_List, wxGBPosition( 0, 0 ), wxDefaultSpan, wxEXPAND );
this->SetSizer( m_SizerMain );
RefreshList( row );
}
示例10: wxControl
/* AngleControl::AngleControl
* AngleControl class constructor
*******************************************************************/
AngleControl::AngleControl(wxWindow* parent) : wxControl(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE)
{
wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
SetSizer(sizer);
// Setup visual angle panel
wxPanel* panel = new wxPanel(this, -1);
sizer->Add(panel, 1, wxEXPAND|wxALL, 4);
wxGridBagSizer* gb_sizer = new wxGridBagSizer(4, 4);
panel->SetSizer(gb_sizer);
// Fixed size
panel->SetInitialSize(wxSize(140, 140));
panel->SetMaxSize(wxSize(140, 140));
// Angle buttons
gb_sizer->Add(rb_angles[0] = new wxRadioButton(panel, -1, ""), wxGBPosition(2, 4), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT); // East
gb_sizer->Add(rb_angles[1] = new wxRadioButton(panel, -1, ""), wxGBPosition(1, 3), wxDefaultSpan, wxALIGN_TOP|wxALIGN_RIGHT); // NorthEast
gb_sizer->Add(rb_angles[2] = new wxRadioButton(panel, -1, ""), wxGBPosition(0, 2), wxDefaultSpan, wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM); // North
gb_sizer->Add(rb_angles[3] = new wxRadioButton(panel, -1, ""), wxGBPosition(1, 1), wxDefaultSpan, wxALIGN_TOP|wxALIGN_LEFT); // NorthWest
gb_sizer->Add(rb_angles[4] = new wxRadioButton(panel, -1, ""), wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT); // West
gb_sizer->Add(rb_angles[5] = new wxRadioButton(panel, -1, ""), wxGBPosition(3, 1), wxDefaultSpan, wxALIGN_BOTTOM|wxALIGN_LEFT); // SouthWest
gb_sizer->Add(rb_angles[6] = new wxRadioButton(panel, -1, ""), wxGBPosition(4, 2), wxDefaultSpan, wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP); // South
gb_sizer->Add(rb_angles[7] = new wxRadioButton(panel, -1, ""), wxGBPosition(3, 3), wxDefaultSpan, wxALIGN_BOTTOM|wxALIGN_RIGHT); // SouthEast
for (unsigned a = 0; a < 5; a++)
{
gb_sizer->AddGrowableCol(a, 1);
gb_sizer->AddGrowableRow(a, 1);
}
// Angle text box
text_angle = new NumberTextCtrl(this);
sizer->Add(text_angle, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);
// Bind events
for (unsigned a = 0; a < 8; a++)
rb_angles[a]->Bind(wxEVT_RADIOBUTTON, &AngleControl::onAngleButtonClicked, this);
}
示例11: wxDialog
TaskProgressDialog::TaskProgressDialog ( wxWindow* parent)
: wxDialog ( parent, -1, _("Please wait..."), wxDefaultPosition, wxDefaultSize , wxCAPTION)
{
wxClientDC dc(this);
dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
long widthText = 0;
long heightText = 0;
long lineHeight = 0;
dc.GetTextExtent(initial_text, &widthText, &heightText, NULL, NULL, NULL);
dc.GetTextExtent("ABEND", NULL, &lineHeight, NULL, NULL, NULL);
auto wrapsizer = new wxBoxSizer(wxVERTICAL);
auto centerizer = new wxGridBagSizer( 0, 0 );
centerizer->AddGrowableCol( 0 );
centerizer->AddGrowableRow( 0 );
centerizer->SetFlexibleDirection( wxBOTH );
centerizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL );
wrapsizer->Add( centerizer, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL);
wxSize textSize(widthText, heightText);
message = new wxGenericStaticText(this, -1, "" ,wxDefaultPosition, textSize,wxALIGN_CENTRE_HORIZONTAL);
message->SetMinSize(textSize);
centerizer->Add(message,wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, lineHeight/2);
gauge = new wxGauge(this,-1,100,wxDefaultPosition,wxDefaultSize,wxGA_HORIZONTAL | wxGA_SMOOTH);
wrapsizer->Add(gauge,wxSizerFlags().Expand().Border(wxBOTTOM|wxLEFT|wxRIGHT,lineHeight/2).Proportion(0));
EnableCloseButton(false);
SetSizerAndFit(wrapsizer);
CenterOnParent();
#ifdef __WXGTK__
pulse_timer = new wxTimer(this,ID_PulseTimer);
#endif
}
示例12: Emulation
void AudioConfigPane::InitializeGUI()
{
m_dsp_engine_strings.Add(_("DSP HLE Emulation (fast)"));
m_dsp_engine_strings.Add(_("DSP LLE Recompiler"));
m_dsp_engine_strings.Add(_("DSP LLE Interpreter (slow)"));
m_dsp_engine_radiobox =
new wxRadioBox(this, wxID_ANY, _("DSP Emulation Engine"), wxDefaultPosition, wxDefaultSize,
m_dsp_engine_strings, 0, wxRA_SPECIFY_ROWS);
m_dpl2_decoder_checkbox = new wxCheckBox(this, wxID_ANY, _("Dolby Pro Logic II Decoder"));
m_volume_slider = new DolphinSlider(this, wxID_ANY, 0, 0, 100, wxDefaultPosition, wxDefaultSize,
wxSL_VERTICAL | wxSL_INVERSE);
m_volume_text = new wxStaticText(this, wxID_ANY, "");
m_audio_backend_choice =
new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_audio_backend_strings);
if (m_latency_control_supported)
{
m_audio_latency_spinctrl =
new wxSpinCtrl(this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 200);
m_audio_latency_label = new wxStaticText(this, wxID_ANY, _("Latency (ms):"));
}
m_stretch_checkbox = new wxCheckBox(this, wxID_ANY, _("Enable Audio Stretching"));
m_stretch_label = new wxStaticText(this, wxID_ANY, _("Buffer Size:"));
m_stretch_slider =
new DolphinSlider(this, wxID_ANY, 80, 5, 300, wxDefaultPosition, wxDefaultSize);
m_stretch_text = new wxStaticText(this, wxID_ANY, "");
if (m_latency_control_supported)
{
m_audio_latency_spinctrl->SetToolTip(_("Sets the latency (in ms). Higher values may reduce audio "
"crackling. Certain backends only."));
}
m_dpl2_decoder_checkbox->SetToolTip(
_("Enables Dolby Pro Logic II emulation using 5.1 surround. Certain backends only."));
m_stretch_checkbox->SetToolTip(_("Enables stretching of the audio to match emulation speed."));
m_stretch_slider->SetToolTip(_("Size of stretch buffer in milliseconds. "
"Values too low may cause audio crackling."));
const int space5 = FromDIP(5);
wxStaticBoxSizer* const volume_sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Volume"));
volume_sizer->Add(m_volume_slider, 1, wxALIGN_CENTER_HORIZONTAL);
volume_sizer->Add(m_volume_text, 0, wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT, space5);
volume_sizer->AddSpacer(space5);
wxGridBagSizer* const backend_grid_sizer = new wxGridBagSizer(space5, space5);
backend_grid_sizer->Add(new wxStaticText(this, wxID_ANY, _("Audio Backend:")), wxGBPosition(0, 0),
wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
backend_grid_sizer->Add(m_audio_backend_choice, wxGBPosition(0, 1), wxDefaultSpan,
wxALIGN_CENTER_VERTICAL);
backend_grid_sizer->Add(m_dpl2_decoder_checkbox, wxGBPosition(1, 0), wxGBSpan(1, 2),
wxALIGN_CENTER_VERTICAL);
if (m_latency_control_supported)
{
backend_grid_sizer->Add(m_audio_latency_label, wxGBPosition(2, 0), wxDefaultSpan,
wxALIGN_CENTER_VERTICAL);
backend_grid_sizer->Add(m_audio_latency_spinctrl, wxGBPosition(2, 1), wxDefaultSpan,
wxALIGN_CENTER_VERTICAL);
}
wxStaticBoxSizer* const backend_static_box_sizer =
new wxStaticBoxSizer(wxVERTICAL, this, _("Backend Settings"));
backend_static_box_sizer->AddSpacer(space5);
backend_static_box_sizer->Add(backend_grid_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
backend_static_box_sizer->AddSpacer(space5);
wxBoxSizer* const dsp_audio_sizer = new wxBoxSizer(wxHORIZONTAL);
dsp_audio_sizer->AddSpacer(space5);
dsp_audio_sizer->Add(m_dsp_engine_radiobox, 1, wxEXPAND | wxTOP | wxBOTTOM, space5);
dsp_audio_sizer->AddSpacer(space5);
dsp_audio_sizer->Add(volume_sizer, 0, wxEXPAND | wxTOP | wxBOTTOM, space5);
dsp_audio_sizer->AddSpacer(space5);
wxGridBagSizer* const latency_sizer = new wxGridBagSizer();
latency_sizer->Add(m_stretch_slider, wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
latency_sizer->Add(m_stretch_text, wxGBPosition(0, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
wxGridBagSizer* const stretching_grid_sizer = new wxGridBagSizer(space5, space5);
stretching_grid_sizer->Add(m_stretch_checkbox, wxGBPosition(0, 0), wxGBSpan(1, 2),
wxALIGN_CENTER_VERTICAL);
stretching_grid_sizer->Add(m_stretch_label, wxGBPosition(1, 0), wxDefaultSpan,
wxALIGN_CENTER_VERTICAL);
stretching_grid_sizer->Add(latency_sizer, wxGBPosition(1, 1), wxDefaultSpan,
wxALIGN_CENTER_VERTICAL);
wxStaticBoxSizer* const stretching_box_sizer =
new wxStaticBoxSizer(wxVERTICAL, this, _("Audio Stretching Settings"));
stretching_box_sizer->AddSpacer(space5);
stretching_box_sizer->Add(stretching_grid_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
stretching_box_sizer->AddSpacer(space5);
wxBoxSizer* const main_sizer = new wxBoxSizer(wxVERTICAL);
main_sizer->AddSpacer(space5);
main_sizer->Add(dsp_audio_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
main_sizer->AddSpacer(space5);
main_sizer->Add(backend_static_box_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
main_sizer->AddSpacer(space5);
main_sizer->Add(stretching_box_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
main_sizer->AddSpacer(space5);
SetSizerAndFit(main_sizer);
}
示例13: PrefsPanelBase
/* InterfacePrefsPanel::InterfacePrefsPanel
* InterfacePrefsPanel class constructor
*******************************************************************/
InterfacePrefsPanel::InterfacePrefsPanel(wxWindow* parent) : PrefsPanelBase(parent)
{
// Create sizer
wxBoxSizer* psizer = new wxBoxSizer(wxVERTICAL);
SetSizer(psizer);
// Create frame+sizer
wxStaticBox* frame = new wxStaticBox(this, -1, "Interface Preferences");
wxStaticBoxSizer* fsizer = new wxStaticBoxSizer(frame, wxVERTICAL);
psizer->Add(fsizer, 1, wxEXPAND|wxALL, 4);
STabCtrl* stc_tabs = new STabCtrl(this);
fsizer->Add(stc_tabs, 1, wxEXPAND | wxALL, 4);
// --- General ---
wxPanel* panel = new wxPanel(stc_tabs, -1);
wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
panel->SetSizer(sizer);
wxGridBagSizer* gb_sizer = new wxGridBagSizer(8, 8);
sizer->Add(gb_sizer, 1, wxALL | wxEXPAND, 8);
stc_tabs->AddPage(panel, "General");
// Show startpage
int row = 0;
cb_start_page = new wxCheckBox(panel, -1, "Show Start Page on Startup");
gb_sizer->Add(cb_start_page, wxGBPosition(row++, 0), wxGBSpan(1, 2), wxEXPAND);
// Show file browser
cb_file_browser = new wxCheckBox(panel, -1, "Show File Browser tab in the Archive Manager panel *");
gb_sizer->Add(cb_file_browser, wxGBPosition(row++, 0), wxGBSpan(1, 2), wxEXPAND);
// Monospace list font
cb_list_monospace = new wxCheckBox(panel, -1, "Use monospaced font for lists");
gb_sizer->Add(cb_list_monospace, wxGBPosition(row++, 0), wxGBSpan(1, 2), wxEXPAND);
// Toolbar size
string sizes[] = { "Small (16px)", "Medium (24px)", "Large (32px)" };
choice_toolbar_size = new wxChoice(panel, -1, wxDefaultPosition, wxDefaultSize, 3, sizes);
gb_sizer->Add(new wxStaticText(panel, -1, "Toolbar icon size:"), wxGBPosition(row, 0), wxDefaultSpan, wxALIGN_CENTRE_VERTICAL);
gb_sizer->Add(choice_toolbar_size, wxGBPosition(row, 1), wxDefaultSpan, wxEXPAND);
gb_sizer->Add(new wxStaticText(panel, -1, "*"), wxGBPosition(row++, 2), wxDefaultSpan, wxALIGN_CENTRE_VERTICAL);
// Icon set
vector<string> sets = Icons::getIconSets(Icons::GENERAL);
choice_iconset_general = new wxChoice(panel, -1, wxDefaultPosition, wxDefaultSize, sets.size(), &sets[0]);
gb_sizer->Add(new wxStaticText(panel, -1, "Icons:"), wxGBPosition(row, 0), wxDefaultSpan, wxALIGN_CENTRE_VERTICAL);
gb_sizer->Add(choice_iconset_general, wxGBPosition(row, 1), wxDefaultSpan, wxEXPAND);
gb_sizer->Add(new wxStaticText(panel, -1, "*"), wxGBPosition(row++, 2), wxDefaultSpan, wxALIGN_CENTRE_VERTICAL);
gb_sizer->AddGrowableCol(1, 1);
sizer->Add(new wxStaticText(panel, -1, "* requires restart to take effect"), 0, wxALL | wxALIGN_RIGHT, 8);
// --- Entry List ---
panel = new wxPanel(stc_tabs, -1);
sizer = new wxBoxSizer(wxVERTICAL);
panel->SetSizer(sizer);
gb_sizer = new wxGridBagSizer(8, 8);
sizer->Add(gb_sizer, 1, wxALL | wxEXPAND, 8);
stc_tabs->AddPage(panel, "Entry List");
// Show entry size as string instead of a number
row = 0;
cb_size_as_string = new wxCheckBox(panel, -1, "Show entry size as a string with units");
gb_sizer->Add(cb_size_as_string, wxGBPosition(row++, 0), wxGBSpan(1, 2), wxEXPAND);
// Filter directories
cb_filter_dirs = new wxCheckBox(panel, -1, "Ignore directories when filtering by name");
gb_sizer->Add(cb_filter_dirs, wxGBPosition(row++, 0), wxGBSpan(1, 2), wxEXPAND);
// Entry list background colour by type
cb_elist_bgcol = new wxCheckBox(panel, -1, "Colour entry list item background by entry type");
gb_sizer->Add(cb_elist_bgcol, wxGBPosition(row++, 0), wxGBSpan(1, 2), wxEXPAND);
// Context menu submenus
cb_context_submenus = new wxCheckBox(panel, -1, "Group related entry context menu items into submenus");
gb_sizer->Add(cb_context_submenus, wxGBPosition(row++, 0), wxGBSpan(1, 2), wxEXPAND);
// Icon set
sets = Icons::getIconSets(Icons::ENTRY);
choice_iconset_entry = new wxChoice(panel, -1, wxDefaultPosition, wxDefaultSize, sets.size(), &sets[0]);
gb_sizer->Add(new wxStaticText(panel, -1, "Icons:"), wxGBPosition(row, 0), wxDefaultSpan, wxALIGN_CENTRE_VERTICAL);
gb_sizer->Add(choice_iconset_entry, wxGBPosition(row, 1), wxDefaultSpan, wxEXPAND);
gb_sizer->Add(new wxStaticText(panel, -1, "*"), wxGBPosition(row++, 2), wxDefaultSpan, wxALIGN_CENTRE_VERTICAL);
gb_sizer->AddGrowableCol(1, 1);
sizer->Add(new wxStaticText(panel, -1, "* requires restart to take effect"), 0, wxALL | wxALIGN_RIGHT, 8);
//// Tab style
//string styles[] ={ "Flat (Default)", "Glossy", "Rounded" };
//choice_tab_style = new wxChoice(this, -1, wxDefaultPosition, wxDefaultSize, 3, styles);
//hbox = new wxBoxSizer(wxHORIZONTAL);
//sizer->Add(hbox, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);
//hbox->Add(new wxStaticText(this, -1, "Tab style:"), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
//hbox->Add(choice_tab_style, 0, wxEXPAND|wxRIGHT, 4);
//.........这里部分代码省略.........
示例14: wxPanel
CDExtraClientPanel::CDExtraClientPanel(wxWindow* parent, int id) :
wxPanel(parent, id),
m_timer(this, Timer_Connected),
m_reflector(NULL),
m_connect(NULL),
m_module(NULL),
m_status1(NULL),
m_transmit(NULL),
m_status2(NULL),
m_hrdYour(NULL),
m_hrdMy(NULL),
m_hrdReflector(NULL),
m_hrdMessage(NULL),
m_heard(NULL),
m_reflectorName(),
m_connected(false),
m_busy(false),
m_hosts(),
m_initialised(false)
{
wxGridBagSizer* panelSizer = new wxGridBagSizer();
wxStaticText* reflectorLabel = new wxStaticText(this, -1, _("Reflector"), wxDefaultPosition, wxSize(LABEL_WIDTH2, -1), wxALIGN_RIGHT);
panelSizer->Add(reflectorLabel, wxGBPosition(0, 0), wxDefaultSpan, wxALL, BORDER_SIZE);
wxFileName fileName(wxFileName::GetHomeDir(), HOSTS_FILE_NAME);
if (!fileName.IsFileReadable()) {
wxLogMessage(wxT("File %s not readable"), fileName.GetFullPath().c_str());
#if defined(__WINDOWS__)
fileName.Assign(::wxGetCwd(), HOSTS_FILE_NAME);
#else
fileName.Assign(wxT(DATA_DIR), HOSTS_FILE_NAME);
#endif
if (!fileName.IsFileReadable())
wxLogMessage(wxT("File %s not readable"), fileName.GetFullPath().c_str());
}
CDExtraClientHostFile file(fileName.GetFullPath());
unsigned int hostCount = file.getCount();
m_reflector = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1));
for (unsigned int i = 0U; i < hostCount; i++) {
m_hosts.Add(file.getHost(i));
m_reflector->Append(file.getName(i));
}
panelSizer->Add(m_reflector, wxGBPosition(0, 1), wxDefaultSpan, wxALL, BORDER_SIZE);
wxString reflector;
::wxGetApp().getLastReflector(reflector);
bool res = m_reflector->SetStringSelection(reflector);
if (!res)
m_reflector->SetSelection(0);
m_connect = new wxToggleButton(this, Button_Connect, _("Connect"), wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1));
panelSizer->Add(m_connect, wxGBPosition(0, 2), wxDefaultSpan, wxALL, BORDER_SIZE);
wxStaticText* moduleLabel = new wxStaticText(this, -1, _("Module"), wxDefaultPosition, wxSize(LABEL_WIDTH2, -1), wxALIGN_RIGHT);
panelSizer->Add(moduleLabel, wxGBPosition(0, 3), wxDefaultSpan, wxALL, BORDER_SIZE);
m_module = new wxChoice(this, Choice_Module, wxDefaultPosition, wxSize(CONTROL_WIDTH2, -1));
m_module->Append(wxT("A"));
m_module->Append(wxT("B"));
m_module->Append(wxT("C"));
m_module->Append(wxT("D"));
panelSizer->Add(m_module, wxGBPosition(0, 4), wxDefaultSpan, wxALL, BORDER_SIZE);
unsigned int module;
::wxGetApp().getLastModule(module);
m_module->SetSelection(module);
m_status1 = new wxStaticText(this, -1, _("Not connected"));
panelSizer->Add(m_status1, wxGBPosition(0, 5), wxDefaultSpan, wxALL, BORDER_SIZE);
m_transmit = new wxToggleButton(this, Button_Transmit, _("Transmit"), wxDefaultPosition, wxSize(CONTROL_WIDTH1 * 2 + BORDER_SIZE * 2, -1));
panelSizer->Add(m_transmit, wxGBPosition(1, 1), wxGBSpan(1, 2), wxALL, BORDER_SIZE);
m_status2 = new wxStaticText(this, -1, wxEmptyString);
panelSizer->Add(m_status2, wxGBPosition(1, 4), wxDefaultSpan, wxALL, BORDER_SIZE);
wxStaticBoxSizer* info1Sizer = new wxStaticBoxSizer(new wxStaticBox(this, -1, _("Current"), wxDefaultPosition, wxSize(INFO_WIDTH, INFO_HEIGHT)), wxVERTICAL);
wxGridBagSizer* info2Sizer = new wxGridBagSizer(BORDER_SIZE, BORDER_SIZE);
wxStaticText* hrdYourLabel = new wxStaticText(this, -1, _("Your:"), wxDefaultPosition, wxSize(LABEL_WIDTH1, -1), wxALIGN_RIGHT);
info2Sizer->Add(hrdYourLabel, wxGBPosition(0, 0), wxDefaultSpan, wxALL, BORDER_SIZE);
m_hrdYour = new wxStaticText(this, -1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1));
info2Sizer->Add(m_hrdYour, wxGBPosition(0, 1), wxDefaultSpan, wxALL, BORDER_SIZE);
wxStaticText* hrdMyLabel = new wxStaticText(this, -1, _("My:"), wxDefaultPosition, wxSize(LABEL_WIDTH1, -1), wxALIGN_RIGHT);
info2Sizer->Add(hrdMyLabel, wxGBPosition(0, 2), wxDefaultSpan, wxALL, BORDER_SIZE);
m_hrdMy = new wxStaticText(this, -1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1));
info2Sizer->Add(m_hrdMy, wxGBPosition(0, 3), wxDefaultSpan, wxALL, BORDER_SIZE);
wxStaticText* hrdReflectorLabel = new wxStaticText(this, -1, wxT("Reflector:"), wxDefaultPosition, wxSize(LABEL_WIDTH1, -1), wxALIGN_RIGHT);
info2Sizer->Add(hrdReflectorLabel, wxGBPosition(0, 4), wxDefaultSpan, wxALL, BORDER_SIZE);
m_hrdReflector = new wxStaticText(this, -1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1));
//.........这里部分代码省略.........
示例15: bmx_wxgridbagsizer_setitemposition
int bmx_wxgridbagsizer_setitemposition(wxGridBagSizer * gb, int index, int row, int col) {
return static_cast<int>(gb->SetItemPosition(index, wxGBPosition(row, col)));
}