Пример #1
0
EditHouseDialog::EditHouseDialog(wxWindow* parent, Map* map, House* house) :
	wxDialog(parent, wxID_ANY, wxT("House"), wxDefaultPosition, wxSize(250,160)),
	map(map),
	what_house(house)
{
	ASSERT(map);
	ASSERT(house);

	// Create topsizer
	wxSizer* sizer = newd wxBoxSizer(wxVERTICAL);
	wxSizer* tmpsizer;

	house_name = wxstr(house->name);
	house_id = i2ws(house->id);
	house_rent = i2ws(house->rent);

	// House options
	tmpsizer = newd wxStaticBoxSizer(wxHORIZONTAL, this, wxT("Name"));
	name_field = newd wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(230,20), 0, wxTextValidator(wxFILTER_ASCII, &house_name));
	tmpsizer->Add(name_field);
 
	sizer->Add(tmpsizer, wxSizerFlags().Border(wxALL, 20));

	tmpsizer = newd wxStaticBoxSizer(wxHORIZONTAL, this, wxT("Rent / ID"));
	rent_field = newd wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(160,20), 0, wxTextValidator(wxFILTER_NUMERIC, &house_rent));
	tmpsizer->Add(rent_field);
	id_field = newd wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(70,20), 0, wxTextValidator(wxFILTER_NUMERIC, &house_id));
	id_field->Enable(false);
	tmpsizer->Add(id_field);
	sizer->Add(tmpsizer, wxSizerFlags().Border(wxALL, 20));
	
	// House options
	guildhall_field = newd wxCheckBox(this, wxID_ANY, wxT("Guildhall"), wxDefaultPosition);
 
	sizer->Add(guildhall_field, wxSizerFlags().Border(wxRIGHT | wxLEFT | wxBOTTOM, 20));
	guildhall_field->SetValue(house->guildhall);

	// OK/Cancel buttons
	tmpsizer = newd wxBoxSizer(wxHORIZONTAL);
	tmpsizer->Add(newd wxButton(this, wxID_OK, wxT("OK")), wxSizerFlags(1).Center());
	tmpsizer->Add(newd wxButton(this, wxID_CANCEL, wxT("Cancel")), wxSizerFlags(1).Center());
	sizer->Add(tmpsizer, wxSizerFlags(1).Center().Border(wxRIGHT | wxLEFT | wxBOTTOM, 20));

	SetSizerAndFit(sizer);
}
Пример #2
0
/// Normally in classes derived from PrefsPanel this function
/// is used both to populate the panel and to exchange data with it.
/// With KeyConfigPrefs all the exchanges are handled specially,
/// so this is only used in populating the panel.
void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S)
{
   S.SetBorder(2);

   S.StartStatic(_("Key Bindings"), 1);
   {
      S.StartHorizontalLay(wxALIGN_CENTRE, false);
      {
         S.Id(CategoryID);
         mCat = S.AddChoice(_("C&ategory:"),
                            mCats[0],
                            &mCats);
      }
      S.EndHorizontalLay();

      mList = S.Id(CommandsListID).AddListControlReportMode();
      mList->SetName(_("Key Bindings"));

      S.StartThreeColumn();
      {
         if (!mKey) {
            mKey = safenew wxTextCtrl(this,
                                  CurrentComboID,
                                  wxT(""),
                                  wxDefaultPosition,
#if defined(__WXMAC__)
                                  wxSize(300, -1));
#else
                                  wxSize(210, -1));
#endif
            mKey->Connect(wxEVT_KEY_DOWN,
                          wxKeyEventHandler(KeyConfigPrefs::OnCaptureKeyDown));
            mKey->Connect(wxEVT_CHAR,
                          wxKeyEventHandler(KeyConfigPrefs::OnCaptureChar));
         }
         S.AddWindow(mKey);

         /* i18n-hint: (verb)*/
         S.Id(SetButtonID).AddButton(_("Set"));
         S.Id(ClearButtonID).AddButton(_("Cl&ear"));
      }
      S.EndThreeColumn();

#if defined(__WXMAC__)
      S.AddFixedText(_("Note: Pressing Cmd+Q will quit. All other keys are valid."));
#endif

      S.StartThreeColumn();
      {
         S.Id(ImportButtonID).AddButton(_("&Import..."));
         S.Id(ExportButtonID).AddButton(_("&Export..."));
         S.Id(AssignDefaultsButtonID).AddButton(_("&Defaults"));
      }
      S.EndThreeColumn();
   }
