本文整理汇总了C++中SetAutoLayout函数的典型用法代码示例。如果您正苦于以下问题:C++ SetAutoLayout函数的具体用法?C++ SetAutoLayout怎么用?C++ SetAutoLayout使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetAutoLayout函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wxPanel
CDStarRepeaterConfigControllerSet::CDStarRepeaterConfigControllerSet(wxWindow* parent, int id, const wxString& title, const wxString& type, unsigned int config, bool pttInvert, unsigned int time) :
wxPanel(parent, id),
m_title(title),
m_type(NULL),
m_config(NULL),
m_pttInvert(NULL),
m_time(NULL)
{
wxFlexGridSizer* sizer = new wxFlexGridSizer(2);
wxStaticText* typeLabel = new wxStaticText(this, -1, _("Type"));
sizer->Add(typeLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
m_type = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1));
m_type->Append(_("None"));
#if defined(GPIO)
m_type->Append(wxT("GPIO"));
m_type->Append(wxT("UDRC"));
#endif
m_type->Append(wxT("Velleman K8055 - 0"));
m_type->Append(wxT("Velleman K8055 - 1"));
m_type->Append(wxT("Velleman K8055 - 2"));
m_type->Append(wxT("Velleman K8055 - 3"));
// Add the URI USB
m_type->Append(wxT("URI USB - 1"));
m_type->Append(wxT("URI USB - 2"));
m_type->Append(wxT("URI USB - 3"));
m_type->Append(wxT("URI USB - 4"));
m_type->Append(wxT("URI USB - 5"));
m_type->Append(wxT("URI USB - 6"));
// Add the Serial ports
wxArrayString serialDevs = CSerialPortSelector::getDevices();
for (size_t i = 0U; i < serialDevs.GetCount(); i++)
m_type->Append(wxT("Serial - ") + serialDevs.Item(i));
// Add the Arduino ports
serialDevs = CSerialPortSelector::getDevices();
for (size_t i = 0U; i < serialDevs.GetCount(); i++)
m_type->Append(wxT("Arduino - ") + serialDevs.Item(i));
sizer->Add(m_type, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
if (type.IsEmpty())
m_type->SetSelection(0);
else
m_type->SetStringSelection(type);
wxStaticText* configLabel = new wxStaticText(this, -1, _("Config"));
sizer->Add(configLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
m_config = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH3, -1));
m_config->Append("1");
m_config->Append("2");
m_config->Append("3");
m_config->Append("4");
m_config->Append("5");
sizer->Add(m_config, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
m_config->SetSelection(config - 1);
wxStaticText* pttInvertLabel = new wxStaticText(this, -1, _("PTT Inversion"));
sizer->Add(pttInvertLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
m_pttInvert = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH3, -1));
m_pttInvert->Append(_("Off"));
m_pttInvert->Append(_("On"));
sizer->Add(m_pttInvert, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
m_pttInvert->SetSelection(pttInvert ? 1 : 0);
wxStaticText* timeLabel = new wxStaticText(this, -1, _("Time (secs)"));
sizer->Add(timeLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE);
m_time = new wxSlider(this, -1, time, 0, 300, wxDefaultPosition, wxSize(CONTROL_WIDTH2, -1), wxSL_HORIZONTAL | wxSL_LABELS);
sizer->Add(m_time, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
SetAutoLayout(true);
sizer->Fit(this);
sizer->SetSizeHints(this);
SetSizer(sizer);
}
示例2: wxPanel
// Constructor
wxHandheldInstallCtrl::wxHandheldInstallCtrl(wxWindow *parent, wxWindowID id,
const wxString &users_message, const wxString &directories_message,
const wxPoint& pos, const wxSize& size, const wxString& name )
: wxPanel(parent, id, pos, size, wxTAB_TRAVERSAL, name)
{
m_usersListCtrlImageId = 0;
m_directoriesListCtrlImageId = 0;
// Create a new instance of palm_installer to get data for the different controls
m_palmInstaller = new palm_installer;
// See constructor of winflip.cpp for comments
wxFlexGridSizer *mainFlexGridSizer = new wxFlexGridSizer( 2, 3, 0 );
mainFlexGridSizer->AddGrowableCol( 0 );
mainFlexGridSizer->AddGrowableRow( 1 );
mainFlexGridSizer->AddGrowableRow( 3 );
wxStaticText *usersStaticText = new wxStaticText( this, -1,
users_message,
wxDefaultPosition, wxDefaultSize, 0 );
mainFlexGridSizer->Add( usersStaticText, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 );
mainFlexGridSizer->Add( 1, 1, 0, wxALIGN_CENTRE, 25 );
m_usersListCtrl = new pda_listctrl( this, wxID_HANDHELDINSTALLCTRL_USERS_LISTCTRL,
wxDefaultPosition, wxDefaultSize,
wxLC_REPORT|wxSUNKEN_BORDER,
wxDefaultValidator, wxT( "users_listctrl" ),
_( "Handheld destination" ),
optionIS_USERS_LISTCTRL );
mainFlexGridSizer->Add( m_usersListCtrl, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5 );
wxFlexGridSizer *usersFlexGridSizer = new wxFlexGridSizer( 1, 0, 0 );
usersFlexGridSizer->AddGrowableCol( 0 );
m_usersAddButton = new wxButton( this, wxID_HANDHELDINSTALLCTRL_USERS_ADD_BUTTON,
_( "Add handheld..." ),
wxDefaultPosition, wxDefaultSize, 0 );
usersFlexGridSizer->Add( m_usersAddButton, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_usersRemoveButton = new wxButton( this, wxID_HANDHELDINSTALLCTRL_USERS_REMOVE_BUTTON,
_( "Remove selected handhelds" ),
wxDefaultPosition, wxDefaultSize, 0 );
usersFlexGridSizer->Add( m_usersRemoveButton, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
mainFlexGridSizer->Add( usersFlexGridSizer, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5 );
wxStaticText *directoriesStaticText = new wxStaticText( this, -1,
directories_message,
wxDefaultPosition, wxDefaultSize, 0 );
mainFlexGridSizer->Add( directoriesStaticText, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 );
mainFlexGridSizer->Add( 1, 1, 0, wxALIGN_CENTRE, 5 );
m_directoriesListCtrl = new pda_listctrl( this, wxID_HANDHELDINSTALLCTRL_DIRECTORIES_LISTCTRL,
wxDefaultPosition, wxDefaultSize,
wxLC_REPORT|wxSUNKEN_BORDER,
wxDefaultValidator, wxT( "directories_listctrl" ),
_( "Directory destination" ),
optionIS_DIRECTORIES_LISTCTRL );
mainFlexGridSizer->Add( m_directoriesListCtrl, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5 );
wxFlexGridSizer *directoryFlexGridSizer = new wxFlexGridSizer( 1, 0, 0 );
directoryFlexGridSizer->AddGrowableCol( 0 );
m_directoriesAddButton = new wxButton( this, wxID_HANDHELDINSTALLCTRL_DIRECTORIES_ADD_BUTTON,
_( "Add output directory..." ),
wxDefaultPosition, wxDefaultSize, 0 );
directoryFlexGridSizer->Add( m_directoriesAddButton, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_directoriesRemoveButton = new wxButton( this, wxID_HANDHELDINSTALLCTRL_DIRECTORIES_REMOVE_BUTTON,
_( "Remove selected directories" ),
wxDefaultPosition, wxDefaultSize, 0 );
directoryFlexGridSizer->Add( m_directoriesRemoveButton, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
mainFlexGridSizer->Add( directoryFlexGridSizer, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5 );
SetAutoLayout( TRUE );
SetSizer( mainFlexGridSizer );
mainFlexGridSizer->Fit( this );
mainFlexGridSizer->SetSizeHints( this );
// TODO: Don't know whether this Layout() is needed
Layout();
}
示例3: wxFrame
//.........这里部分代码省略.........
grid->SetRowSize( 0, 60 );
grid->SetCellValue( 0, 0, _T("Ctrl+Home\nwill go to\nthis cell") );
grid->SetCellValue( 0, 1, _T("A long piece of text to demonstrate wrapping.") );
grid->SetCellRenderer(0 , 1, new wxGridCellAutoWrapStringRenderer);
grid->SetCellEditor( 0, 1 , new wxGridCellAutoWrapStringEditor);
grid->SetCellValue( 0, 2, _T("Blah") );
grid->SetCellValue( 0, 3, _T("Read only") );
grid->SetReadOnly( 0, 3 );
grid->SetCellValue( 0, 4, _T("Can veto edit this cell") );
grid->SetCellValue( 0, 5, _T("Press\nCtrl+arrow\nto skip over\ncells") );
grid->SetRowSize( 99, 60 );
grid->SetCellValue( 99, 99, _T("Ctrl+End\nwill go to\nthis cell") );
grid->SetCellValue( 1, 0, _T("This default cell will overflow into neighboring cells, but not if you turn overflow off."));
grid->SetCellTextColour(1, 2, *wxRED);
grid->SetCellBackgroundColour(1, 2, *wxGREEN);
grid->SetCellValue( 1, 4, _T("I'm in the middle"));
grid->SetCellValue(2, 2, _T("red"));
grid->SetCellTextColour(2, 2, *wxRED);
grid->SetCellValue(3, 3, _T("green on grey"));
grid->SetCellTextColour(3, 3, *wxGREEN);
grid->SetCellBackgroundColour(3, 3, *wxLIGHT_GREY);
grid->SetCellValue(4, 4, _T("a weird looking cell"));
grid->SetCellAlignment(4, 4, wxALIGN_CENTRE, wxALIGN_CENTRE);
grid->SetCellRenderer(4, 4, new MyGridCellRenderer);
grid->SetCellValue(3, 0, _T("0"));
grid->SetCellRenderer(3, 0, new wxGridCellBoolRenderer);
grid->SetCellEditor(3, 0, new wxGridCellBoolEditor);
wxGridCellAttr *attr;
attr = new wxGridCellAttr;
attr->SetTextColour(*wxBLUE);
grid->SetColAttr(5, attr);
attr = new wxGridCellAttr;
attr->SetBackgroundColour(*wxRED);
grid->SetRowAttr(5, attr);
grid->SetCellValue(2, 4, _T("a wider column"));
grid->SetColSize(4, 120);
grid->SetColMinimalWidth(4, 120);
grid->SetCellTextColour(5, 8, *wxGREEN);
grid->SetCellValue(5, 8, _T("Bg from row attr\nText col from cell attr"));
grid->SetCellValue(5, 5, _T("Bg from row attr Text col from col attr and this text is so long that it covers over many many empty cells but is broken by one that isn't"));
grid->SetColFormatFloat(6);
grid->SetCellValue(0, 6, _T("3.1415"));
grid->SetCellValue(1, 6, _T("1415"));
grid->SetCellValue(2, 6, _T("12345.67890"));
grid->SetColFormatFloat(7, 6, 2);
grid->SetCellValue(0, 7, _T("3.1415"));
grid->SetCellValue(1, 7, _T("1415"));
grid->SetCellValue(2, 7, _T("12345.67890"));
const wxString choices[] =
{
_T("Please select a choice"),
_T("This takes two cells"),
_T("Another choice"),
};
grid->SetCellEditor(4, 0, new wxGridCellChoiceEditor(WXSIZEOF(choices), choices));
grid->SetCellSize(4, 0, 1, 2);
grid->SetCellValue(4, 0, choices[0]);
grid->SetCellOverflow(4, 0, false);
grid->SetCellSize(7, 1, 3, 4);
grid->SetCellAlignment(7, 1, wxALIGN_CENTRE, wxALIGN_CENTRE);
grid->SetCellValue(7, 1, _T("Big box!"));
wxBoxSizer *topSizer = new wxBoxSizer( wxVERTICAL );
topSizer->Add( grid,
1,
wxEXPAND );
#if wxUSE_LOG
topSizer->Add( logWin,
0,
wxEXPAND );
#endif // wxUSE_LOG
SetAutoLayout(true);
SetSizer( topSizer );
topSizer->Fit( this );
Centre();
SetDefaults();
}
示例4: PrefsPanel
QualityPrefs::QualityPrefs(wxWindow * parent):
PrefsPanel(parent)
{
int i;
int rate =
gPrefs->Read("/SamplingRate/DefaultProjectSampleRate", 44100);
int format =
gPrefs->Read("/SamplingRate/DefaultProjectSampleFormat", floatSample);
int pos = NUM_RATES; // Fall back to other
for (i = 0; i < NUM_RATES; i++)
if (rate == rates[i]) {
pos = i;
break;
}
int fmtpos = NUM_FORMATS-1;
for (i = 0; i < NUM_FORMATS; i++)
if (format == formats[i]) {
fmtpos = i;
break;
}
topSizer = new wxBoxSizer( wxHORIZONTAL );
{
topSizer->Add(
new wxStaticText(this, -1, _("Default Sample Rate:")), 0,
wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, GENERIC_CONTROL_BORDER);
mSampleRates = new wxChoice(this, ID_SAMPLE_RATE_CHOICE, wxDefaultPosition, wxDefaultSize,
NUM_RATES+1, stringRates);
mSampleRates->SetSelection(pos);
topSizer->Add( mSampleRates, 0, wxALL|wxALIGN_CENTER_VERTICAL, TOP_LEVEL_BORDER );
mOtherSampleRate = NULL;
mOtherSampleRate = new wxTextCtrl(
this, -1, wxString::Format("%i", rate),
wxDefaultPosition, wxSize(50, -1), 0 );
mOtherSampleRate->Enable(pos == NUM_RATES);
topSizer->Add( mOtherSampleRate, 0, wxALL|wxALIGN_CENTER_VERTICAL, TOP_LEVEL_BORDER );
}
wxBoxSizer *top2Sizer = new wxBoxSizer( wxHORIZONTAL );
{
top2Sizer->Add(
new wxStaticText(this, -1, _("Default Sample Format:")), 0,
wxALIGN_LEFT|wxALL|wxALIGN_CENTER_VERTICAL, GENERIC_CONTROL_BORDER);
mSampleFormats = new wxChoice(this, -1, wxDefaultPosition, wxDefaultSize,
NUM_FORMATS, stringFormats);
mSampleFormats->SetSelection(fmtpos);
top2Sizer->Add( mSampleFormats, 0, wxALL|wxALIGN_CENTER_VERTICAL, TOP_LEVEL_BORDER );
}
outSizer = new wxBoxSizer( wxVERTICAL );
outSizer->Add(topSizer, 0, wxGROW|wxALL, TOP_LEVEL_BORDER);
outSizer->Add(top2Sizer, 0, wxGROW|wxALL, TOP_LEVEL_BORDER);
SetAutoLayout(true);
outSizer->Fit(this);
outSizer->SetSizeHints(this);
SetSizer(outSizer);
}
示例5: wxDialog
wxNumberEntryDialog::wxNumberEntryDialog(wxWindow *parent,
const wxString& message,
const wxString& prompt,
const wxString& caption,
long value,
long min,
long max,
const wxPoint& pos)
: wxDialog(parent, wxID_ANY, caption,
pos, wxDefaultSize)
{
m_value = value;
m_max = max;
m_min = min;
wxBeginBusyCursor();
wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
#if wxUSE_STATTEXT
// 1) text message
topsizer->Add( CreateTextSizer( message ), 0, wxALL, 10 );
#endif
// 2) prompt and text ctrl
wxBoxSizer *inputsizer = new wxBoxSizer( wxHORIZONTAL );
#if wxUSE_STATTEXT
// prompt if any
if (!prompt.IsEmpty())
inputsizer->Add( new wxStaticText( this, wxID_ANY, prompt ), 0, wxCENTER | wxLEFT, 10 );
#endif
// spin ctrl
wxString valStr;
valStr.Printf(wxT("%ld"), m_value);
m_spinctrl = new wxSpinCtrl(this, wxID_ANY, valStr, wxDefaultPosition, wxSize( 140, wxDefaultCoord ) );
#if wxUSE_SPINCTRL
m_spinctrl->SetRange((int)m_min, (int)m_max);
#endif
inputsizer->Add( m_spinctrl, 1, wxCENTER | wxLEFT | wxRIGHT, 10 );
// add both
topsizer->Add( inputsizer, 1, wxEXPAND | wxLEFT|wxRIGHT, 5 );
// smart phones does not support or do not waste space for wxButtons
#ifdef __SMARTPHONE__
SetRightMenu(wxID_CANCEL, _("Cancel"));
#else // __SMARTPHONE__/!__SMARTPHONE__
#if wxUSE_STATLINE
// 3) static line
topsizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
#endif
// 4) buttons
topsizer->Add( CreateButtonSizer( wxOK|wxCANCEL ), 0, wxEXPAND | wxALL, 10 );
#endif // !__SMARTPHONE__
SetSizer( topsizer );
SetAutoLayout( true );
#if !defined(__SMARTPHONE__) && !defined(__POCKETPC__)
topsizer->SetSizeHints( this );
topsizer->Fit( this );
Centre( wxBOTH );
#endif
m_spinctrl->SetSelection(-1, -1);
m_spinctrl->SetFocus();
wxEndBusyCursor();
}
示例6: LADSPA_IS_PORT_INPUT
LadspaEffectDialog::LadspaEffectDialog(wxWindow * parent,
const LADSPA_Descriptor *data,
float *inputControls,
int sampleRate)
:wxDialog(parent, -1, data->Name,
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE)
{
numParams = 0;
this->mData = data;
this->inputControls = inputControls;
this->sampleRate = sampleRate;
inSlider = false;
inText = false;
targetSlider = NULL;
sliders = new wxSlider*[mData->PortCount];
fields = new wxTextCtrl*[mData->PortCount];
labels = new wxStaticText*[mData->PortCount];
ports = new unsigned long [mData->PortCount];
unsigned long p;
for(p=0; p<mData->PortCount; p++) {
LADSPA_PortDescriptor d = mData->PortDescriptors[p];
if (LADSPA_IS_PORT_CONTROL(d) &&
LADSPA_IS_PORT_INPUT(d)) {
ports[numParams] = p;
numParams++;
}
}
wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
wxControl *item;
item = new wxStaticText(this, 0,
wxString(_("Author: "))+mData->Maker);
mainSizer->Add(item, 0, wxALL, 5);
if (mData->Copyright &&
mData->Copyright[0] &&
mData->Copyright != wxString(_("None"))) {
item = new wxStaticText(this, 0,
mData->Copyright);
mainSizer->Add(item, 0, wxALL, 5);
}
wxSizer *paramSizer =
new wxStaticBoxSizer(new wxStaticBox(this, -1,
_("Ladspa Effect Settings")),
wxVERTICAL );
wxFlexGridSizer *gridSizer =
new wxFlexGridSizer(3, 0, 0);
for (p = 0; p < numParams; p++) {
item = new wxStaticText(this, 0, mData->PortNames[ports[p]]);
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
wxString fieldText;
LADSPA_PortRangeHint hint = mData->PortRangeHints[ports[p]];
if (LADSPA_IS_HINT_INTEGER(hint.HintDescriptor))
fieldText.Printf("%d", (int)(inputControls[ports[p]] + 0.5));
else
fieldText.Printf("%f", inputControls[ports[p]]);
fields[p] = new wxTextCtrl(this, LADSPA_TEXTCTRL_ID, fieldText);
gridSizer->Add(fields[p], 0, wxALL, 5);
sliders[p] =
new wxSlider(this, LADSPA_SLIDER_ID,
0, 0, 1000,
wxDefaultPosition,
wxSize(200, -1));
gridSizer->Add(sliders[p], 0, wxALL, 5);
}
// Set all of the sliders based on the value in the
// text fields
HandleText();
paramSizer->Add(gridSizer, 1, wxALL, 5);
mainSizer->Add(paramSizer, 1, wxALL, 5);
wxBoxSizer *okSizer = new wxBoxSizer(wxHORIZONTAL);
wxButton *button;
button = new wxButton(this, wxID_OK, _("OK"));
button->SetDefault();
button->SetFocus();
okSizer->Add(button, 0, wxALIGN_CENTRE | wxALL, 5);
button = new wxButton(this, wxID_CANCEL, _("Cancel"));
okSizer->Add(button, 0, wxALIGN_CENTRE | wxALL, 5);
mainSizer->Add(okSizer, 0, wxALIGN_CENTRE | wxALL, 5);
SetAutoLayout(TRUE);
SetSizer(mainSizer);
//.........这里部分代码省略.........
示例7: wxComboBox
//.........这里部分代码省略.........
m_pTxtPassword = new wxTextCtrl(this, ID_D1_TXT_PASSWORD);
m_pRadio1Win = new wxRadioButton(this, ID_D1_RADIO_1_WIN, wxT("1 window"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
m_pRadio2Win = new wxRadioButton(this, ID_D1_RADIO_2_WIN, wxT("2 windows"));
m_pRadio3Win = new wxRadioButton(this, ID_D1_RADIO_3_WIN, wxT("3 windows"));
m_pRadioIconsSimple = new wxRadioButton(this, ID_D1_RADIO_ICONS_SIMPLE , wxT("Simple"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
m_pRadioIconsAdvanced = new wxRadioButton(this, ID_D1_RADIO_ICONS_ADVANCED, wxT("Advanced"));
btnFont = new wxButton (this, ID_D1_BTN_FONT , wxT("Font") );
btnColor = new wxButton (this, ID_D1_BTN_COLOR , wxT("Color") );
btnOk = new wxButton (this, wxID_OK , wxT("Ok") );
btnCancel = new wxButton (this, wxID_CANCEL , wxT("Cancel") );
stPwd = new wxStaticText (this, -1 , wxT("Password"));
stFaction = new wxStaticText (this, -1 , wxT("Faction"));
stLayout = new wxStaticText (this, -1 , wxT("Layout"));
stIcons = new wxStaticText (this, -1 , wxT("Icons"));
#define space 2
topsizer = new wxBoxSizer( wxVERTICAL );
rowsizer = new wxBoxSizer( wxHORIZONTAL );
rowsizer->Add(m_pComboFonts , 1, wxALIGN_CENTER | wxALL , space);
rowsizer->Add(btnFont , 0, wxALIGN_CENTER | wxALL , space);
topsizer->Add(rowsizer , 0, wxALIGN_CENTER | wxALL | wxGROW, space );
rowsizer = new wxBoxSizer( wxHORIZONTAL );
rowsizer->Add(m_pComboColors , 1, wxALIGN_CENTER | wxALL , space);
rowsizer->Add(btnColor , 0, wxALIGN_CENTER | wxALL , space);
topsizer->Add(rowsizer , 0, wxALIGN_CENTER | wxALL | wxGROW, space );
rowsizer = new wxBoxSizer( wxHORIZONTAL );
rowsizer->Add(stFaction , 0, wxALIGN_CENTER | wxALL , space);
rowsizer->Add(m_pComboFactions , 1, wxALIGN_CENTER | wxALL , space);
rowsizer->Add(stPwd , 0, wxALIGN_CENTER | wxALL , space);
rowsizer->Add(m_pTxtPassword , 1, wxALIGN_CENTER | wxALL , space);
topsizer->Add(rowsizer , 0, wxALIGN_CENTER | wxALL | wxGROW, space );
rowsizer = new wxBoxSizer( wxHORIZONTAL );
colsizer = new wxBoxSizer( wxVERTICAL );
colsizer->Add(m_pChkLoadOrd , 0, wxALIGN_LEFT | wxALL, space);
colsizer->Add(m_pChkLoadRep , 0, wxALIGN_LEFT | wxALL, space);
colsizer->Add(m_pChkUnixStyle , 0, wxALIGN_LEFT | wxALL, space);
colsizer->Add(m_pChkHatchUnvisited , 0, wxALIGN_LEFT | wxALL, space);
rowsizer->Add(colsizer , 0, wxALIGN_CENTER | wxALL | wxGROW, space );
colsizer = new wxBoxSizer( wxVERTICAL );
colsizer->Add(m_pChkRClickCenters , 0, wxALIGN_LEFT | wxALL, space);
//colsizer->Add(m_pChk3WinLayout , 0, wxALIGN_LEFT | wxALL, space);
colsizer->Add(m_pChkTeach , 0, wxALIGN_LEFT | wxALL, space);
colsizer->Add(m_pChkReadPwd , 0, wxALIGN_LEFT | wxALL, space);
colsizer->Add(m_pChkCheckProdReq , 0, wxALIGN_LEFT | wxALL, space);
colsizer->Add(m_pChkMoveMode , 0, wxALIGN_LEFT | wxALL, space);
rowsizer->Add(colsizer , 0, wxALIGN_CENTER | wxALL | wxGROW, space );
colsizer = new wxBoxSizer( wxVERTICAL );
colsizer->Add(stLayout , 0, wxALIGN_CENTER | wxALL | wxGROW, space );
layoutsizer = new wxBoxSizer( wxVERTICAL );
layoutsizer->Add(m_pRadio1Win , 0, wxALIGN_LEFT | wxALL, space);
layoutsizer->Add(m_pRadio2Win , 0, wxALIGN_LEFT | wxALL, space);
layoutsizer->Add(m_pRadio3Win , 0, wxALIGN_LEFT | wxALL, space);
colsizer->Add(layoutsizer , 0, wxALIGN_CENTER | wxALL | wxGROW, space );
colsizer->Add(stIcons , 0, wxALIGN_CENTER | wxTOP | wxGROW, space+space );
layoutsizer = new wxBoxSizer( wxVERTICAL );
layoutsizer->Add(m_pRadioIconsSimple , 0, wxALIGN_LEFT | wxALL, space);
layoutsizer->Add(m_pRadioIconsAdvanced , 0, wxALIGN_LEFT | wxALL, space);
colsizer->Add(layoutsizer , 0, wxALIGN_CENTER | wxALL | wxGROW, space );
rowsizer->Add(colsizer , 0, wxALIGN_CENTER | wxALL | wxGROW, space );
topsizer->Add(rowsizer , 1, wxALIGN_CENTER | wxALL | wxGROW, space );
rowsizer = new wxBoxSizer( wxHORIZONTAL );
rowsizer->Add(btnOk , 0, wxALIGN_CENTER | wxALL, space);
rowsizer->Add(btnCancel , 0, wxALIGN_CENTER | wxALL, space);
topsizer->Add(rowsizer , 0, wxALIGN_CENTER | wxALL, space );
SetAutoLayout( TRUE ); // tell dialog to use sizer
SetSizer( topsizer ); // actually set the sizer
topsizer->Fit( this ); // set size to minimum size as calculated by the sizer
topsizer->SetSizeHints( this ); // set size hints to honour mininum size}
CResizableDlg::SetSize();
}
示例8: wxPanel
EffectPanel::EffectPanel(wxScrolledWindow* scrollMe, Effect* effect, bool isConstant, TimelinePanel *parent, wxWindowID id)
: wxPanel(parent, id, wxDefaultPosition, wxDefaultSize) {
timelineParent = parent;
this->isConstant = isConstant;
this->effect = effect;
this->scrollMe = scrollMe;
depthChange = 0;
PushEventHandler(new WheelCatcher(scrollMe));
wxBoxSizer *vBox;
wxStaticText *text;
vBox = new wxBoxSizer(wxVERTICAL);
SetSizer( vBox );
SetAutoLayout( true );
effectTypeChoice = new wxChoice(this, EFFECT_TYPE_CHOICE, wxDefaultPosition, wxDefaultSize, NUM_EFFECT_TYPES + 1, effectChoices);
effectTypeChoice->PushEventHandler(new WheelCatcher(scrollMe));
vBox->Add(effectTypeChoice, wxSizerFlags(0).Center().Expand());
effectTypeChoice->Select(effect->type);
sliderBox = new wxBoxSizer(wxHORIZONTAL);
vBox->Add(sliderBox, wxSizerFlags(0).Expand().Border(wxBOTTOM, 2));
if (isConstant) {
if (isFinite()) {
text = new wxStaticText( this, wxID_ANY, _T("Offset: "), wxDefaultPosition, wxDefaultSize);
} else {
text = new wxStaticText( this, wxID_ANY, _T("Range: "), wxDefaultPosition, wxDefaultSize);
}
} else {
text = new wxStaticText( this, wxID_ANY, _T("Range: "), wxDefaultPosition, wxDefaultSize);
}
text->PushEventHandler(new WheelCatcher(scrollMe));
sliderBox->Add(text, wxSizerFlags(0));
depthSlider = new wxSlider( this, DEPTH_SLIDER, 0, 0, 254,
wxDefaultPosition, wxSize(125,wxDefaultCoord), wxSL_AUTOTICKS);
sliderBox->Add(depthSlider, wxSizerFlags(1));
depthSlider->PushEventHandler(new WheelCatcher(scrollMe));
depthSlider->SetValue(effect->inst->getDepth(effect->type, effect->timeline));
if (isConstant == false) {
if (!isFinite()) {
sliderBox->Show(false);
}
effectCanvas = new EffectCanvas(effect, this, EFFECT_CANVAS, wxDefaultPosition, wxSize(192,80));
vBox->Add(effectCanvas, wxSizerFlags(0).Border(wxBOTTOM, 10));
effectCanvas->PushEventHandler(new WheelCatcher(scrollMe));
} else {
effectCanvas = 0;
}
vBox->Layout();
Monitor::addCallback( &effect->type,
new Callback<char, EffectPanel>
(this, &EffectPanel::typeChangedCallback) );
oldType = effect->type;
Monitor::addCallback( &effect->inst->original->depths[effect->timeline][effect->type],
new Callback<unsigned char, EffectPanel>
(this, &EffectPanel::depthChangedCallback) );
}
示例9: wxFrame
//.........这里部分代码省略.........
m_mainPanelVBox->Add (m_inputSBoxSizer, 0, wxGROW | wxALIGN_CENTER | wxALL, 10);
#ifdef WANT_MD4SUM
// MD4 Hash Vertical Box Sizer
m_md4HashSBox = new wxStaticBox (m_mainPanel, -1, _("MD4 File Hash"));
m_md4HashSBoxSizer = new wxStaticBoxSizer (m_md4HashSBox, wxHORIZONTAL);
// MD4 Hash results
m_md4HashTextCtrl = new wxTextCtrl( m_mainPanel, -1, wxEmptyString, wxDefaultPosition,
wxDefaultSize, wxTE_READONLY );
m_md4HashSBoxSizer->Add (m_md4HashTextCtrl, 1, wxALL | wxALIGN_CENTER, 5);
m_mainPanelVBox->Add( m_md4HashSBoxSizer, 0, wxALL | wxGROW, 10 );
#endif
// Hash Vertical Box Sizer
m_e2kHashSBox = new wxStaticBox (m_mainPanel, -1, _("eD2k File Hash"));
m_e2kHashSBoxSizer = new wxStaticBoxSizer (m_e2kHashSBox, wxHORIZONTAL);
// Hash results
m_e2kHashTextCtrl = new wxTextCtrl( m_mainPanel, -1, wxEmptyString, wxDefaultPosition,
wxDefaultSize, wxTE_READONLY );
m_e2kHashSBoxSizer->Add (m_e2kHashTextCtrl, 1, wxALL | wxALIGN_CENTER, 5);
m_mainPanelVBox->Add( m_e2kHashSBoxSizer, 0, wxALL | wxGROW, 10 );
// Ed2k Vertical Box Sizer
m_ed2kSBox = new wxStaticBox (m_mainPanel, -1, _("eD2k link"));
m_ed2kSBoxSizer = new wxStaticBoxSizer (m_ed2kSBox, wxVERTICAL);
// Ed2k results
m_ed2kTextCtrl = new wxTextCtrl( m_mainPanel, -1, wxEmptyString, wxDefaultPosition,
wxSize(-1,60), wxTE_MULTILINE|wxTE_READONLY|wxVSCROLL );
m_ed2kSBoxSizer->Add (m_ed2kTextCtrl, 1, wxALL | wxGROW, 5);
m_mainPanelVBox->Add( m_ed2kSBoxSizer, 1, wxALL | wxGROW, 10 );
// Button bar
m_buttonHBox = new wxBoxSizer (wxHORIZONTAL);
m_startButton =
new wxButton (m_mainPanel, ID_START_BUTTON, wxString (_("Start")));
m_saveButton =
new wxButton (m_mainPanel, ID_SAVEAS_BUTTON, wxString (_("Save")));
m_copyButton =
new wxButton (m_mainPanel, ID_COPY_BUTTON, wxString (_("Copy to clipboard")));
m_closeButton =
new wxButton (m_mainPanel, ID_EXIT_BUTTON, wxString (_("Exit")));
m_buttonHBox->Add (m_copyButton, 0, wxALIGN_LEFT | wxALL, 5);
m_buttonHBox->Add(1,1,1);
m_buttonHBox->Add (m_startButton, 0, wxALIGN_RIGHT | wxALL, 5);
m_buttonHBox->Add (m_saveButton, 0, wxALIGN_RIGHT | wxALL, 5);
m_buttonHBox->Add (m_closeButton, 0, wxALIGN_RIGHT | wxALL, 5);
m_mainPanelVBox->Add (m_buttonHBox, 0, wxALL | wxGROW, 5);
// Toolbar Pixmaps
m_toolBarBitmaps[0] = AlcPix::getPixmap(wxT("open"));
m_toolBarBitmaps[1] = AlcPix::getPixmap(wxT("copy"));
m_toolBarBitmaps[2] = AlcPix::getPixmap(wxT("saveas"));
m_toolBarBitmaps[3] = AlcPix::getPixmap(wxT("about"));
// Constructing toolbar
m_toolbar =
new wxToolBar (this, -1, wxDefaultPosition, wxDefaultSize,
wxTB_HORIZONTAL | wxTB_FLAT);
m_toolbar->SetToolBitmapSize (wxSize (32, 32));
m_toolbar->SetMargins (2, 2);
m_toolbar->AddTool (ID_BAR_OPEN, _("Open"), m_toolBarBitmaps[0],
_("Open a file to compute its eD2k link"));
m_toolbar->AddTool (ID_BAR_COPY, _("Copy"), m_toolBarBitmaps[1],
_("Copy computed eD2k link to clipboard"));
m_toolbar->AddTool (ID_BAR_SAVEAS, _("Save as"), m_toolBarBitmaps[2],
_("Save computed eD2k link to file"));
m_toolbar->AddSeparator ();
m_toolbar->AddTool (ID_BAR_ABOUT, _("About"), m_toolBarBitmaps[3],
_("About aLinkCreator"));
m_toolbar->Realize ();
SetToolBar (m_toolbar);
// Main panel Layout
m_mainPanel->SetAutoLayout(true);
m_mainPanel->SetSizerAndFit (m_mainPanelVBox);
// Frame Layout
m_frameVBox->Add (m_mainPanel, 1, wxALL | wxGROW, 0);
SetAutoLayout (true);
SetSizerAndFit (m_frameVBox);
m_startButton->SetFocus();
}
示例10: wxT
CHexExportDlg::CHexExportDlg(wxWindow *parent)
:CResizableDlg( parent, wxT("Hex export options"), SZ_SECT_WND_EXP_HEXES, wxDEFAULT_DIALOG_STYLE)
{
wxBoxSizer * topsizer;
wxBoxSizer * sizer ;
wxBoxSizer * colsizer;
wxStaticBox* box;
CStr ConfigKey;
CStr S;
m_btnOk = new wxButton (this, wxID_OK , wxT("Ok") );
m_btnCancel = new wxButton (this, wxID_CANCEL, wxT("Cancel") );
m_btnBrowse = new wxButton (this, -1, wxT("Browse") );
m_tcFName = new wxTextCtrl (this, -1, wxT(""), wxDefaultPosition, wxSize(150, -1));
m_rbHexNew = new wxRadioButton(this, -1, wxT("New") , wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
m_rbHexCurrent = new wxRadioButton(this, -1, wxT("Current") , wxDefaultPosition, wxDefaultSize, 0);
m_rbHexSelected = new wxRadioButton(this, -1, wxT("Selected"), wxDefaultPosition, wxDefaultSize, 0);
m_rbHexAll = new wxRadioButton(this, -1, wxT("All") , wxDefaultPosition, wxDefaultSize, 0);
m_rbFileOverwrite = new wxRadioButton(this, -1, wxT("Overwrite it") ,wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
m_rbFileAppend = new wxRadioButton(this, -1, wxT("Append to it") , wxDefaultPosition, wxDefaultSize, 0);
m_chbInclStructs = new wxCheckBox (this, -1, wxT("Structures"));
m_chbInclUnits = new wxCheckBox (this, -1, wxT("Units"));
m_chbInclResources= new wxCheckBox (this, -1, wxT("Resources"));
m_chbInclTurnNoAcl= new wxCheckBox (this, -1, wxT("Turn No a la Atlaclient"));
topsizer = new wxBoxSizer( wxVERTICAL );
sizer = new wxBoxSizer( wxHORIZONTAL );
sizer->Add(new wxStaticText(this, -1, wxT("Export to file")), 0, wxALIGN_LEFT | wxALL, 5);
sizer->Add(m_tcFName , 0, wxALIGN_CENTER | wxALL, 5);
sizer->Add(m_btnBrowse, 0, wxALIGN_CENTER | wxALL, 5);
topsizer->Add(sizer, 0, wxALIGN_CENTER | wxALL, 10);
sizer = new wxBoxSizer( wxHORIZONTAL );
box = new wxStaticBox(this, -1, wxT("If file exists:"));
colsizer = new wxStaticBoxSizer(box, wxVERTICAL );
colsizer->Add(m_rbFileOverwrite , 0, wxALIGN_LEFT | wxALL, 2);
colsizer->Add(m_rbFileAppend , 0, wxALIGN_LEFT | wxALL, 2);
sizer->Add(colsizer, 0, wxALIGN_LEFT | wxALL, 5 );
box = new wxStaticBox(this, -1, wxT("Hex(es):"));
colsizer = new wxStaticBoxSizer(box, wxVERTICAL );
colsizer->Add(m_rbHexNew , 0, wxALIGN_LEFT | wxALL, 2);
colsizer->Add(m_rbHexCurrent , 0, wxALIGN_LEFT | wxALL, 2);
colsizer->Add(m_rbHexSelected, 0, wxALIGN_LEFT | wxALL, 2);
colsizer->Add(m_rbHexAll , 0, wxALIGN_LEFT | wxALL, 2);
sizer->Add(colsizer, 0, wxALIGN_LEFT | wxALL, 5 );
box = new wxStaticBox(this, -1, wxT("Include:"));
colsizer = new wxStaticBoxSizer(box, wxVERTICAL );
colsizer->Add(m_chbInclStructs , 0, wxALIGN_LEFT | wxALL, 2);
colsizer->Add(m_chbInclUnits , 0, wxALIGN_LEFT | wxALL, 2);
colsizer->Add(m_chbInclResources, 0, wxALIGN_LEFT | wxALL, 2);
colsizer->Add(m_chbInclTurnNoAcl, 0, wxALIGN_LEFT | wxALL, 2);
sizer->Add(colsizer, 0, wxALIGN_LEFT | wxALL, 5 );
topsizer->Add(sizer, 0, wxALIGN_CENTER );
sizer = new wxBoxSizer( wxHORIZONTAL );
sizer->Add(m_btnOk , 0, wxALIGN_CENTER | wxALL, 5);
sizer->Add(m_btnCancel , 0, wxALIGN_CENTER | wxALL, 5);
topsizer->Add(sizer, 0, wxALIGN_CENTER | wxALL, 10 );
SetAutoLayout( TRUE ); // tell dialog to use sizer
SetSizer( topsizer ); // actually set the sizer
topsizer->Fit( this ); // set size to minimum size as calculated by the sizer
topsizer->SetSizeHints( this ); // set size hints to honour mininum size}
m_tcFName->SetFocus();
m_btnOk->SetDefault();
CResizableDlg::SetSize();
}
示例11: wxListBox
CShowDescriptionListDlg::CShowDescriptionListDlg(wxWindow * parent, const char * title, CCollection * items)
:CResizableDlg( parent, wxString::FromUTF8(title), SZ_SECT_WND_DESCR_LIST)
{
long i;
CBaseObject * pObj;
wxButton * pBtnView;
wxButton * pBtnStoreSize;
wxButton * pBtnSave;
m_pItems = items;
m_pList = new wxListBox(this, -1, wxDefaultPosition, wxDefaultSize,
0, NULL, wxLB_SINGLE | wxLB_NEEDED_SB );
for (i=0; i<items->Count(); i++)
{
pObj = (CBaseObject * )items->At(i);
m_pList->Append(wxString::FromAscii(pObj->Name.GetData()), (void *)i);
}
wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
pBtnView = new wxButton (this, wxID_OK , wxT("View") );
pBtnStoreSize = new wxButton (this, wxID_CANCEL, wxT("Done") );
pBtnSave = new wxButton (this, wxID_SAVE , wxT("Save as") );
topsizer->Add( m_pList ,
1, // make vertically stretchable
wxEXPAND | wxALL, // make horizontally stretchable // and make border all around
4 ); // set border width to 10
wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
button_sizer->Add( pBtnView,
0, // make horizontally unstretchable
wxALL, // make border all around (implicit top alignment)
10 ); // set border width to 10
button_sizer->Add( pBtnSave,
0, // make horizontally unstretchable
wxALL, // make border all around (implicit top alignment)
10 ); // set border width to 10
button_sizer->Add( pBtnStoreSize,
0, // make horizontally unstretchable
wxALL, // make border all around (implicit top alignment)
10 ); // set border width to 10
topsizer->Add( button_sizer,
0, // make vertically unstretchable
wxALIGN_CENTER ); // no border and centre horizontally
SetAutoLayout( TRUE ); // tell dialog to use sizer
SetSizer( topsizer ); // actually set the sizer
topsizer->Fit( this ); // set size to minimum size as calculated by the sizer
topsizer->SetSizeHints( this ); // set size hints to honour mininum size}
m_pList->SetSelection(0);
m_pList->SetFocus();
pBtnView->SetDefault();
CResizableDlg::SetSize();
}
示例12: wxBoxSizer
void wxFbPalette::Create()
{
wxBoxSizer *top_sizer = new wxBoxSizer( wxVERTICAL );
#ifdef USE_FLATNOTEBOOK
long nbStyle;
wxConfigBase* config = wxConfigBase::Get();
config->Read( wxT( "/palette/notebook_style" ), &nbStyle, wxFNB_NO_X_BUTTON | wxFNB_NO_NAV_BUTTONS | DRAG_OPTION | wxFNB_DROPDOWN_TABS_LIST | wxFNB_VC8 | wxFNB_CUSTOM_DLG );
m_notebook = new wxFlatNotebook( this, -1, wxDefaultPosition, wxDefaultSize, FNB_STYLE_OVERRIDES( nbStyle ) );
m_notebook->SetCustomizeOptions( wxFNB_CUSTOM_TAB_LOOK | wxFNB_CUSTOM_ORIENTATION | wxFNB_CUSTOM_LOCAL_DRAG );
#else
m_notebook = new wxAuiNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_TOP | wxAUI_NB_SCROLL_BUTTONS );
m_notebook->SetArtProvider( new AuiTabArt() );
#endif
unsigned int pkg_count = AppData()->GetPackageCount();
LogDebug( wxT( "[Palette] Pages %d" ), pkg_count );
#ifdef USE_FLATNOTEBOOK
// Populate icon vector
for ( unsigned int j = 0; j < pkg_count;j++ )
{
PObjectPackage pkg = AppData()->GetPackage( j );
m_icons.Add( pkg->GetPackageIcon() );
}
// Add icons to notebook
m_notebook->SetImageList( &m_icons );
#else
wxSize minsize;
#endif
for ( unsigned int i = 0; i < pkg_count;i++ )
{
PObjectPackage pkg = AppData()->GetPackage( i );
wxString pkg_name = pkg->GetPackageName();
wxPanel *panel = new wxPanel( m_notebook, -1 );
//panel->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) );
wxBoxSizer *sizer = new wxBoxSizer( wxHORIZONTAL );
#if wxVERSION_NUMBER >= 2900
wxAuiToolBar *toolbar = new wxAuiToolBar( panel, -1, wxDefaultPosition, wxDefaultSize, wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_OVERFLOW | wxNO_BORDER );
toolbar->SetToolBitmapSize( wxSize( 22, 22 ) );
PopulateToolbar( pkg, toolbar );
m_tv.push_back( toolbar );
sizer->Add( toolbar, 1, wxEXPAND, 0 );
#else
wxPanel *tbPanel = new wxPanel( panel, -1 );
//tbPanel->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) );
wxBoxSizer *tbSizer = new wxBoxSizer( wxHORIZONTAL );
wxPanel *sbPanel = new wxPanel( panel, -1 );
//sbPanel->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) );
wxBoxSizer *sbSizer = new wxBoxSizer( wxHORIZONTAL );
wxToolBar *toolbar = new wxToolBar( tbPanel, -1, wxDefaultPosition, wxDefaultSize, wxTB_NODIVIDER | wxTB_FLAT );
toolbar->SetToolBitmapSize( wxSize( 22, 22 ) );
//toolbar->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) );
PopulateToolbar( pkg, toolbar );
m_tv.push_back( toolbar );
tbSizer->Add( toolbar, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL );
tbPanel->SetSizer( tbSizer );
wxSpinButton *sb = new wxSpinButton( sbPanel, -1, wxDefaultPosition, wxDefaultSize, wxSP_HORIZONTAL );
sb->SetRange( 0, ( int )pkg->GetObjectCount() - 1 );
sb->SetValue( 0 );
m_posVector.push_back( 0 );
sbSizer->Add( sb, 0, wxEXPAND );//wxALL | wxALIGN_TOP, 0);
sbPanel->SetSizer( sbSizer );
sizer->Add( tbPanel, 1, wxEXPAND, 0 );
sizer->Add( sbPanel, 0, wxEXPAND, 0 );
#endif
panel->SetAutoLayout( true );
panel->SetSizer( sizer );
sizer->Fit( panel );
sizer->SetSizeHints( panel );
#ifndef USE_FLATNOTEBOOK
wxSize cursize = panel->GetSize();
if( cursize.x > minsize.x ) minsize.x = cursize.x;
if( cursize.y > minsize.y ) minsize.y = cursize.y + 30;
#endif
m_notebook->AddPage( panel, pkg_name, false, i );
#ifndef USE_FLATNOTEBOOK
m_notebook->SetPageBitmap( i, pkg->GetPackageIcon() );
#endif
}
//Title *title = new Title( this, wxT("Component Palette") );
//top_sizer->Add(title,0,wxEXPAND,0);
#ifdef USE_FLATNOTEBOOK
top_sizer->Add( m_notebook, 1, wxEXPAND, 0 );
//.........这里部分代码省略.........
示例13: wxPanel
//.........这里部分代码省略.........
wxFlexGridSizer* sizer = new wxFlexGridSizer(3);
wxStaticText* callsignLabel = new wxStaticText(this, -1, _("Callsign"));
sizer->Add(callsignLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE);
wxString call = callsign;
call.Append(wxT(" "));
call.Truncate(LONG_CALLSIGN_LENGTH);
m_callsign = new CCallsignTextCtrl(this, -1, call.Left(LONG_CALLSIGN_LENGTH - 1U).Trim(), wxDefaultPosition, wxSize(CALLSIGN_WIDTH, -1));
m_callsign->SetMaxLength(LONG_CALLSIGN_LENGTH - 1U);
sizer->Add(m_callsign, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
m_suffix = new wxChoice(this, -1, wxDefaultPosition, wxSize(SUFFIX_WIDTH, -1));
#if defined(__WXDEBUG__)
m_suffix->Append(wxT(" "));
#endif
m_suffix->Append(wxT("A"));
m_suffix->Append(wxT("B"));
m_suffix->Append(wxT("C"));
m_suffix->Append(wxT("D"));
m_suffix->Append(wxT("E"));
sizer->Add(m_suffix, 0, wxALL, BORDER_SIZE);
wxString suffix = callsign.Right(1U);
bool res = m_suffix->SetStringSelection(suffix);
if (!res)
m_suffix->SetStringSelection(wxT("B"));
wxStaticText* gatewayLabel = new wxStaticText(this, -1, _("Gateway"));
sizer->Add(gatewayLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE);
call = gateway;
call.Append(wxT(" "));
call.Truncate(LONG_CALLSIGN_LENGTH);
m_gateway = new CCallsignTextCtrl(this, -1, call.Left(LONG_CALLSIGN_LENGTH - 1U).Trim(), wxDefaultPosition, wxSize(CALLSIGN_WIDTH, -1));
m_gateway->SetMaxLength(LONG_CALLSIGN_LENGTH - 1U);
sizer->Add(m_gateway, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
wxStaticText* gLabel = new wxStaticText(this, -1, wxT("G"));
sizer->Add(gLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
wxStaticText* modeLabel = new wxStaticText(this, -1, _("Mode"));
sizer->Add(modeLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE);
m_mode = new wxChoice(this, CHOICE_MODE, wxDefaultPosition, wxSize(CALLSIGN_WIDTH, -1));
m_mode->Append(_("Duplex"));
m_mode->Append(_("Simplex"));
m_mode->Append(_("Gateway"));
m_mode->Append(_("TX Only"));
m_mode->Append(_("RX Only"));
m_mode->Append(_("TX and RX"));
sizer->Add(m_mode, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
m_mode->SetSelection(int(mode));
wxStaticText* dummy1 = new wxStaticText(this, -1, wxEmptyString);
sizer->Add(dummy1, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
wxStaticText* ackLabel = new wxStaticText(this, -1, _("Ack"));
sizer->Add(ackLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE);
m_ack = new wxChoice(this, -1, wxDefaultPosition, wxSize(CALLSIGN_WIDTH, -1));
m_ack->Append(_("Off"));
m_ack->Append(wxT("BER"));
m_ack->Append(_("Status"));
sizer->Add(m_ack, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
m_ack->SetSelection(int(ack));
wxStaticText* dummy2 = new wxStaticText(this, -1, wxEmptyString);
sizer->Add(dummy2, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
wxStaticText* restrictionLabel = new wxStaticText(this, -1, _("Restrict"));
sizer->Add(restrictionLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE);
m_restriction = new wxChoice(this, -1, wxDefaultPosition, wxSize(CALLSIGN_WIDTH, -1));
m_restriction->Append(_("Off"));
m_restriction->Append(_("On"));
sizer->Add(m_restriction, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
m_restriction->SetSelection(restriction ? 1 : 0);
wxStaticText* dummy3 = new wxStaticText(this, -1, wxEmptyString);
sizer->Add(dummy3, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
wxStaticText* rpt1ValidationLabel = new wxStaticText(this, -1, _("RPT1 Validation"));
sizer->Add(rpt1ValidationLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE);
m_rpt1Validation = new wxChoice(this, -1, wxDefaultPosition, wxSize(CALLSIGN_WIDTH, -1));
m_rpt1Validation->Append(_("Off"));
m_rpt1Validation->Append(_("On"));
sizer->Add(m_rpt1Validation, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
m_rpt1Validation->SetSelection(rpt1Validation ? 1 : 0);
SetAutoLayout(true);
sizer->Fit(this);
sizer->SetSizeHints(this);
SetSizer(sizer);
}
示例14: wxDialog
//.........这里部分代码省略.........
root_flexgridsizer->Add( user_name_staticboxsizer, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
wxStaticBox *location_on_handheld_staticbox = new wxStaticBox( this, -1, _( "Location on handheld" ) );
wxStaticBoxSizer *location_on_handheld_staticboxsizer = new wxStaticBoxSizer( location_on_handheld_staticbox, wxVERTICAL );
wxStaticText *install_to_statictext = new wxStaticText( this, -1, _( "On the handheld, send the files to:" ), wxDefaultPosition, wxDefaultSize, 0 );
location_on_handheld_staticboxsizer->Add( install_to_statictext, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
wxFlexGridSizer *ram_or_card_flexgridsizer = new wxFlexGridSizer( 2, 0, 5 );
ram_or_card_flexgridsizer->AddGrowableCol( 2 );
ram_or_card_flexgridsizer->AddGrowableRow( 0 );
ram_or_card_flexgridsizer->AddGrowableRow( 1 );
ram_or_card_flexgridsizer->AddGrowableRow( 2 );
ram_or_card_flexgridsizer->Add( 20, 20, 0, wxALIGN_CENTRE|wxALL, 0 );
m_install_to_ram_radiobutton = new wxRadioButton( this, ID_INSTALL_TO_RAM_RADIOBUTTON, _( "The handheld's RAM memory" ), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
ram_or_card_flexgridsizer->Add( m_install_to_ram_radiobutton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxBOTTOM, 5 );
ram_or_card_flexgridsizer->Add( 20, 20, 0, wxALIGN_CENTRE|wxALL, 0 );
m_install_to_sd_card_radiobutton = new wxRadioButton( this, ID_INSTALL_TO_SD_CARD_RADIOBUTTON, _( "The removable SD/MMC card" ), wxDefaultPosition, wxDefaultSize, 0 );
ram_or_card_flexgridsizer->Add( m_install_to_sd_card_radiobutton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxBOTTOM, 5 );
ram_or_card_flexgridsizer->Add( 20, 20, 0, wxALIGN_CENTRE|wxALL, 0 );
m_install_to_memory_stick_radiobutton = new wxRadioButton( this, ID_INSTALL_TO_MEMORY_STICK_RADIOBUTTON, _( "The removable Memory Stick"), wxDefaultPosition, wxDefaultSize, 0 );
ram_or_card_flexgridsizer->Add( m_install_to_memory_stick_radiobutton , 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxBOTTOM, 5 );
ram_or_card_flexgridsizer->Add( 20, 20, 0, wxALIGN_CENTRE|wxALL, 0 );
m_install_to_compact_flash_radiobutton = new wxRadioButton( this, ID_INSTALL_TO_COMPACT_FLASH_RADIOBUTTON, _( "The removable CompactFlash card"), wxDefaultPosition, wxDefaultSize, 0 );
ram_or_card_flexgridsizer->Add( m_install_to_compact_flash_radiobutton , 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxBOTTOM, 5 );
location_on_handheld_staticboxsizer->Add( ram_or_card_flexgridsizer, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
wxFlexGridSizer *card_directory_flexgridsizer = new wxFlexGridSizer( 3, 0, 5 );
card_directory_flexgridsizer->AddGrowableCol( 1 );
card_directory_flexgridsizer->AddGrowableRow( 0 );
card_directory_flexgridsizer->Add( 30, 10, 0, wxALIGN_CENTRE|wxALL, 5 );
m_default_card_directory_radiobutton = new wxRadioButton( this, ID_DEFAULT_CARD_DIRECTORY_RADIOBUTTON, _("Send to the default directory on the card"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
card_directory_flexgridsizer->Add( m_default_card_directory_radiobutton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 );
card_directory_flexgridsizer->Add( 1, 1, 0, wxALIGN_CENTRE|wxALL, 5 );
card_directory_flexgridsizer->Add( 30, 10, 0, wxALIGN_CENTRE|wxALL, 5 );
m_specified_card_directory_radiobutton = new wxRadioButton( this, ID_SPECIFIED_CARD_DIRECTORY_RADIOBUTTON, _("Send to this specified directory on the card:"), wxDefaultPosition, wxDefaultSize, 0 );
card_directory_flexgridsizer->Add( m_specified_card_directory_radiobutton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
m_directory_on_card_textctrl = new wxTextCtrl( this, ID_DIRECTORY_ON_CARD_TEXTCTRL, wxT( "" ), wxDefaultPosition, wxSize(140,-1), 0 );
card_directory_flexgridsizer->Add( m_directory_on_card_textctrl, 0, wxALIGN_CENTER_VERTICAL, 5 );
location_on_handheld_staticboxsizer->Add( card_directory_flexgridsizer, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
root_flexgridsizer->Add( location_on_handheld_staticboxsizer, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 );
wxBoxSizer *bottom_button_boxsizer = new wxBoxSizer( wxHORIZONTAL );
wxButton *ok_button = new wxButton( this, wxID_OK, _( "OK" ) );
bottom_button_boxsizer->Add( ok_button, 0, wxALIGN_CENTRE|wxALL, 5 );
wxButton *cancel_button= new wxButton( this, wxID_CANCEL, _( "Cancel" ) );
bottom_button_boxsizer->Add( cancel_button, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
wxButton *help_button = new wxButton( this, wxID_HELP_CONTEXT, _( "Help" ) );
bottom_button_boxsizer->Add( help_button, 0, wxALIGN_CENTRE|wxALL, 5 );
root_flexgridsizer->Add( bottom_button_boxsizer, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 0 );
// Do the standard sizer fitting stuff.
SetAutoLayout( TRUE );
SetSizer( root_flexgridsizer );
root_flexgridsizer->SetSizeHints( this );
root_flexgridsizer->Fit( this );
// Center the html tip dialog on its parent.
Centre( wxBOTH | wxCENTER_FRAME );
// Finally, load the array of possible user names into the choice
for ( size_t n = 0; n < user_name_array.GetCount(); n++ )
{
m_user_name_choice->Append( user_name_array.Item( n ) );
}
// And set the selection to the first one
if ( 0 < user_name_array.GetCount() )
{
m_user_name_choice->SetSelection( 0 );
}
// A radiobutton should alway have one value selected. Set RAM radiobutton to TRUE.
m_install_to_ram_radiobutton->SetValue( TRUE );
// Make the directory controls invisible, since not using yet.
// Disabled doesn't really matter
m_default_card_directory_radiobutton->Show( FALSE );
m_specified_card_directory_radiobutton->Show( FALSE );
m_directory_on_card_textctrl->Show( FALSE );
}
示例15: wxDialog
CDStarRepeaterConfigDVRPTR1Set::CDStarRepeaterConfigDVRPTR1Set(wxWindow* parent, int id, const wxString& port, bool rxInvert, bool txInvert, bool channel, unsigned int modLevel, unsigned int txDelay) :
wxDialog(parent, id, wxString(_("DV-RPTR V1 Settings"))),
m_port(NULL),
m_txInvert(NULL),
m_rxInvert(NULL),
m_channel(NULL),
m_modLevel(NULL),
m_txDelay(NULL)
{
wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
wxFlexGridSizer* sizer = new wxFlexGridSizer(2);
wxStaticText* portLabel = new wxStaticText(this, -1, _("Port"));
sizer->Add(portLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
m_port = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1));
sizer->Add(m_port, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
wxArrayString ports = CSerialPortSelector::getDevices();
for (unsigned int i = 0U; i < ports.GetCount(); i++)
m_port->Append(ports.Item(i));
bool found = m_port->SetStringSelection(port);
if (!found)
m_port->SetSelection(0);
wxStaticText* txInvertLabel = new wxStaticText(this, -1, _("TX Inversion"));
sizer->Add(txInvertLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
m_txInvert = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1));
m_txInvert->Append(_("Off"));
m_txInvert->Append(_("On"));
sizer->Add(m_txInvert, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
m_txInvert->SetSelection(txInvert ? 1 : 0);
wxStaticText* rxInvertLabel = new wxStaticText(this, -1, _("RX Inversion"));
sizer->Add(rxInvertLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
m_rxInvert = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1));
m_rxInvert->Append(_("Off"));
m_rxInvert->Append(_("On"));
sizer->Add(m_rxInvert, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
m_rxInvert->SetSelection(rxInvert ? 1 : 0);
wxStaticText* channelLabel = new wxStaticText(this, -1, _("Channel"));
sizer->Add(channelLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
m_channel = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1));
m_channel->Append(_("A / FSK Pin"));
m_channel->Append(_("B / AFSK Pin"));
sizer->Add(m_channel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
m_channel->SetSelection(channel ? 1 : 0);
wxStaticText* modLevelLabel = new wxStaticText(this, -1, _("TX Level (%)"));
sizer->Add(modLevelLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
m_modLevel = new wxSlider(this, -1, modLevel, 0, 100, wxDefaultPosition, wxSize(CONTROL_WIDTH2, -1), wxSL_HORIZONTAL | wxSL_LABELS);
sizer->Add(m_modLevel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
wxStaticText* txDelayLabel = new wxStaticText(this, -1, _("TX Delay (ms)"));
sizer->Add(txDelayLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
m_txDelay = new wxSlider(this, -1, txDelay, 0, 500, wxDefaultPosition, wxSize(CONTROL_WIDTH2, -1), wxSL_HORIZONTAL | wxSL_LABELS);
sizer->Add(m_txDelay, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
topSizer->Add(sizer);
topSizer->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE);
SetAutoLayout(true);
topSizer->Fit(this);
topSizer->SetSizeHints(this);
SetSizer(topSizer);
}