Пример #3
0
DatDebugView::DatDebugView(wxWindow* parent) : wxPanel(parent)
{
    wxSizer* sizer = newd wxBoxSizer(wxVERTICAL);

    search_field = newd wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize);
    search_field->SetFocus();
    sizer->Add(search_field, 0, wxEXPAND, 2);

    item_list = newd DatDebugViewListBox(this, wxID_ANY);
    item_list->SetMinSize(wxSize(470, 400));
    sizer->Add(item_list, 1, wxEXPAND | wxALL, 2);

    SetSizerAndFit(sizer);
}
Пример #4
0
void GUI::ShowTextBox(wxWindow* parent, wxString title, wxString content)
{
	wxDialog* dlg = newd wxDialog(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, wxRESIZE_BORDER | wxCAPTION | wxCLOSE_BOX);
	wxSizer* topsizer = newd wxBoxSizer(wxVERTICAL);
	wxTextCtrl* text_field = newd wxTextCtrl(dlg, wxID_ANY, content, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY);
	text_field->SetMinSize(wxSize(400, 550));
	topsizer->Add(text_field, wxSizerFlags(5).Expand());

	wxSizer* choicesizer = newd wxBoxSizer(wxHORIZONTAL);
	choicesizer->Add(newd wxButton(dlg, wxID_CANCEL, wxT("OK")), wxSizerFlags(1).Center());
	topsizer->Add(choicesizer, wxSizerFlags(0).Center());
	dlg->SetSizerAndFit(topsizer);

	dlg->ShowModal();
}
Пример #5
0
CRefSelDlg::CRefSelDlg(wxWindow* pParent, wxString wxRefType) : wxDialog(pParent, wxID_ANY, wxT("Ref Select"), wxDefaultPosition, wxSize(600, 300), wxDEFAULT_DIALOG_STYLE|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxRESIZE_BORDER)
{
	m_pTextCtrl = ZION_NEW wxTextCtrl(this, ID_REF_TEXT, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_LEFT);

	wxBoxSizer* pSizer2 = ZION_NEW wxBoxSizer(wxHORIZONTAL);
	pSizer2->AddStretchSpacer();
	pSizer2->Add(ZION_NEW wxButton(this, wxID_OK, wxT("Confirm")), 0, wxALIGN_RIGHT | wxALL, 5);
	pSizer2->Add(ZION_NEW wxButton(this, wxID_CANCEL, wxT("Cancel")), 0, wxALIGN_RIGHT | wxALL, 5);

	wxBoxSizer* pSizer1 = ZION_NEW wxBoxSizer(wxVERTICAL);
	pSizer1->Add(m_pTextCtrl, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
	m_pUUIDList = ZION_NEW wxListCtrl(this, ID_REF_LIST, wxDefaultPosition, wxDefaultSize, wxLC_REPORT);
	pSizer1->Add(m_pUUIDList, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

	pSizer1->Add(pSizer2, 0, wxGROW|wxALIGN_CENTER_VERTICAL);
	SetSizer(pSizer1);

	m_strRefType = wxRefType;
	m_pUUIDList->InsertColumn(0, wxT("Name"), 0, 120);
	m_pUUIDList->InsertColumn(1, wxT("UUID"), 0, 800);

	AppendItem(m_strRefType);
}
Пример #6
0
void TreeGeneratorFrame::createWxCtrls()
{
	// menu
	SetIcon(wxIcon(L"./Assets/Icons/Zee.xpm", wxBITMAP_TYPE_XPM));

	wxMenu* menuFile = New wxMenu;
	menuFile->Append(ID_MENU_OPEN, L"&Open");
	menuFile->Append(ID_MENU_SAVE, L"&Save");

	wxMenuBar* menuBar = New wxMenuBar;
	menuBar->Append(menuFile, L"&File");

	SetMenuBar(menuBar);

	// wnd
	wxBoxSizer* boxSizer1 = New wxBoxSizer(wxHORIZONTAL);

	// left
	mCtrlsPanel = New wxScrolledWindow(this, -1, wxDefaultPosition, wxDefaultSize, wxVSCROLL);
	mCtrlsPanel->SetScrollRate(0, 5);

	wxBoxSizer* boxSizer2 = New wxBoxSizer(wxVERTICAL);

	// -- generalParams
	mPanelGeneralParams = New wxCollapsiblePane(mCtrlsPanel, ID_GENERAL_PARAMS, L"General Params");
	wxWindow* generalParamsWnd = mPanelGeneralParams->GetPane();

	wxFlexGridSizer* fgSizer1 = New wxFlexGridSizer(2, 2, 0, 0);
	fgSizer1->SetFlexibleDirection(wxBOTH);
	fgSizer1->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);

	wxStaticText* textLevels = New wxStaticText(generalParamsWnd, -1, L"Levels");
	mSpinLevels = New wxSpinCtrl(generalParamsWnd, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 
		wxSP_ARROW_KEYS, 0, 5, 1);

	wxStaticText* textScale = New wxStaticText(generalParamsWnd, -1, L"Scale");
	mTextScale = New wxTextCtrl(generalParamsWnd, -1, L"10.0", wxDefaultPosition, wxDefaultSize, 0, 
		wxTextValidator(wxFILTER_NUMERIC));

	wxStaticText* textScaleV = New wxStaticText(generalParamsWnd, -1, L"ScaleV");
	mTextScaleV = New wxTextCtrl(generalParamsWnd, -1, L"0", wxDefaultPosition, wxDefaultSize, 0, 
		wxTextValidator(wxFILTER_NUMERIC));

	wxStaticText* textBaseSize = New wxStaticText(generalParamsWnd, -1, L"BaseSize");
	mTextBaseSize = New wxTextCtrl(generalParamsWnd, -1, L"0", wxDefaultPosition, wxDefaultSize, 0, 
		wxTextValidator(wxFILTER_NUMERIC));

	wxStaticText* textRadiusRatio = New wxStaticText(generalParamsWnd, -1, L"RadiusRatio");
	mTextRadiusRatio = New wxTextCtrl(generalParamsWnd, -1, L"0.02", wxDefaultPosition, wxDefaultSize, 0, 
		wxTextValidator(wxFILTER_NUMERIC));

	wxStaticText* textRatioPower = New wxStaticText(generalParamsWnd, -1, L"RatioPower");
	mTextRatioPower = New wxTextCtrl(generalParamsWnd, -1, L"1", wxDefaultPosition, wxDefaultSize, 0, 
		wxTextValidator(wxFILTER_NUMERIC));

	wxStaticText* textShape = New wxStaticText(generalParamsWnd, -1, L"Shape");
	mSpinShape = New wxSpinCtrl(generalParamsWnd, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 
		wxSP_ARROW_KEYS, 0, 10, 0);

	wxStaticText* textBaseSplits = New wxStaticText(generalParamsWnd, -1, L"BaseSplits");
	mSpinBaseSplits = New wxSpinCtrl(generalParamsWnd, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 
		wxSP_ARROW_KEYS, 0, 10, 0);

	fgSizer1->Add(textLevels, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer1->Add(mSpinLevels, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer1->Add(textScale, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer1->Add(mTextScale, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer1->Add(textScaleV, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer1->Add(mTextScaleV, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer1->Add(textBaseSize, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer1->Add(mTextBaseSize, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer1->Add(textRadiusRatio, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer1->Add(mTextRadiusRatio, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer1->Add(textRatioPower, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer1->Add(mTextRatioPower, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer1->Add(textShape, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer1->Add(mSpinShape, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer1->Add(textBaseSplits, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer1->Add(mSpinBaseSplits, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	generalParamsWnd->SetSizer(fgSizer1);
	generalParamsWnd->Layout();
	generalParamsWnd->Fit();

	// -- LevelParams
	mPanelLevelParmas0 = New wxCollapsiblePane(mCtrlsPanel, ID_GENERAL_PARAMS, L"Level Params");
	wxWindow* levelParamsWnd = mPanelLevelParmas0->GetPane();

	wxFlexGridSizer* fgSizer2 = New wxFlexGridSizer(2, 2, 0, 0);
	fgSizer2->SetFlexibleDirection(wxBOTH);
	fgSizer2->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);

	wxStaticText* textLevel = New wxStaticText(levelParamsWnd, -1, L"Level");
	//mSpinLevel = new wxSpinCtrl(levelParamsWnd0, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 
	//	wxSP_ARROW_KEYS, 0, 10, 0);
	wxArrayString choices;
	choices.Add(wxT("0"));
	mChoiceLevel = New wxChoice(levelParamsWnd, -1, wxDefaultPosition, wxDefaultSize, choices);
	mChoiceLevel->SetSelection(0);
	mSelectedLevel = 0;

	wxStaticText* textSegSegsW = New wxStaticText(levelParamsWnd, -1, L"SegSegsW");
	mSpinSegSegsW = New wxSpinCtrl(levelParamsWnd, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 
		wxSP_ARROW_KEYS, 0, 100, 8);

	wxStaticText* textSegSegsH = New wxStaticText(levelParamsWnd, -1, L"SegSegsH");
	mSpinSegSegsH = New wxSpinCtrl(levelParamsWnd, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 
		wxSP_ARROW_KEYS, 0, 100, 4);

	wxStaticText* textLength = New wxStaticText(levelParamsWnd, -1, L"Length");
	mTextLength = New wxTextCtrl(levelParamsWnd, -1, L"1.0", wxDefaultPosition, wxDefaultSize, 0, 
		wxTextValidator(wxFILTER_NUMERIC));

	wxStaticText* textLengthV = New wxStaticText(levelParamsWnd, -1, L"LengthV");
	mTextLengthV = New wxTextCtrl(levelParamsWnd, -1, L"0", wxDefaultPosition, wxDefaultSize, 0, 
		wxTextValidator(wxFILTER_NUMERIC));

	wxStaticText* textTaper = New wxStaticText(levelParamsWnd, -1, L"Taper");
	mTextTaper = New wxTextCtrl(levelParamsWnd, -1, L"1", wxDefaultPosition, wxDefaultSize, 0, 
		wxTextValidator(wxFILTER_NUMERIC));

	wxStaticText* textCurveRes = New wxStaticText(levelParamsWnd, -1, L"CurveRes");
	mSpinCurveRes = New wxSpinCtrl(levelParamsWnd, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 
		wxSP_ARROW_KEYS, 0, 100, 3);

	wxStaticText* textCurve = New wxStaticText(levelParamsWnd, -1, L"Curve");
	mTextCurve = New wxTextCtrl(levelParamsWnd, -1, L"0", wxDefaultPosition, wxDefaultSize, 0, 
		wxTextValidator(wxFILTER_NUMERIC));

	wxStaticText* textCurveV = New wxStaticText(levelParamsWnd, -1, L"CurveV");
	mTextCurveV = New wxTextCtrl(levelParamsWnd, -1, L"0", wxDefaultPosition, wxDefaultSize, 0, 
		wxTextValidator(wxFILTER_NUMERIC));

	wxStaticText* textCurveBack = New wxStaticText(levelParamsWnd, -1, L"CurveBack");
	mTextCurveBack = New wxTextCtrl(levelParamsWnd, -1, L"0", wxDefaultPosition, wxDefaultSize, 0, 
		wxTextValidator(wxFILTER_NUMERIC));

	wxStaticText* textSegSplits = New wxStaticText(levelParamsWnd, -1, L"SegSplits");
	mTextSegSplits = New wxTextCtrl(levelParamsWnd, -1, L"0", wxDefaultPosition, wxDefaultSize, 0, 
		wxTextValidator(wxFILTER_NUMERIC));

	wxStaticText* textSplitAngle = New wxStaticText(levelParamsWnd, -1, L"SplitAngle");
	mTextSplitAngle = New wxTextCtrl(levelParamsWnd, -1, L"0", wxDefaultPosition, wxDefaultSize, 0, 
		wxTextValidator(wxFILTER_NUMERIC));

	wxStaticText* textSplitAngleV = New wxStaticText(levelParamsWnd, -1, L"SplitAngleV");
	mTextSplitAngleV = New wxTextCtrl(levelParamsWnd, -1, L"0", wxDefaultPosition, wxDefaultSize, 0, 
		wxTextValidator(wxFILTER_NUMERIC));

	wxStaticText* textBranches = New wxStaticText(levelParamsWnd, -1, L"Branches");
	mSpinBranches = New wxSpinCtrl(levelParamsWnd, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 
		wxSP_ARROW_KEYS, 0, 100, 0);

	wxStaticText* textDownAngle = New wxStaticText(levelParamsWnd, -1, L"DownAngle");
	mTextDownAngle = New wxTextCtrl(levelParamsWnd, -1, L"0", wxDefaultPosition, wxDefaultSize, 0, 
		wxTextValidator(wxFILTER_NUMERIC));

	wxStaticText* textDownAngleV = New wxStaticText(levelParamsWnd, -1, L"DownAngleV");
	mTextDownAngleV = New wxTextCtrl(levelParamsWnd, -1, L"0", wxDefaultPosition, wxDefaultSize, 0, 
		wxTextValidator(wxFILTER_NUMERIC));

	wxStaticText* textRotateAngle = New wxStaticText(levelParamsWnd, -1, L"RotateAngle");
	mTextRotateAngle = New wxTextCtrl(levelParamsWnd, -1, L"0", wxDefaultPosition, wxDefaultSize, 0, 
		wxTextValidator(wxFILTER_NUMERIC));

	wxStaticText* textRotateAngleV = New wxStaticText(levelParamsWnd, -1, L"RotateAngleV");
	mTextRotateAngleV = New wxTextCtrl(levelParamsWnd, -1, L"0", wxDefaultPosition, wxDefaultSize, 0, 
		wxTextValidator(wxFILTER_NUMERIC));


	fgSizer2->Add(textLevel, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer2->Add(mChoiceLevel, 0, wxALL | wxALIGN_CENTER_VERTICAL | wxEXPAND, 5);

	fgSizer2->Add(textSegSegsW, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer2->Add(mSpinSegSegsW, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer2->Add(textSegSegsH, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer2->Add(mSpinSegSegsH, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer2->Add(textLength, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer2->Add(mTextLength, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer2->Add(textLengthV, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer2->Add(mTextLengthV, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer2->Add(textTaper, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer2->Add(mTextTaper, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer2->Add(textCurveRes, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer2->Add(mSpinCurveRes, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer2->Add(textCurve, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer2->Add(mTextCurve, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer2->Add(textCurveV, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer2->Add(mTextCurveV, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer2->Add(textCurveBack, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer2->Add(mTextCurveBack, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer2->Add(textSegSplits, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer2->Add(mTextSegSplits, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer2->Add(textSplitAngle, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer2->Add(mTextSplitAngle, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer2->Add(textSplitAngleV, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer2->Add(mTextSplitAngleV, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer2->Add(textBranches, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer2->Add(mSpinBranches, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer2->Add(textDownAngle, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer2->Add(mTextDownAngle, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer2->Add(textDownAngleV, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer2->Add(mTextDownAngleV, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer2->Add(textRotateAngle, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer2->Add(mTextRotateAngle, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	fgSizer2->Add(textRotateAngleV, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
	fgSizer2->Add(mTextRotateAngleV, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

	levelParamsWnd->SetSizer(fgSizer2);
	levelParamsWnd->Layout();
	levelParamsWnd->Fit();

	// button
	mButtonGenerate = New wxButton(mCtrlsPanel, ID_BUTTON_GENERATE, L"Generate");

	boxSizer2->Add(mPanelGeneralParams, 0, wxALL, 5);
	boxSizer2->Add(mPanelLevelParmas0, 0, wxALL, 5);
	boxSizer2->Add(mButtonGenerate, 0, wxALL, 5);

	mCtrlsPanel->SetSizer(boxSizer2);
	mCtrlsPanel->SetMinSize(wxSize(240, 600));
	mCtrlsPanel->FitInside();
	mCtrlsPanel->Layout();

	// right
	mCanvasPanel = New wxPanel(this, -1);
	mCanvasPanel->SetMinSize(wxSize(480, 600));

	boxSizer1->Add(mCtrlsPanel, 0, wxALL, 5);
	boxSizer1->Add(mCanvasPanel, 0, wxALL, 5);

	this->SetSizer(boxSizer1);
	this->Layout();
	this->Fit();

	mSpinLevels->Connect(wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(TreeGeneratorFrame::OnSpinLevels), NULL, this);
	mChoiceLevel->Connect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(TreeGeneratorFrame::OnChoiceLevel), NULL, this);
}
Пример #7
0
/// Normally in classes derived from PrefsPanel this function
/// is used both to populate the panel and to exchange data with it.
/// With KeyConfigPrefs all the exchanges are handled specially,
/// so this is only used in populating the panel.
void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S)
{
   S.SetBorder(2);

   S.StartStatic(_("Key Bindings"), 1);
   {
      S.StartMultiColumn(3, wxEXPAND);
      {
         S.SetStretchyCol(1);

         S.StartHorizontalLay(wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 0);
         {
            S.AddTitle(_("View by:"));
            S.StartRadioButtonGroup(wxT("/Prefs/KeyConfig/ViewBy"), wxT("tree"));
            {
               mViewByTree = S.Id(ViewByTreeID).TieRadioButton(_("&Tree"), wxT("tree"));
               mViewByTree->SetName(_("View by tree"));
               mViewByName = S.Id(ViewByNameID).TieRadioButton(_("&Name"), wxT("name"));
               mViewByName->SetName(_("View by name"));
               mViewByKey = S.Id(ViewByKeyID).TieRadioButton(_("&Key"), wxT("key"));
               mViewByKey->SetName(_("View by key"));
            }
            S.EndRadioButtonGroup();
         }
         S.EndHorizontalLay();

         S.StartHorizontalLay(wxALIGN_CENTER|wxALIGN_CENTER_VERTICAL, 0);
         {
            // just a spacer
         }
         S.EndHorizontalLay();

         S.StartHorizontalLay(wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 0);
         {
            mFilterLabel = S.AddVariableText(_("Searc&h:"));

            if (!mFilter) {
               mFilter = safenew wxTextCtrl(this,
                                        FilterID,
                                        wxT(""),
                                        wxDefaultPosition,
#if defined(__WXMAC__)
                                        wxSize(300, -1),
#else
                                        wxSize(210, -1),
#endif
                                        wxTE_PROCESS_ENTER);
               mFilter->SetName(wxStripMenuCodes(mFilterLabel->GetLabel()));
               mFilter->Connect(wxEVT_KEY_DOWN,
                                wxKeyEventHandler(KeyConfigPrefs::OnFilterKeyDown),
                                NULL,
                                this);
               mFilter->Connect(wxEVT_CHAR,
                                wxKeyEventHandler(KeyConfigPrefs::OnFilterChar),
                                NULL,
                                this);
            }
            S.AddWindow(mFilter, wxALIGN_NOT | wxALIGN_LEFT);
         }
         S.EndHorizontalLay();
      }
      S.EndThreeColumn();
      S.AddSpace(-1, 2);

      S.StartHorizontalLay(wxEXPAND, 1);
      {
         if (!mView) {
            mView = safenew KeyView(this, CommandsListID);
            mView->SetName(_("Bindings"));
         }
         S.Prop(true);
         S.AddWindow(mView, wxEXPAND);
      }
      S.EndHorizontalLay();

      S.StartThreeColumn();
      {
         if (!mKey) {
            mKey = safenew wxTextCtrl(this,
                                  CurrentComboID,
                                  wxT(""),
                                  wxDefaultPosition,
#if defined(__WXMAC__)
                                  wxSize(300, -1),
#else
                                  wxSize(210, -1),
#endif
                                  wxTE_PROCESS_ENTER);

            mKey->SetName(_("Short cut"));
            mKey->Connect(wxEVT_KEY_DOWN,
                          wxKeyEventHandler(KeyConfigPrefs::OnHotkeyKeyDown),
                          NULL,
                          this);
            mKey->Connect(wxEVT_CHAR,
                          wxKeyEventHandler(KeyConfigPrefs::OnHotkeyChar),
                          NULL,
                          this);
            mKey->Connect(wxEVT_KILL_FOCUS,
                          wxFocusEventHandler(KeyConfigPrefs::OnHotkeyKillFocus),
                          NULL,
                          this);
         }
         S.AddWindow(mKey);

         /* i18n-hint: (verb)*/
         mSet = S.Id(SetButtonID).AddButton(_("&Set"));
         mClear = S.Id(ClearButtonID).AddButton(_("Cl&ear"));
      }
      S.EndThreeColumn();

#if defined(__WXMAC__)
      S.AddFixedText(_("Note: Pressing Cmd+Q will quit. All other keys are valid."));
#endif

      S.StartThreeColumn();
      {
         S.Id(ImportButtonID).AddButton(_("&Import..."));
         S.Id(ExportButtonID).AddButton(_("&Export..."));
         S.Id(AssignDefaultsButtonID).AddButton(_("&Defaults"));
      }
      S.EndThreeColumn();
   }
   S.EndStatic();


   // Need to layout so that the KeyView is properly sized before populating.
   // Otherwise, the initial selection is not scrolled into view.
   Layout();
}