Exemplo n.º 1
0
ItemEditorFrameUI::~ItemEditorFrameUI()
{
	// Disconnect Events
	m_ItemListCtrl->Disconnect( wxEVT_COMMAND_LIST_COL_CLICK, wxListEventHandler( ItemEditorFrameUI::OnItemListColClick ), NULL, this );
	m_ItemListCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( ItemEditorFrameUI::OnItemListDeselected ), NULL, this );
	m_ItemListCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, wxListEventHandler( ItemEditorFrameUI::OnItemListRightClick ), NULL, this );
	m_ItemListCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( ItemEditorFrameUI::OnItemListSelected ), NULL, this );
	m_ItemTypeChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( ItemEditorFrameUI::OnItemTypeChoice ), NULL, this );
	m_NewItemButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnNewItemButton ), NULL, this );
	m_ModifyButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnModifyItem ), NULL, this );
	m_ItemNameTextCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_ItemNameTextCtrl->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_CDTimeTCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_CDTimeTCtrl->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_BuyCastSpin->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_BuyCastSpin->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_SellCastSpin->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_SellCastSpin->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_MaxSoltNumSpin->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_MaxSoltNumSpin->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_IconCBox->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_AddIconButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnIconClick ), NULL, this );
	m_DelIconButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnIconClick ), NULL, this );
	m_ModifyIconButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnIconClick ), NULL, this );
	m_HelpStrTCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_HelpStrTCtrl->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_PMListCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( ItemEditorFrameUI::OnPMListDeselected ), NULL, this );
	m_PMListCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( ItemEditorFrameUI::OnPMListSelected ), NULL, this );
	m_PMAddButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnPMAddClick ), NULL, this );
	m_PMRemoveButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnPMRemoveClick ), NULL, this );
	m_PMModifyButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnPMModifyClick ), NULL, this );
	m_EquipValSpin->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_EquipValSpin->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_EquipSoltChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_button17->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnChioceModelClick ), NULL, this );
	m_button18->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnModelNameRemove ), NULL, this );
	m_ScaleTCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_ScaleTCtrl->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_EditModelCBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnEditModelCheck ), NULL, this );
	m_WeaponTypeChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_ERASE_BACKGROUND, wxEraseEventHandler( ItemEditorFrameUI::OnDraw ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( ItemEditorFrameUI::OnKeyDown ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_MIDDLE_DOWN, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_MIDDLE_UP, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_RIGHT_UP, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_MOTION, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_MIDDLE_DCLICK, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_RIGHT_DCLICK, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_LEAVE_WINDOW, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Disconnect( wxEVT_SIZE, wxSizeEventHandler( ItemEditorFrameUI::OnDrawPanelResize ), NULL, this );
	
}
BaseTexturePackPanel::~BaseTexturePackPanel()
{
	// Disconnect Events
	m_textureListBox->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( BaseTexturePackPanel::OnTextureListBoxSelected ), NULL, this );
	m_frameSpinCtrl->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( BaseTexturePackPanel::OnFrameSpinCtrlChanged ), NULL, this );
	m_frameSpinCtrl->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( BaseTexturePackPanel::OnFrameSpinCtrlEnterPressed ), NULL, this );
	m_colourPicker->Disconnect( wxEVT_COMMAND_COLOURPICKER_CHANGED, wxColourPickerEventHandler( BaseTexturePackPanel::OnColourPickerChanged ), NULL, this );
	m_exportGIFButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BaseTexturePackPanel::OnExportGIFClicked ), NULL, this );
	m_zoomSpinCtrl->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( BaseTexturePackPanel::OnZoomSpinCtrlChanged ), NULL, this );
	
}
Exemplo n.º 3
0
PlotConfigurationDialogBase::~PlotConfigurationDialogBase()
{
	// Disconnect Events
	m_button5->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PlotConfigurationDialogBase::OnPDS ), NULL, this );
	m_tVMGCourse->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PlotConfigurationDialogBase::OnPlotChange ), NULL, this );
	m_fpPlotFont->Disconnect( wxEVT_COMMAND_FONTPICKER_CHANGED, wxFontPickerEventHandler( PlotConfigurationDialogBase::OnPlotChange ), NULL, this );
	m_sPlotMinHeight->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( PlotConfigurationDialogBase::OnPlotChange ), NULL, this );
	m_cColors->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PlotConfigurationDialogBase::OnPlotChange ), NULL, this );
	m_sPlotTransparency->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( PlotConfigurationDialogBase::OnPlotChange ), NULL, this );
	m_bAbout->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PlotConfigurationDialogBase::OnAbout ), NULL, this );
	
}
Exemplo n.º 4
0
void PatchInspector::populateWindow()
{
	SetSizer(new wxBoxSizer(wxVERTICAL));
	GetSizer()->Add(loadNamedPanel(this, "PatchInspectorMainPanel"), 1, wxEXPAND);

	makeLabelBold(this, "PatchInspectorVertexLabel");
	makeLabelBold(this, "PatchInspectorCoordLabel");
	makeLabelBold(this, "PatchInspectorTessLabel");

	_rowCombo = findNamedObject<wxChoice>(this, "PatchInspectorControlRow");
	_colCombo = findNamedObject<wxChoice>(this, "PatchInspectorControlColumn");

	// Create the controls table
	wxPanel* coordPanel = findNamedObject<wxPanel>(this, "PatchInspectorCoordPanel");
	wxFlexGridSizer* table = new wxFlexGridSizer(5, 5, 6, 16);
	table->AddGrowableCol(1);

	coordPanel->GetSizer()->Add(table, 1, wxEXPAND);

    _coords["x"] = createCoordRow("X:", coordPanel, table);
    _coords["y"] = createCoordRow("Y:", coordPanel, table);
    _coords["z"] = createCoordRow("Z:", coordPanel, table);
    _coords["s"] = createCoordRow("S:", coordPanel, table);
    _coords["t"] = createCoordRow("T:", coordPanel, table);

    // Connect the step values to the according registry values
	registry::bindWidget(_coords["x"].stepEntry, RKEY_X_STEP);
    registry::bindWidget(_coords["y"].stepEntry, RKEY_Y_STEP);
    registry::bindWidget(_coords["z"].stepEntry, RKEY_Z_STEP);
    registry::bindWidget(_coords["s"].stepEntry, RKEY_S_STEP);
    registry::bindWidget(_coords["t"].stepEntry, RKEY_T_STEP);

    // Connect all the arrow buttons
    for (CoordMap::iterator i = _coords.begin(); i != _coords.end(); ++i)
	{
    	CoordRow& row = i->second;

    	// Pass a CoordRow ref to the callback, that's all it will need to update
		row.smaller->Bind(wxEVT_BUTTON, boost::bind(&PatchInspector::onClickSmaller, this, row));
		row.larger->Bind(wxEVT_BUTTON, boost::bind(&PatchInspector::onClickLarger, this, row));
    }

	// Tesselation checkbox
	findNamedObject<wxCheckBox>(this, "PatchInspectorFixedSubdivisions")->Connect(
		wxEVT_CHECKBOX, wxCommandEventHandler(PatchInspector::onFixedTessChange), NULL, this);

	// Tesselation values
	findNamedObject<wxSpinCtrl>(this, "PatchInspectorSubdivisionsX")->Connect(
		wxEVT_SPINCTRL, wxSpinEventHandler(PatchInspector::onTessChange), NULL, this);
	findNamedObject<wxSpinCtrl>(this, "PatchInspectorSubdivisionsY")->Connect(
		wxEVT_SPINCTRL, wxSpinEventHandler(PatchInspector::onTessChange), NULL, this);
}
Exemplo n.º 5
0
VisualizeReconstructionsGui::~VisualizeReconstructionsGui()
{
	// Disconnect Events
	this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( VisualizeReconstructionsGui::OnTryToClose ) );
	m_example_spin->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( VisualizeReconstructionsGui::OnChangeExample ), NULL, this );
	m_slider1->Disconnect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( VisualizeReconstructionsGui::OnTemperatureChanged ), NULL, this );
	m_slider11->Disconnect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( VisualizeReconstructionsGui::OnNumAgsIterationsChanged ), NULL, this );
}
Exemplo n.º 6
0
void CBDTWxFrame::DestroyMemoryPage()
{
    m_pMemoryViewChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( CBDTWxFrame::OnMemoryChoiceChanged ), NULL, this );
    m_pFilterTextComboBox->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( CBDTWxFrame::OnFilterTextEnter ), NULL, this );
    m_pFilterTextComboBox->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( CBDTWxFrame::OnFilterTextSelected ), NULL, this );
    m_pMemoryDataGrid->Disconnect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( CBDTWxFrame::OnGridCellSelected ), NULL, this );
    m_pStackOffsetSpinBtn->Disconnect(wxEVT_SPIN, wxSpinEventHandler( CBDTWxFrame::OnSetMemoryStackOffset ), NULL, this);
    m_pCallStackListBox->Disconnect(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler(CBDTWxFrame::OnCallStackListDoubleClicked), NULL, this);
}
Exemplo n.º 7
0
NumericSlider::NumericSlider(
		wxWindow* parent,
		wxWindowID id,
		const wxString &value,
		const wxPoint &pos,
		const wxSize &size,
		long style,
		int min,
		int max,
		int initial,
		const wxString &name 
	) 	
{
    Create(parent, id, pos, size, style);

    wxFlexGridSizer* mainSizer;
    mainSizer = new wxFlexGridSizer(0, 2, 0, 0);
    mainSizer->AddGrowableCol(0);
    mainSizer->AddGrowableRow(0);
    mainSizer->SetFlexibleDirection(wxBOTH);    

    mScroll = new wxScrollBar(this, wxNewId(), wxDefaultPosition, wxDefaultSize, wxSB_HORIZONTAL);
    mScroll->SetMinSize(wxSize(128, -1));
    mainSizer->Add(mScroll, 0, wxEXPAND | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, 0);
    int sliderStep = (max - min) / 20;
    if (sliderStep == 0)
        sliderStep = 1;
    mScroll->SetScrollbar(initial, 1, max - min + 1, sliderStep);
    mScroll->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(NumericSlider::OnScrollChange), NULL, this);
    
    mSpinner = new wxSpinCtrl(this, wxNewId(), wxEmptyString, wxDefaultPosition, wxSize(-1, -1), wxSP_ARROW_KEYS | wxTE_PROCESS_ENTER, min, max, initial);
    mSpinner->SetMinSize(wxSize(96, -1));
    mainSizer->Add(mSpinner, 0, wxEXPAND |wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, 0);
    mSpinner->Connect(wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(NumericSlider::OnSpinnerChange), NULL, this);
    mSpinner->Connect(wxEVT_TEXT_ENTER, wxSpinEventHandler(NumericSlider::OnSpinnerChange), NULL, this);

    mScroll->SetThumbPosition(mSpinner->GetValue() - mSpinner->GetMin());

    this->SetSizer(mainSizer);
    this->Layout();
    mainSizer->Fit(this);
}
Exemplo n.º 8
0
MainFrameBase::~MainFrameBase()
{
	// Disconnect Events
	this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainFrameBase::OnCloseFrame ) );
	this->Disconnect( wxID_OPEN, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnOpen ) );
	this->Disconnect( wxID_PRINT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnPrint ) );
	this->Disconnect( wxID_PREVIEW, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnPreview ) );
	this->Disconnect( wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnExitClick ) );
	m_canvas->Disconnect( wxEVT_PAINT, wxPaintEventHandler( MainFrameBase::OnPaint ), NULL, this );
	m_spinPages->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( MainFrameBase::OnPageNumber ), NULL, this );
	
}
Exemplo n.º 9
0
void ParamBox::Initialise()
{	
	modparams = new ParamStore;
	modflags = new ParamStore;
	activepanel = panel;
	paramset = new ParamSet(activepanel);
	flagrefs = new RefStore();
	checkrefs = new RefStore();
	panelrefs = new RefStore();

	paramstoretag = NULL;
	if(boxtype == 0 || boxtype == 1) {
		mainwin->diagbox->Write("Store Box initialise\n");
		paramstoretag = TextInputCombo(100, 20, "", boxname, mod->GetPath());
		paramstoretag->Show(false);
	}
	
	//flagset = new FlagSet();

	//panel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize); 
	//panel->SetFont(boxfont);

	//vbox1 = new wxBoxSizer(wxVERTICAL);
	//vbox2 = new wxBoxSizer(wxVERTICAL);
	//vbox3 = new wxBoxSizer(wxVERTICAL);
	//vbox4 = new wxBoxSizer(wxVERTICAL);
	//vbox5 = new wxBoxSizer(wxVERTICAL);

	if(boxtype == 0) parambox = new wxBoxSizer(wxHORIZONTAL);
	//mainbox = new wxBoxSizer(wxVERTICAL);

	//vbox1->AddSpacer(5);
	//vbox2->AddSpacer(5);
	//vbox3->AddSpacer(5);
	//vbox4->AddSpacer(5);
	//vbox5->AddSpacer(5);

	//panel->SetSizer(mainbox);

	Connect(ID_autorun, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(ParamBox::OnAutorun));
	Connect(ID_Run, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ParamBox::OnRun));
	Connect(ID_Default, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ParamBox::OnDefault));
	Connect(wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler(ParamBox::OnRun));
	//Connect(wxEVT_MOVE, wxMoveEventHandler(ParamBox::OnMove));
	//Connect(wxEVT_SIZE, wxSizeEventHandler(ParamBox::OnSize));
	Connect(wxEVT_SET_FOCUS, wxFocusEventHandler(ParamBox::OnFocus));
	Connect(wxEVT_SPIN, wxSpinEventHandler(ParamBox::OnSpin));
	Connect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(ParamBox::OnDClick));
	Connect(ID_paramstore, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ParamBox::OnParamStore));
	Connect(ID_paramload, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ParamBox::OnParamLoad));
	Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(ParamBox::OnClose));
}
Exemplo n.º 10
0
wxSizer* PasteSymbolScaleCMPT::initLayout()
{
	wxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
	{
		wxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
		sizer->Add(new wxStaticText(this, wxID_ANY, wxT("╦ши┼: ")));

		wxSpinCtrl* scaleCtrl = new wxSpinCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 
			wxSP_ARROW_KEYS, 10, 100, 100);
		Connect(scaleCtrl->GetId(), wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(PasteSymbolScaleCMPT::onChangeScale));
		sizer->Add(scaleCtrl);

		sizer->Add(new wxStaticText(this, wxID_ANY, wxT("%")));
		topSizer->Add(sizer);
	}
	return topSizer;
}
Exemplo n.º 11
0
EventFrameBase::~EventFrameBase()
{
	// Disconnect Events
	this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( EventFrameBase::Closed ) );
	SpecificTimeCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( EventFrameBase::SpecificTimeCheckBoxClicked ), NULL, this );
	EndDateCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( EventFrameBase::EndDateCheckBoxClicked ), NULL, this );
	RepeatCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( EventFrameBase::RepeatCheckBoxClicked ), NULL, this );
	UntilCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( EventFrameBase::UntilCheckBoxClicked ), NULL, this );
	AlarmsList->Disconnect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( EventFrameBase::AlarmDeselected ), NULL, this );
	AlarmsList->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( EventFrameBase::AlarmSelected ), NULL, this );
	AddAlarmButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( EventFrameBase::AddAlarmClicked ), NULL, this );
	DeleteAlaramButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( EventFrameBase::DeleteAlarmClicked ), NULL, this );
	AlarmTypeChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( EventFrameBase::AlarmTypeChanged ), NULL, this );
	AlarmTriggerSpinCtrl->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( EventFrameBase::AlarmTriggerChanged ), NULL, this );
	AlarmTriggerUnitChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( EventFrameBase::AlarmTriggerUnitChanged ), NULL, this );
	AlarmBeforeAfterChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( EventFrameBase::AlarmBeforeAfterChanged ), NULL, this );
	ButtonsSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( EventFrameBase::CancelClicked ), NULL, this );
	ButtonsSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( EventFrameBase::OKClicked ), NULL, this );
}
Exemplo n.º 12
0
/*****************************************************
**
**   AspectColorPanel   ---   Constructor
**
******************************************************/
AspectColorPanel::AspectColorPanel(wxWindow* parent)
  :  ConfigPanel( parent )
{
    // begin wxGlade: AspectColorPanel::AspectColorPanel
    sizer_preview_staticbox = new wxStaticBox(this, -1, _("Preview"));
    sizer_styles_staticbox = new wxStaticBox(this, -1, _("Styles"));
    const wxString choice_aspect_type_choices[] = {
        _("dummy"),
        _("dummy"),
        _("dummy"),
        _("dummy"),
        _("dummy")
    };
    choice_aspect_type = new wxChoice(this, CD_STYLE_CHOICE, wxDefaultPosition, wxDefaultSize, 5, choice_aspect_type_choices, 0);
    label_color = new wxStaticText(this, wxID_ANY, _("Color"));
    button_color = new wxColourPickerCtrl(this, CD_COLORPICKER);
    label_width = new wxStaticText(this, wxID_ANY, _("Width"));
    spin_width = new wxSpinCtrl(this, CD_SPIN_WIDTH, wxT(""), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 10);
    label_linestyle = new wxStaticText(this, wxID_ANY, _("Line Style"));
    const wxString choice_linestyle_choices[] = {
        _("Solid"),
        _("Dot"),
        _("Long Dash"),
        _("Short Dash"),
        _("Dot Dash")
    };
    choice_linestyle = new wxChoice(this, CD_LINESTYLE, wxDefaultPosition, wxDefaultSize, 5, choice_linestyle_choices, 0);
    button_default = new wxButton(this, CD_DEFAULT, _("Restore Defaults"));
    preview_panel = new AspectPreviewPanel(this, CD_PREVIEW_PANEL);

    set_properties();
    do_layout();
    // end wxGlade

  Connect( CD_STYLE_CHOICE, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( AspectColorPanel::OnAspectChoice ));
  Connect( CD_LINESTYLE, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( AspectColorPanel::OnLineStyleChoice ));
  Connect( CD_DEFAULT, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AspectColorPanel::OnDefaultButton ));

  Connect( CD_COLORPICKER, wxEVT_COMMAND_COLOURPICKER_CHANGED, wxColourPickerEventHandler( AspectColorPanel::OnColorButton ));

  Connect( CD_SPIN_WIDTH, wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( AspectColorPanel::OnSpinWidth ));
  Connect( CD_PREVIEW_PANEL, COMMAND_SELECTED_ASPECT_CHANGED, wxCommandEventHandler( AspectColorPanel::OnSelectedAspectChanged ));
}
Exemplo n.º 13
0
VisualizeReconstructionsGui::VisualizeReconstructionsGui( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxFlexGridSizer* fgSizer8;
	fgSizer8 = new wxFlexGridSizer( 2, 3, 0, 0 );
	fgSizer8->SetFlexibleDirection( wxBOTH );
	fgSizer8->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_staticText17 = new wxStaticText( this, wxID_ANY, wxT("Example:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
	m_staticText17->Wrap( -1 );
	fgSizer8->Add( m_staticText17, 0, wxALIGN_RIGHT|wxRIGHT|wxTOP, 8 );
	
	m_example_spin = new wxSpinCtrl( this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize( -1,-1 ), wxSP_ARROW_KEYS|wxSP_WRAP, 0, 5999, 0 );
	fgSizer8->Add( m_example_spin, 0, wxALL, 5 );
	
	m_slider1 = new wxSlider( this, wxID_ANY, 0, -100, 100, wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL );
	m_slider1->SetMinSize( wxSize( -1,256 ) );
	
	fgSizer8->Add( m_slider1, 0, wxALL, 5 );
	
	m_original_image = new wxTrainingExampleControl( this, wxSize( 224, 224 ) );
	fgSizer8->Add( m_original_image, 0, wxALL, 5 );
	
	m_fantasy_image = new wxTrainingExampleControl( this, wxSize( 224, 224 ) );
	fgSizer8->Add( m_fantasy_image, 0, wxALL, 5 );
	
	m_slider11 = new wxSlider( this, wxID_NUM_AGS_ITERATIONS, 0, 0, 16, wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL );
	m_slider11->SetMinSize( wxSize( -1,256 ) );
	
	fgSizer8->Add( m_slider11, 0, wxALL, 5 );
	
	this->SetSizer( fgSizer8 );
	this->Layout();
	
	// Connect Events
	this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( VisualizeReconstructionsGui::OnTryToClose ) );
	m_example_spin->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( VisualizeReconstructionsGui::OnChangeExample ), NULL, this );
	m_slider1->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( VisualizeReconstructionsGui::OnTemperatureChanged ), NULL, this );
	m_slider11->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( VisualizeReconstructionsGui::OnNumAgsIterationsChanged ), NULL, this );
}
Exemplo n.º 14
0
PANEL_PREV_3D_BASE::PANEL_PREV_3D_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
	wxBoxSizer* bSizermain;
	bSizermain = new wxBoxSizer( wxHORIZONTAL );
	
	wxBoxSizer* bSizerLeft;
	bSizerLeft = new wxBoxSizer( wxVERTICAL );
	
	wxBoxSizer* bSizerScale;
	bSizerScale = new wxBoxSizer( wxVERTICAL );
	
	m_staticTextScale = new wxStaticText( this, wxID_ANY, _("Scale"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticTextScale->Wrap( -1 );
	bSizerScale->Add( m_staticTextScale, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
	
	wxFlexGridSizer* fgSizerScale;
	fgSizerScale = new wxFlexGridSizer( 0, 3, 0, 0 );
	fgSizerScale->SetFlexibleDirection( wxBOTH );
	fgSizerScale->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_staticText1 = new wxStaticText( this, wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText1->Wrap( -1 );
	fgSizerScale->Add( m_staticText1, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
	
	xscale = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	fgSizerScale->Add( xscale, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
	
	m_spinXscale = new wxSpinButton( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_VERTICAL );
	fgSizerScale->Add( m_spinXscale, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	m_staticText2 = new wxStaticText( this, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText2->Wrap( -1 );
	fgSizerScale->Add( m_staticText2, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
	
	yscale = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	fgSizerScale->Add( yscale, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP, 5 );
	
	m_spinYscale = new wxSpinButton( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_VERTICAL );
	fgSizerScale->Add( m_spinYscale, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	m_staticText3 = new wxStaticText( this, wxID_ANY, _("Z:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText3->Wrap( -1 );
	fgSizerScale->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
	
	zscale = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	fgSizerScale->Add( zscale, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 );
	
	m_spinZscale = new wxSpinButton( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_VERTICAL );
	fgSizerScale->Add( m_spinZscale, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 );
	
	
	bSizerScale->Add( fgSizerScale, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 );
	
	
	bSizerLeft->Add( bSizerScale, 0, wxEXPAND, 5 );
	
	wxBoxSizer* bSizerRotation;
	bSizerRotation = new wxBoxSizer( wxVERTICAL );
	
	m_staticTextRot = new wxStaticText( this, wxID_ANY, _("Rotation (degrees)"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticTextRot->Wrap( -1 );
	bSizerRotation->Add( m_staticTextRot, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
	
	wxFlexGridSizer* fgSizerRotate;
	fgSizerRotate = new wxFlexGridSizer( 0, 3, 0, 0 );
	fgSizerRotate->SetFlexibleDirection( wxBOTH );
	fgSizerRotate->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_staticText11 = new wxStaticText( this, wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText11->Wrap( -1 );
	fgSizerRotate->Add( m_staticText11, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
	
	xrot = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	#ifdef __WXGTK__
	if ( !xrot->HasFlag( wxTE_MULTILINE ) )
	{
	xrot->SetMaxLength( 9 );
	}
	#else
	xrot->SetMaxLength( 9 );
	#endif
	fgSizerRotate->Add( xrot, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
	
	m_spinXrot = new wxSpinButton( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_VERTICAL );
	fgSizerRotate->Add( m_spinXrot, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	m_staticText21 = new wxStaticText( this, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText21->Wrap( -1 );
	fgSizerRotate->Add( m_staticText21, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
	
	yrot = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	#ifdef __WXGTK__
	if ( !yrot->HasFlag( wxTE_MULTILINE ) )
	{
	yrot->SetMaxLength( 9 );
	}
	#else
	yrot->SetMaxLength( 9 );
	#endif
	fgSizerRotate->Add( yrot, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP, 5 );
	
	m_spinYrot = new wxSpinButton( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_VERTICAL );
	fgSizerRotate->Add( m_spinYrot, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	m_staticText31 = new wxStaticText( this, wxID_ANY, _("Z:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText31->Wrap( -1 );
	fgSizerRotate->Add( m_staticText31, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
	
	zrot = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	#ifdef __WXGTK__
	if ( !zrot->HasFlag( wxTE_MULTILINE ) )
	{
	zrot->SetMaxLength( 9 );
	}
	#else
	zrot->SetMaxLength( 9 );
	#endif
	fgSizerRotate->Add( zrot, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 );
	
	m_spinZrot = new wxSpinButton( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_VERTICAL );
	fgSizerRotate->Add( m_spinZrot, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 );
	
	
	bSizerRotation->Add( fgSizerRotate, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 );
	
	
	bSizerLeft->Add( bSizerRotation, 0, wxEXPAND, 5 );
	
	wxBoxSizer* bSizerOffset;
	bSizerOffset = new wxBoxSizer( wxVERTICAL );
	
	m_staticTextOffset = new wxStaticText( this, wxID_ANY, _("Offset"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticTextOffset->Wrap( -1 );
	bSizerOffset->Add( m_staticTextOffset, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
	
	wxFlexGridSizer* fgSizerOffset;
	fgSizerOffset = new wxFlexGridSizer( 0, 3, 0, 0 );
	fgSizerOffset->SetFlexibleDirection( wxBOTH );
	fgSizerOffset->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_staticText12 = new wxStaticText( this, wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText12->Wrap( -1 );
	fgSizerOffset->Add( m_staticText12, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
	
	xoff = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	fgSizerOffset->Add( xoff, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
	
	m_spinXoffset = new wxSpinButton( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_VERTICAL );
	fgSizerOffset->Add( m_spinXoffset, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	m_staticText22 = new wxStaticText( this, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText22->Wrap( -1 );
	fgSizerOffset->Add( m_staticText22, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
	
	yoff = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	fgSizerOffset->Add( yoff, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 );
	
	m_spinYoffset = new wxSpinButton( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_VERTICAL );
	fgSizerOffset->Add( m_spinYoffset, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	m_staticText32 = new wxStaticText( this, wxID_ANY, _("Z:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText32->Wrap( -1 );
	fgSizerOffset->Add( m_staticText32, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
	
	zoff = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	fgSizerOffset->Add( zoff, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
	
	m_spinZoffset = new wxSpinButton( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_VERTICAL );
	fgSizerOffset->Add( m_spinZoffset, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	
	bSizerOffset->Add( fgSizerOffset, 0, wxEXPAND|wxLEFT|wxRIGHT, 10 );
	
	
	bSizerLeft->Add( bSizerOffset, 1, wxEXPAND, 5 );
	
	
	bSizermain->Add( bSizerLeft, 0, wxEXPAND, 5 );
	
	wxBoxSizer* bSizerRight;
	bSizerRight = new wxBoxSizer( wxVERTICAL );
	
	m_SizerPanelView = new wxBoxSizer( wxVERTICAL );
	
	
	bSizerRight->Add( m_SizerPanelView, 1, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer3DButtons;
	bSizer3DButtons = new wxBoxSizer( wxHORIZONTAL );
	
	
	bSizer3DButtons->Add( 0, 0, 1, wxEXPAND, 5 );
	
	m_fgSizerButtons = new wxFlexGridSizer( 0, 4, 0, 0 );
	m_fgSizerButtons->AddGrowableCol( 0 );
	m_fgSizerButtons->AddGrowableCol( 1 );
	m_fgSizerButtons->AddGrowableCol( 2 );
	m_fgSizerButtons->AddGrowableCol( 3 );
	m_fgSizerButtons->SetFlexibleDirection( wxBOTH );
	m_fgSizerButtons->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_bpvISO = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
	m_bpvISO->SetToolTip( _("Change to isometric perspective") );
	
	m_fgSizerButtons->Add( m_bpvISO, 0, wxALL|wxEXPAND, 5 );
	
	m_bpvLeft = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
	m_fgSizerButtons->Add( m_bpvLeft, 0, wxALL|wxEXPAND, 5 );
	
	m_bpvFront = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
	m_fgSizerButtons->Add( m_bpvFront, 0, wxALL|wxEXPAND, 5 );
	
	m_bpvTop = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
	m_fgSizerButtons->Add( m_bpvTop, 0, wxALL|wxEXPAND, 5 );
	
	m_bpUpdate = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
	m_bpUpdate->SetToolTip( _("Reload board and 3D models") );
	
	m_fgSizerButtons->Add( m_bpUpdate, 0, wxALL|wxEXPAND, 5 );
	
	m_bpvRight = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
	m_fgSizerButtons->Add( m_bpvRight, 0, wxALL|wxEXPAND, 5 );
	
	m_bpvBack = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
	m_fgSizerButtons->Add( m_bpvBack, 0, wxALL|wxEXPAND, 5 );
	
	m_bpvBottom = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
	m_fgSizerButtons->Add( m_bpvBottom, 0, wxALL|wxEXPAND, 5 );
	
	
	bSizer3DButtons->Add( m_fgSizerButtons, 6, wxEXPAND, 5 );
	
	
	bSizer3DButtons->Add( 0, 0, 1, wxEXPAND, 5 );
	
	
	bSizerRight->Add( bSizer3DButtons, 0, wxALL|wxEXPAND, 5 );
	
	
	bSizermain->Add( bSizerRight, 1, wxEXPAND, 5 );
	
	
	this->SetSizer( bSizermain );
	this->Layout();
	bSizermain->Fit( this );
	
	// Connect Events
	xscale->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelScale ), NULL, this );
	xscale->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
	m_spinXscale->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementScale ), NULL, this );
	m_spinXscale->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementScale ), NULL, this );
	yscale->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelScale ), NULL, this );
	yscale->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
	m_spinYscale->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementScale ), NULL, this );
	m_spinYscale->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementScale ), NULL, this );
	zscale->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelScale ), NULL, this );
	zscale->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
	m_spinZscale->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementScale ), NULL, this );
	m_spinZscale->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementScale ), NULL, this );
	xrot->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelRot ), NULL, this );
	xrot->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
	m_spinXrot->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementRot ), NULL, this );
	m_spinXrot->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementRot ), NULL, this );
	yrot->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelRot ), NULL, this );
	yrot->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
	m_spinYrot->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementRot ), NULL, this );
	m_spinYrot->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementRot ), NULL, this );
	zrot->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelRot ), NULL, this );
	zrot->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
	m_spinZrot->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementRot ), NULL, this );
	m_spinZrot->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementRot ), NULL, this );
	xoff->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelOffset ), NULL, this );
	xoff->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
	m_spinXoffset->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementOffset ), NULL, this );
	m_spinXoffset->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementOffset ), NULL, this );
	yoff->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelOffset ), NULL, this );
	yoff->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
	m_spinYoffset->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementOffset ), NULL, this );
	m_spinYoffset->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementOffset ), NULL, this );
	zoff->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelOffset ), NULL, this );
	zoff->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
	m_spinZoffset->Connect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementOffset ), NULL, this );
	m_spinZoffset->Connect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementOffset ), NULL, this );
	m_bpvISO->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DISO ), NULL, this );
	m_bpvLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DLeft ), NULL, this );
	m_bpvFront->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DFront ), NULL, this );
	m_bpvTop->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DTop ), NULL, this );
	m_bpUpdate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DUpdate ), NULL, this );
	m_bpvRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DRight ), NULL, this );
	m_bpvBack->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DBack ), NULL, this );
	m_bpvBottom->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DBottom ), NULL, this );
}
Exemplo n.º 15
0
/*****************************************************
**
**   AspectPanel   ---   Constructor 
**
******************************************************/
AspectPanel::AspectPanel( wxWindow* parent )
  :  ConfigPanel( parent )
{
    // begin wxGlade: AspectPanel::AspectPanel
    sizer_aspects_staticbox = new wxStaticBox(this, -1, _("Aspects and Orbes"));
    aspect_list = new AspectOrbisList(this, CD_ASPECTLIST);
    button_default = new wxButton(this, CD_DEFAULT, _("Restore Defaults"));

    set_properties();
    do_layout();
    // end wxGlade

  Connect( CD_DEFAULT, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AspectPanel::OnDefaultButton ));
  Connect( CD_CHECK_ASPECT, CD_CHECK_ASPECT + MAX_ASPECT_TYPES, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( AspectPanel::OnCheckAspect ));
  Connect( CD_SPIN_ORBIS, CD_SPIN_ORBIS + MAX_ASPECT_TYPES, wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( AspectPanel::OnSpinOrbis ));
}
Exemplo n.º 16
0
PANEL_PREV_3D_BASE::~PANEL_PREV_3D_BASE()
{
	// Disconnect Events
	xscale->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelScale ), NULL, this );
	xscale->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
	m_spinXscale->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementScale ), NULL, this );
	m_spinXscale->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementScale ), NULL, this );
	yscale->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelScale ), NULL, this );
	yscale->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
	m_spinYscale->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementScale ), NULL, this );
	m_spinYscale->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementScale ), NULL, this );
	zscale->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelScale ), NULL, this );
	zscale->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
	m_spinZscale->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementScale ), NULL, this );
	m_spinZscale->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementScale ), NULL, this );
	xrot->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelRot ), NULL, this );
	xrot->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
	m_spinXrot->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementRot ), NULL, this );
	m_spinXrot->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementRot ), NULL, this );
	yrot->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelRot ), NULL, this );
	yrot->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
	m_spinYrot->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementRot ), NULL, this );
	m_spinYrot->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementRot ), NULL, this );
	zrot->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelRot ), NULL, this );
	zrot->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
	m_spinZrot->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementRot ), NULL, this );
	m_spinZrot->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementRot ), NULL, this );
	xoff->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelOffset ), NULL, this );
	xoff->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
	m_spinXoffset->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementOffset ), NULL, this );
	m_spinXoffset->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementOffset ), NULL, this );
	yoff->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelOffset ), NULL, this );
	yoff->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
	m_spinYoffset->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementOffset ), NULL, this );
	m_spinYoffset->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementOffset ), NULL, this );
	zoff->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PANEL_PREV_3D_BASE::onMouseWheelOffset ), NULL, this );
	zoff->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_PREV_3D_BASE::updateOrientation ), NULL, this );
	m_spinZoffset->Disconnect( wxEVT_SCROLL_LINEDOWN, wxSpinEventHandler( PANEL_PREV_3D_BASE::onDecrementOffset ), NULL, this );
	m_spinZoffset->Disconnect( wxEVT_SCROLL_LINEUP, wxSpinEventHandler( PANEL_PREV_3D_BASE::onIncrementOffset ), NULL, this );
	m_bpvISO->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DISO ), NULL, this );
	m_bpvLeft->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DLeft ), NULL, this );
	m_bpvFront->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DFront ), NULL, this );
	m_bpvTop->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DTop ), NULL, this );
	m_bpUpdate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DUpdate ), NULL, this );
	m_bpvRight->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DRight ), NULL, this );
	m_bpvBack->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DBack ), NULL, this );
	m_bpvBottom->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_PREV_3D_BASE::View3DBottom ), NULL, this );
	
}
Exemplo n.º 17
0
    wxTimePickerGenericImpl(wxTimePickerCtrlGeneric* ctrl)
    {
        m_text = new wxTextCtrl(ctrl, wxID_ANY, wxString());

        // As this text can't be edited, don't use the standard cursor for it
        // to avoid misleading the user. Ideally we'd also hide the caret but
        // this is not currently supported by wxTextCtrl.
        m_text->SetCursor(wxCURSOR_ARROW);

        m_btn = new wxSpinButton(ctrl, wxID_ANY,
                                 wxDefaultPosition, wxDefaultSize,
                                 wxSP_VERTICAL | wxSP_WRAP);

        m_currentField = Field_Hour;
        m_isFirstDigit = true;

        // We don't support arbitrary formats currently as this requires
        // significantly more work both here and also in wxLocale::GetInfo().
        //
        // For now just use either "%H:%M:%S" or "%I:%M:%S %p". It would be
        // nice to add support to "%k" and "%l" (hours with leading blanks
        // instead of zeros) too as this is the most common unsupported case in
        // practice.
#if wxUSE_XLOCALE
        m_useAMPM = wxLocale::GetInfo(wxLOCALE_TIME_FMT).Contains("%p");
#else
        m_useAMPM = false;
#endif

        m_text->Connect
                (
                    wxEVT_SET_FOCUS,
                    wxFocusEventHandler(wxTimePickerGenericImpl::OnTextSetFocus),
                    NULL,
                    this
                );
        m_text->Connect
                (
                    wxEVT_KEY_DOWN,
                    wxKeyEventHandler(wxTimePickerGenericImpl::OnTextKeyDown),
                    NULL,
                    this
                );
        m_text->Connect
                (
                    wxEVT_LEFT_DOWN,
                    wxMouseEventHandler(wxTimePickerGenericImpl::OnTextClick),
                    NULL,
                    this
                );

        m_btn->Connect
               (
                    wxEVT_SPIN_UP,
                    wxSpinEventHandler(wxTimePickerGenericImpl::OnArrowUp),
                    NULL,
                    this
               );
        m_btn->Connect
               (
                    wxEVT_SPIN_DOWN,
                    wxSpinEventHandler(wxTimePickerGenericImpl::OnArrowDown),
                    NULL,
                    this
               );
    }
Exemplo n.º 18
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);
}
Exemplo n.º 19
0
BaseTexturePackPanel::BaseTexturePackPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
	wxBoxSizer* bSizer4;
	bSizer4 = new wxBoxSizer( wxVERTICAL );
	
	m_splitter2 = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_LIVE_UPDATE );
	m_splitter2->Connect( wxEVT_IDLE, wxIdleEventHandler( BaseTexturePackPanel::m_splitter2OnIdle ), NULL, this );
	
	m_panel3 = new wxPanel( m_splitter2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer5;
	bSizer5 = new wxBoxSizer( wxHORIZONTAL );
	
	m_textureListBox = new wxListBox( m_panel3, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0|wxNO_BORDER ); 
	bSizer5->Add( m_textureListBox, 1, wxEXPAND, 5 );
	
	m_splitterSeperatorPanel = new wxPanel( m_panel3, wxID_ANY, wxDefaultPosition, wxSize( 1,-1 ), wxTAB_TRAVERSAL );
	m_splitterSeperatorPanel->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNSHADOW ) );
	
	bSizer5->Add( m_splitterSeperatorPanel, 0, wxEXPAND, 5 );
	
	
	m_panel3->SetSizer( bSizer5 );
	m_panel3->Layout();
	bSizer5->Fit( m_panel3 );
	m_panel4 = new wxPanel( m_splitter2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer6;
	bSizer6 = new wxBoxSizer( wxVERTICAL );
	
	wxBoxSizer* bSizer7;
	bSizer7 = new wxBoxSizer( wxHORIZONTAL );
	
	m_staticText1 = new wxStaticText( m_panel4, wxID_ANY, _("Frame:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText1->Wrap( -1 );
	bSizer7->Add( m_staticText1, 0, wxALIGN_CENTER|wxALL, 5 );
	
	m_frameSpinCtrl = new wxSpinCtrl( m_panel4, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP|wxTE_PROCESS_ENTER, 0, 10, 0 );
	bSizer7->Add( m_frameSpinCtrl, 0, wxALIGN_CENTER|wxALL, 5 );
	
	m_staticText2 = new wxStaticText( m_panel4, wxID_ANY, _("Background:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText2->Wrap( -1 );
	bSizer7->Add( m_staticText2, 0, wxALIGN_CENTER|wxALL, 5 );
	
	m_colourPicker = new wxColourPickerCtrl( m_panel4, wxID_ANY, wxColour( 255, 255, 255 ), wxDefaultPosition, wxDefaultSize, wxCLRP_DEFAULT_STYLE );
	bSizer7->Add( m_colourPicker, 0, wxALIGN_CENTER|wxALL, 5 );
	
	
	bSizer6->Add( bSizer7, 0, wxEXPAND, 5 );
	
	m_framePanel = new wxPanel( m_panel4, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer11;
	bSizer11 = new wxBoxSizer( wxVERTICAL );
	
	m_frameBitmap = new wxStaticBitmap( m_framePanel, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
	bSizer11->Add( m_frameBitmap, 0, wxALL, 5 );
	
	
	m_framePanel->SetSizer( bSizer11 );
	m_framePanel->Layout();
	bSizer11->Fit( m_framePanel );
	bSizer6->Add( m_framePanel, 1, wxEXPAND | wxALL, 5 );
	
	wxBoxSizer* bSizer111;
	bSizer111 = new wxBoxSizer( wxHORIZONTAL );
	
	
	bSizer111->Add( 0, 0, 1, wxEXPAND, 5 );
	
	wxStaticBoxSizer* sbSizer1;
	sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( m_panel4, wxID_ANY, _("Animated GIF") ), wxVERTICAL );
	
	m_staticText8 = new wxStaticText( m_panel4, wxID_ANY, _("Frame delay:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText8->Wrap( -1 );
	sbSizer1->Add( m_staticText8, 0, wxLEFT, 5 );
	
	m_frameDelaySpinCtrl = new wxSpinCtrl( m_panel4, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 10, 10000, 250 );
	m_frameDelaySpinCtrl->SetMaxSize( wxSize( 70,-1 ) );
	
	sbSizer1->Add( m_frameDelaySpinCtrl, 0, wxLEFT, 5 );
	
	m_exportGIFButton = new wxButton( m_panel4, wxID_ANY, _("Export"), wxDefaultPosition, wxDefaultSize, 0 );
	m_exportGIFButton->Enable( false );
	
	sbSizer1->Add( m_exportGIFButton, 0, wxALL, 5 );
	
	
	bSizer111->Add( sbSizer1, 0, wxALL|wxEXPAND, 5 );
	
	
	bSizer6->Add( bSizer111, 0, wxEXPAND, 5 );
	
	m_infoSizer = new wxBoxSizer( wxHORIZONTAL );
	
	m_staticText3 = new wxStaticText( m_panel4, wxID_ANY, _("Zoom:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText3->Wrap( -1 );
	m_infoSizer->Add( m_staticText3, 0, wxALIGN_CENTER|wxALL, 5 );
	
	m_zoomSpinCtrl = new wxSpinCtrl( m_panel4, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 20, 1 );
	m_infoSizer->Add( m_zoomSpinCtrl, 0, wxALL, 5 );
	
	
	m_infoSizer->Add( 0, 0, 1, wxEXPAND, 5 );
	
	m_staticText9 = new wxStaticText( m_panel4, wxID_ANY, _("UV:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText9->Wrap( -1 );
	m_infoSizer->Add( m_staticText9, 0, wxALIGN_CENTER|wxALL, 5 );
	
	m_uvStaticText = new wxStaticText( m_panel4, wxID_ANY, _("-"), wxDefaultPosition, wxDefaultSize, 0 );
	m_uvStaticText->Wrap( -1 );
	m_infoSizer->Add( m_uvStaticText, 0, wxALIGN_CENTER|wxALL, 5 );
	
	
	m_infoSizer->Add( 0, 0, 1, wxEXPAND, 5 );
	
	m_staticText4 = new wxStaticText( m_panel4, wxID_ANY, _("Size:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText4->Wrap( -1 );
	m_infoSizer->Add( m_staticText4, 0, wxALIGN_CENTER|wxALL, 5 );
	
	m_sizeStaticText = new wxStaticText( m_panel4, wxID_ANY, _("-"), wxDefaultPosition, wxDefaultSize, 0 );
	m_sizeStaticText->Wrap( -1 );
	m_infoSizer->Add( m_sizeStaticText, 0, wxALIGN_CENTER|wxALL, 5 );
	
	m_staticText41 = new wxStaticText( m_panel4, wxID_ANY, _("Offset:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText41->Wrap( -1 );
	m_infoSizer->Add( m_staticText41, 0, wxALIGN_CENTER|wxALL, 5 );
	
	m_offsetStaticText = new wxStaticText( m_panel4, wxID_ANY, _("-"), wxDefaultPosition, wxDefaultSize, 0 );
	m_offsetStaticText->Wrap( -1 );
	m_infoSizer->Add( m_offsetStaticText, 0, wxALIGN_CENTER|wxALL, 5 );
	
	
	bSizer6->Add( m_infoSizer, 0, wxEXPAND, 5 );
	
	
	m_panel4->SetSizer( bSizer6 );
	m_panel4->Layout();
	bSizer6->Fit( m_panel4 );
	m_splitter2->SplitVertically( m_panel3, m_panel4, 180 );
	bSizer4->Add( m_splitter2, 1, wxEXPAND, 5 );
	
	
	this->SetSizer( bSizer4 );
	this->Layout();
	
	// Connect Events
	m_textureListBox->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( BaseTexturePackPanel::OnTextureListBoxSelected ), NULL, this );
	m_frameSpinCtrl->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( BaseTexturePackPanel::OnFrameSpinCtrlChanged ), NULL, this );
	m_frameSpinCtrl->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( BaseTexturePackPanel::OnFrameSpinCtrlEnterPressed ), NULL, this );
	m_colourPicker->Connect( wxEVT_COMMAND_COLOURPICKER_CHANGED, wxColourPickerEventHandler( BaseTexturePackPanel::OnColourPickerChanged ), NULL, this );
	m_exportGIFButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BaseTexturePackPanel::OnExportGIFClicked ), NULL, this );
	m_zoomSpinCtrl->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( BaseTexturePackPanel::OnZoomSpinCtrlChanged ), NULL, this );
}
Exemplo n.º 20
0
void CBDTWxFrame::CreateMemoryPage()
{
    m_pMemoryPanel = new wxPanel( m_pNoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    wxBoxSizer* pMemorySizer = new wxBoxSizer( wxVERTICAL );

    wxBoxSizer* pFirstRowSizer = new wxBoxSizer(wxHORIZONTAL);
    wxString strMemoryViewChoiceString[] = { wxT("按照分配位置查看"), wxT("按照分配尺寸查看"), wxT("按照分配时间查看"), wxT("按照分配地址查看") };
    int uChoiceCount = sizeof( strMemoryViewChoiceString ) / sizeof( wxString );
    m_pMemoryViewChoice = new wxChoice( m_pMemoryPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, uChoiceCount, strMemoryViewChoiceString, 0 );
    m_pMemoryViewChoice->SetSelection( 0 );
    pFirstRowSizer->Add(m_pMemoryViewChoice, 0, wxALL, 5);

    m_pFilterLabel = new wxStaticText( m_pMemoryPanel, wxID_ANY, wxT("过滤"), wxDefaultPosition, wxDefaultSize, 0 );
    pFirstRowSizer->Add(m_pFilterLabel, 0, wxALL, 5);
    m_pFilterTextComboBox = new wxComboBox(m_pMemoryPanel, wxID_ANY, "", wxDefaultPosition, wxSize(300, 20), 0, NULL, wxTE_PROCESS_ENTER|wxCB_DROPDOWN );
    //m_pFilterTextComboBox->SetIgnoreEnterFlag(true);
    pFirstRowSizer->Add(m_pFilterTextComboBox, 0, wxALL, 5);
    
    m_pAutoUpdateMemoryCheckBox = new wxCheckBox(m_pMemoryPanel, wxID_ANY, wxT("自动更新"), wxDefaultPosition, wxDefaultSize, 0 );
    m_pAutoUpdateMemoryCheckBox->SetValue(1);
    pFirstRowSizer->Add(m_pAutoUpdateMemoryCheckBox, 0, wxALL, 5);

    pMemorySizer->Add( pFirstRowSizer, 0, wxALL, 5 );

    m_pMemoryDataGrid = new wxGrid( m_pMemoryPanel, wxID_ANY, wxDefaultPosition, wxSize(400, 300), 0 );
    // Grid
    m_pMemoryDataGrid->CreateGrid( 5, 5 );
    m_pMemoryDataGrid->EnableEditing( false );
    m_pMemoryDataGrid->EnableGridLines( true );
    m_pMemoryDataGrid->EnableDragGridSize( false );
    m_pMemoryDataGrid->SetMargins( 0, 0 );

    // Columns
    m_pMemoryDataGrid->EnableDragColMove( false );
    m_pMemoryDataGrid->EnableDragColSize( true );
    m_pMemoryDataGrid->SetColLabelSize( 30 );
    m_pMemoryDataGrid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );

    // Rows
    m_pMemoryDataGrid->EnableDragRowSize( true );
    m_pMemoryDataGrid->SetRowLabelSize( 80 );
    m_pMemoryDataGrid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );

    ClearAllColumnLabel();

    // Label Appearance
    // Cell Defaults
    m_pMemoryDataGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
    pMemorySizer->Add( m_pMemoryDataGrid, 0, wxEXPAND | wxALL, 5 );
    //NOTICE: to set scroll rate exactly same with the row height.
    //If didn't do so, we can't get the exactly scroll pos, the value will be wrong for wxwidgets reason.
    int scrollRateX, scrollRateY;
    m_pMemoryDataGrid->GetScrollPixelsPerUnit(&scrollRateX, &scrollRateY);
    m_pMemoryDataGrid->SetScrollRate(scrollRateX, m_pMemoryDataGrid->GetDefaultRowSize());

    wxStaticBoxSizer* pMemoryInfoSizer = new wxStaticBoxSizer( new wxStaticBox( m_pMemoryPanel, wxID_ANY, wxT("内存信息") ), wxVERTICAL);

    wxBoxSizer* p1stRowSizer = new wxBoxSizer(wxHORIZONTAL);
    m_pTotalAllocSizeLabel = new wxStaticText( m_pMemoryPanel, wxID_ANY, wxT("总共申请内存:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_pTotalAllocSizeLabel->Wrap( -1 );
    p1stRowSizer->Add(m_pTotalAllocSizeLabel, 1, wxBottom, 5);

    m_pAllocCountLabel = new wxStaticText(m_pMemoryPanel, wxID_ANY, wxT("内存块数量:"), wxDefaultPosition, wxDefaultSize, 0);
    m_pAllocCountLabel->Wrap( -1 );
    p1stRowSizer->Add(m_pAllocCountLabel, 1, wxBottom, 5);

    m_pMaxAllocSizeLabel = new wxStaticText(m_pMemoryPanel, wxID_ANY, wxT("最大内存块:"), wxDefaultPosition, wxDefaultSize, 0);
    m_pMaxAllocSizeLabel->Wrap( -1 );
    p1stRowSizer->Add(m_pMaxAllocSizeLabel, 1, wxBottom, 5);

    wxStaticText* pStackOffsetLabel = new wxStaticText(m_pMemoryPanel, wxID_ANY, wxT("栈信息偏移:"), wxDefaultPosition, wxDefaultSize, 0);
    pStackOffsetLabel->Wrap( -1 );
    p1stRowSizer->Add(pStackOffsetLabel, 0, wxBottom, 5);
    m_pStackOffsetTextCtrl = new wxTextCtrl(m_pMemoryPanel, wxID_ANY, _T("0"), wxDefaultPosition, wxSize(18, 18));
    m_pStackOffsetTextCtrl->SetEditable(false);
    p1stRowSizer->Add(m_pStackOffsetTextCtrl, 0, wxTop, 5);
    m_pStackOffsetSpinBtn = new wxSpinButton(m_pMemoryPanel, wxID_ANY, wxDefaultPosition, wxSize(10, 18));
    p1stRowSizer->Add(m_pStackOffsetSpinBtn, 0, wxTop, 5);

    p1stRowSizer->Add(0, 0, 1, wxEXPAND, 5);
    pMemoryInfoSizer->Add(p1stRowSizer, 1, wxEXPAND, 5);

    wxStaticBoxSizer* pMemoryCallStackSizer = new wxStaticBoxSizer( new wxStaticBox( m_pMemoryPanel, wxID_ANY, wxT("栈信息") ), wxVERTICAL);
    m_pCallStackListBox = new wxListBox( m_pMemoryPanel, wxID_ANY, wxDefaultPosition, wxSize(350, 400), 0, NULL, 0 );
    pMemoryCallStackSizer->Add(m_pCallStackListBox, 1, wxEXPAND, 5);

    pMemoryInfoSizer->Add(pMemoryCallStackSizer, 1, wxEXPAND, 5);

    pMemorySizer->Add( pMemoryInfoSizer, 0, wxEXPAND, 5 );

    m_pMemoryPanel->SetSizerAndFit( pMemorySizer );
    m_pMemoryPanel->Layout();
    OnViewMemoryByLocation();
    m_pNoteBook->AddPage( m_pMemoryPanel, wxT("内存统计"), false );

    m_pMemoryViewChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( CBDTWxFrame::OnMemoryChoiceChanged ), NULL, this );
    m_pFilterTextComboBox->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( CBDTWxFrame::OnFilterTextEnter ), NULL, this );
    m_pFilterTextComboBox->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( CBDTWxFrame::OnFilterTextSelected ), NULL, this );
    m_pMemoryDataGrid->Connect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( CBDTWxFrame::OnGridCellSelected ), NULL, this );
    m_pStackOffsetSpinBtn->Connect(wxEVT_SPIN, wxSpinEventHandler( CBDTWxFrame::OnSetMemoryStackOffset ), NULL, this);
    m_pCallStackListBox->Connect(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler(CBDTWxFrame::OnCallStackListDoubleClicked), NULL, this);
}
Exemplo n.º 21
0
EventFrameBase::EventFrameBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxSize( -1,-1 ), wxSize( -1,-1 ) );
	
	wxBoxSizer* MainSizer;
	MainSizer = new wxBoxSizer( wxVERTICAL );
	
	MainPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* MainPanelSizer;
	MainPanelSizer = new wxBoxSizer( wxVERTICAL );
	
	Notebook = new wxNotebook( MainPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
	GeneralPanel = new wxPanel( Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* GeneralPanelSizer;
	GeneralPanelSizer = new wxBoxSizer( wxVERTICAL );
	
	wxFlexGridSizer* GeneralSizer;
	GeneralSizer = new wxFlexGridSizer( 6, 2, 8, 8 );
	GeneralSizer->AddGrowableCol( 1 );
	GeneralSizer->AddGrowableRow( 5 );
	GeneralSizer->SetFlexibleDirection( wxBOTH );
	GeneralSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	SummaryLabel = new wxStaticText( GeneralPanel, wxID_ANY, _("Summary:"), wxDefaultPosition, wxDefaultSize, 0 );
	SummaryLabel->Wrap( -1 );
	GeneralSizer->Add( SummaryLabel, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	SummaryText = new wxTextCtrl( GeneralPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	GeneralSizer->Add( SummaryText, 1, wxEXPAND, 5 );
	
	CategoriesLabel = new wxStaticText( GeneralPanel, wxID_ANY, _("Categories:"), wxDefaultPosition, wxDefaultSize, 0 );
	CategoriesLabel->Wrap( -1 );
	GeneralSizer->Add( CategoriesLabel, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	CategoriesText = new wxTextCtrl( GeneralPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	GeneralSizer->Add( CategoriesText, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
	
	StartLabel = new wxStaticText( GeneralPanel, wxID_ANY, _("Start:"), wxDefaultPosition, wxDefaultSize, 0 );
	StartLabel->Wrap( -1 );
	GeneralSizer->Add( StartLabel, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	wxBoxSizer* StartSizer;
	StartSizer = new wxBoxSizer( wxHORIZONTAL );
	
	StartDatePicker = new wxDatePickerCtrl( GeneralPanel, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxSize( 130,-1 ), wxDP_DROPDOWN );
	StartSizer->Add( StartDatePicker, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	StartHourSpinCtrl = new wxSpinCtrl( GeneralPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 45,-1 ), wxSP_ARROW_KEYS|wxSP_WRAP, 0, 23, 0 );
	StartHourSpinCtrl->Enable( false );
	
	StartSizer->Add( StartHourSpinCtrl, 0, wxLEFT|wxALIGN_CENTER_VERTICAL, 8 );
	
	StartMinuteSpinCtrl = new wxSpinCtrl( GeneralPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 45,-1 ), wxSP_ARROW_KEYS|wxSP_WRAP, 0, 59, 0 );
	StartMinuteSpinCtrl->Enable( false );
	
	StartSizer->Add( StartMinuteSpinCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	
	StartSizer->Add( 0, 0, 1, wxEXPAND, 5 );
	
	SpecificTimeCheckBox = new wxCheckBox( GeneralPanel, wxID_ANY, _("Specific time"), wxDefaultPosition, wxDefaultSize, 0 );
	
	StartSizer->Add( SpecificTimeCheckBox, 0, wxALIGN_CENTER_VERTICAL, 8 );
	
	GeneralSizer->Add( StartSizer, 1, wxEXPAND, 5 );
	
	EndDateCheckBox = new wxCheckBox( GeneralPanel, wxID_ANY, _("End:"), wxDefaultPosition, wxDefaultSize, 0 );
	
	GeneralSizer->Add( EndDateCheckBox, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	wxBoxSizer* EndSizer;
	EndSizer = new wxBoxSizer( wxHORIZONTAL );
	
	EndDatePicker = new wxDatePickerCtrl( GeneralPanel, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxSize( 130,-1 ), wxDP_DROPDOWN );
	EndDatePicker->Enable( false );
	
	EndSizer->Add( EndDatePicker, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	EndHourSpinCtrl = new wxSpinCtrl( GeneralPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 45,-1 ), wxSP_ARROW_KEYS|wxSP_WRAP, 0, 23, 0 );
	EndHourSpinCtrl->Enable( false );
	
	EndSizer->Add( EndHourSpinCtrl, 0, wxLEFT|wxALIGN_CENTER_VERTICAL, 8 );
	
	EndMinuteSpinCtrl = new wxSpinCtrl( GeneralPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 45,-1 ), wxSP_ARROW_KEYS|wxSP_WRAP, 0, 59, 0 );
	EndMinuteSpinCtrl->Enable( false );
	
	EndSizer->Add( EndMinuteSpinCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	GeneralSizer->Add( EndSizer, 1, wxEXPAND, 5 );
	
	RecurrenceLabel = new wxStaticText( GeneralPanel, wxID_ANY, _("Recurrence:"), wxDefaultPosition, wxDefaultSize, 0 );
	RecurrenceLabel->Wrap( -1 );
	GeneralSizer->Add( RecurrenceLabel, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	wxBoxSizer* RecurrenceSizer;
	RecurrenceSizer = new wxBoxSizer( wxHORIZONTAL );
	
	RepeatCheckBox = new wxCheckBox( GeneralPanel, wxID_ANY, _("Repeat every"), wxDefaultPosition, wxDefaultSize, 0 );
	
	RecurrenceSizer->Add( RepeatCheckBox, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
	
	IntervalSpinCtrl = new wxSpinCtrl( GeneralPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 45,-1 ), wxSP_ARROW_KEYS, 0, 999, 1 );
	IntervalSpinCtrl->Enable( false );
	
	RecurrenceSizer->Add( IntervalSpinCtrl, 0, wxALIGN_CENTER_VERTICAL, 8 );
	
	wxString FrequencyChoiceChoices[] = { _("year(s)"), _("month(s)"), _("week(s)"), _("day(s)"), _("hour(s)"), _("minute(s)") };
	int FrequencyChoiceNChoices = sizeof( FrequencyChoiceChoices ) / sizeof( wxString );
	FrequencyChoice = new wxChoice( GeneralPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, FrequencyChoiceNChoices, FrequencyChoiceChoices, 0 );
	FrequencyChoice->SetSelection( 0 );
	FrequencyChoice->Enable( false );
	
	RecurrenceSizer->Add( FrequencyChoice, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 8 );
	
	
	RecurrenceSizer->Add( 0, 0, 1, wxEXPAND, 5 );
	
	UntilCheckBox = new wxCheckBox( GeneralPanel, wxID_ANY, _("Until"), wxDefaultPosition, wxDefaultSize, 0 );
	
	UntilCheckBox->Enable( false );
	
	RecurrenceSizer->Add( UntilCheckBox, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	UntilDatePicker = new wxDatePickerCtrl( GeneralPanel, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxSize( 130,-1 ), wxDP_DROPDOWN );
	UntilDatePicker->Enable( false );
	
	RecurrenceSizer->Add( UntilDatePicker, 0, wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
	
	GeneralSizer->Add( RecurrenceSizer, 1, wxEXPAND, 5 );
	
	DesciptionLabel = new wxStaticText( GeneralPanel, wxID_ANY, _("Description:"), wxDefaultPosition, wxDefaultSize, 0 );
	DesciptionLabel->Wrap( -1 );
	GeneralSizer->Add( DesciptionLabel, 0, 0, 5 );
	
	DescriptionText = new wxTextCtrl( GeneralPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
	GeneralSizer->Add( DescriptionText, 1, wxEXPAND, 5 );
	
	GeneralPanelSizer->Add( GeneralSizer, 1, wxALL|wxEXPAND, 12 );
	
	GeneralPanel->SetSizer( GeneralPanelSizer );
	GeneralPanel->Layout();
	GeneralPanelSizer->Fit( GeneralPanel );
	Notebook->AddPage( GeneralPanel, _("General"), true );
	AlarmsPanel = new wxPanel( Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* GeneralAlarmsSizer;
	GeneralAlarmsSizer = new wxBoxSizer( wxHORIZONTAL );
	
	wxBoxSizer* AlarmsListSizer;
	AlarmsListSizer = new wxBoxSizer( wxVERTICAL );
	
	AlarmsList = new wxListCtrl( AlarmsPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_NO_HEADER|wxLC_REPORT|wxLC_SINGLE_SEL|wxSUNKEN_BORDER );
	AlarmsListSizer->Add( AlarmsList, 1, wxBOTTOM|wxEXPAND, 8 );
	
	wxBoxSizer* AlarmsButtonsSizer;
	AlarmsButtonsSizer = new wxBoxSizer( wxHORIZONTAL );
	
	AddAlarmButton = new wxButton( AlarmsPanel, wxID_ANY, _("&Add"), wxDefaultPosition, wxDefaultSize, 0 );
	AlarmsButtonsSizer->Add( AddAlarmButton, 0, 0, 5 );
	
	DeleteAlaramButton = new wxButton( AlarmsPanel, wxID_ANY, _("&Delete"), wxDefaultPosition, wxDefaultSize, 0 );
	DeleteAlaramButton->Enable( false );
	
	AlarmsButtonsSizer->Add( DeleteAlaramButton, 0, wxLEFT, 5 );
	
	AlarmsListSizer->Add( AlarmsButtonsSizer, 0, wxEXPAND, 5 );
	
	GeneralAlarmsSizer->Add( AlarmsListSizer, 0, wxALL|wxEXPAND, 12 );
	
	AlarmPropertiesPanel = new wxPanel( AlarmsPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* AlarmPropertiesSizer;
	AlarmPropertiesSizer = new wxBoxSizer( wxVERTICAL );
	
	wxFlexGridSizer* AlarmPropertiesSubSizer;
	AlarmPropertiesSubSizer = new wxFlexGridSizer( 2, 2, 8, 8 );
	AlarmPropertiesSubSizer->AddGrowableCol( 1 );
	AlarmPropertiesSubSizer->SetFlexibleDirection( wxBOTH );
	AlarmPropertiesSubSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	AlarmTypeLabel = new wxStaticText( AlarmPropertiesPanel, wxID_ANY, _("Type:"), wxDefaultPosition, wxDefaultSize, 0 );
	AlarmTypeLabel->Wrap( -1 );
	AlarmPropertiesSubSizer->Add( AlarmTypeLabel, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	wxString AlarmTypeChoiceChoices[] = { _("Pop-up window"), _("Taskbar icon"), _("Sound") };
	int AlarmTypeChoiceNChoices = sizeof( AlarmTypeChoiceChoices ) / sizeof( wxString );
	AlarmTypeChoice = new wxChoice( AlarmPropertiesPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, AlarmTypeChoiceNChoices, AlarmTypeChoiceChoices, 0 );
	AlarmTypeChoice->SetSelection( 0 );
	AlarmPropertiesSubSizer->Add( AlarmTypeChoice, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	AlarmTriggerLabel = new wxStaticText( AlarmPropertiesPanel, wxID_ANY, _("Trigger:"), wxDefaultPosition, wxDefaultSize, 0 );
	AlarmTriggerLabel->Wrap( -1 );
	AlarmPropertiesSubSizer->Add( AlarmTriggerLabel, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	wxBoxSizer* AlarmTriggerSizer;
	AlarmTriggerSizer = new wxBoxSizer( wxHORIZONTAL );
	
	AlarmTriggerSpinCtrl = new wxSpinCtrl( AlarmPropertiesPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 50,-1 ), wxSP_ARROW_KEYS, 0, 999, 0 );
	AlarmTriggerSizer->Add( AlarmTriggerSpinCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	wxString AlarmTriggerUnitChoiceChoices[] = { _("minute(s)"), _("hour(s)"), _("day(s)"), _("week(s)") };
	int AlarmTriggerUnitChoiceNChoices = sizeof( AlarmTriggerUnitChoiceChoices ) / sizeof( wxString );
	AlarmTriggerUnitChoice = new wxChoice( AlarmPropertiesPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, AlarmTriggerUnitChoiceNChoices, AlarmTriggerUnitChoiceChoices, 0 );
	AlarmTriggerUnitChoice->SetSelection( 0 );
	AlarmTriggerSizer->Add( AlarmTriggerUnitChoice, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 8 );
	
	wxString AlarmBeforeAfterChoiceChoices[] = { _("before"), _("after") };
	int AlarmBeforeAfterChoiceNChoices = sizeof( AlarmBeforeAfterChoiceChoices ) / sizeof( wxString );
	AlarmBeforeAfterChoice = new wxChoice( AlarmPropertiesPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, AlarmBeforeAfterChoiceNChoices, AlarmBeforeAfterChoiceChoices, 0 );
	AlarmBeforeAfterChoice->SetSelection( 0 );
	AlarmTriggerSizer->Add( AlarmBeforeAfterChoice, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 8 );
	
	AlarmTriggerLabel2 = new wxStaticText( AlarmPropertiesPanel, wxID_ANY, _("the start"), wxDefaultPosition, wxDefaultSize, 0 );
	AlarmTriggerLabel2->Wrap( -1 );
	AlarmTriggerSizer->Add( AlarmTriggerLabel2, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	AlarmPropertiesSubSizer->Add( AlarmTriggerSizer, 0, wxEXPAND, 5 );
	
	AlarmPropertiesSizer->Add( AlarmPropertiesSubSizer, 0, wxEXPAND|wxBOTTOM, 12 );
	
	AlarmDescriptionLabel = new wxStaticText( AlarmPropertiesPanel, wxID_ANY, _("Additional alarm description:"), wxDefaultPosition, wxDefaultSize, 0 );
	AlarmDescriptionLabel->Wrap( -1 );
	AlarmPropertiesSizer->Add( AlarmDescriptionLabel, 0, wxBOTTOM, 5 );
	
	AlarmDescriptionText = new wxTextCtrl( AlarmPropertiesPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
	AlarmPropertiesSizer->Add( AlarmDescriptionText, 1, wxEXPAND, 12 );
	
	AlarmPropertiesPanel->SetSizer( AlarmPropertiesSizer );
	AlarmPropertiesPanel->Layout();
	AlarmPropertiesSizer->Fit( AlarmPropertiesPanel );
	GeneralAlarmsSizer->Add( AlarmPropertiesPanel, 1, wxTOP|wxBOTTOM|wxRIGHT|wxEXPAND, 12 );
	
	AlarmsPanel->SetSizer( GeneralAlarmsSizer );
	AlarmsPanel->Layout();
	GeneralAlarmsSizer->Fit( AlarmsPanel );
	Notebook->AddPage( AlarmsPanel, _("Alarms"), false );
	
	MainPanelSizer->Add( Notebook, 1, wxALL|wxEXPAND, 8 );
	
	ButtonsSizer = new wxStdDialogButtonSizer();
	ButtonsSizerOK = new wxButton( MainPanel, wxID_OK );
	ButtonsSizer->AddButton( ButtonsSizerOK );
	ButtonsSizerCancel = new wxButton( MainPanel, wxID_CANCEL );
	ButtonsSizer->AddButton( ButtonsSizerCancel );
	ButtonsSizer->Realize();
	MainPanelSizer->Add( ButtonsSizer, 0, wxBOTTOM|wxRIGHT|wxEXPAND, 8 );
	
	MainPanel->SetSizer( MainPanelSizer );
	MainPanel->Layout();
	MainPanelSizer->Fit( MainPanel );
	MainSizer->Add( MainPanel, 1, wxEXPAND, 5 );
	
	this->SetSizer( MainSizer );
	this->Layout();
	
	// Connect Events
	this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( EventFrameBase::Closed ) );
	SpecificTimeCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( EventFrameBase::SpecificTimeCheckBoxClicked ), NULL, this );
	EndDateCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( EventFrameBase::EndDateCheckBoxClicked ), NULL, this );
	RepeatCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( EventFrameBase::RepeatCheckBoxClicked ), NULL, this );
	UntilCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( EventFrameBase::UntilCheckBoxClicked ), NULL, this );
	AlarmsList->Connect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( EventFrameBase::AlarmDeselected ), NULL, this );
	AlarmsList->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( EventFrameBase::AlarmSelected ), NULL, this );
	AddAlarmButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( EventFrameBase::AddAlarmClicked ), NULL, this );
	DeleteAlaramButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( EventFrameBase::DeleteAlarmClicked ), NULL, this );
	AlarmTypeChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( EventFrameBase::AlarmTypeChanged ), NULL, this );
	AlarmTriggerSpinCtrl->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( EventFrameBase::AlarmTriggerChanged ), NULL, this );
	AlarmTriggerUnitChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( EventFrameBase::AlarmTriggerUnitChanged ), NULL, this );
	AlarmBeforeAfterChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( EventFrameBase::AlarmBeforeAfterChanged ), NULL, this );
	ButtonsSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( EventFrameBase::CancelClicked ), NULL, this );
	ButtonsSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( EventFrameBase::OKClicked ), NULL, this );
}
Exemplo n.º 22
0
ItemEditorFrameUI::ItemEditorFrameUI( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* bSizer1;
	bSizer1 = new wxBoxSizer( wxHORIZONTAL );
	
	m_splitter2 = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_LIVE_UPDATE );
	m_splitter2->SetSashGravity( 1 );
	m_splitter2->Connect( wxEVT_IDLE, wxIdleEventHandler( ItemEditorFrameUI::m_splitter2OnIdle ), NULL, this );
	
	m_panel6 = new wxPanel( m_splitter2, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer21;
	bSizer21 = new wxBoxSizer( wxVERTICAL );
	
	m_splitter1 = new wxSplitterWindow( m_panel6, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_LIVE_UPDATE );
	m_splitter1->Connect( wxEVT_IDLE, wxIdleEventHandler( ItemEditorFrameUI::m_splitter1OnIdle ), NULL, this );
	m_splitter1->SetMinimumPaneSize( 1 );
	
	m_panel4 = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer7;
	bSizer7 = new wxBoxSizer( wxVERTICAL );
	
	m_ItemListCtrl = new wxListCtrl( m_panel4, ID_ItemListCtrl, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL );
	bSizer7->Add( m_ItemListCtrl, 1, wxALL|wxEXPAND, 5 );
	
	wxArrayString m_ItemTypeChoiceChoices;
	m_ItemTypeChoice = new wxChoice( m_panel4, ID_ItemTypeChoice, wxDefaultPosition, wxDefaultSize, m_ItemTypeChoiceChoices, 0 );
	m_ItemTypeChoice->SetSelection( 0 );
	bSizer7->Add( m_ItemTypeChoice, 0, wxALL|wxEXPAND, 5 );
	
	wxArrayString m_BoneChoiceChoices;
	m_BoneChoice = new wxChoice( m_panel4, ID_BoneChoice, wxDefaultPosition, wxDefaultSize, m_BoneChoiceChoices, 0 );
	m_BoneChoice->SetSelection( 0 );
	bSizer7->Add( m_BoneChoice, 0, wxALL|wxEXPAND, 5 );
	
	wxBoxSizer* bSizer8;
	bSizer8 = new wxBoxSizer( wxHORIZONTAL );
	
	m_NewItemButton = new wxButton( m_panel4, ID_NewItemButton, wxT("new"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer8->Add( m_NewItemButton, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	m_ModifyButton = new wxButton( m_panel4, ID_ModifyButton, wxT("Modify"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer8->Add( m_ModifyButton, 1, wxALL, 5 );
	
	bSizer7->Add( bSizer8, 0, wxEXPAND, 5 );
	
	m_staticline2 = new wxStaticLine( m_panel4, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
	bSizer7->Add( m_staticline2, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
	
	m_panel4->SetSizer( bSizer7 );
	m_panel4->Layout();
	bSizer7->Fit( m_panel4 );
	m_EditPanel = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer5;
	bSizer5 = new wxBoxSizer( wxVERTICAL );
	
	wxBoxSizer* bSizer4;
	bSizer4 = new wxBoxSizer( wxHORIZONTAL );
	
	wxStaticText* m_staticText1;
	m_staticText1 = new wxStaticText( m_EditPanel, wxID_ANY, wxT("Name"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText1->Wrap( -1 );
	bSizer4->Add( m_staticText1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_ItemNameTextCtrl = new wxTextCtrl( m_EditPanel, ID_ItemNameTextCtrl, wxEmptyString, wxDefaultPosition, wxSize( 200,-1 ), wxTE_PROCESS_ENTER );
	bSizer4->Add( m_ItemNameTextCtrl, 1, wxALL|wxEXPAND, 5 );
	
	m_staticText12 = new wxStaticText( m_EditPanel, wxID_ANY, wxT("CD time"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText12->Wrap( -1 );
	bSizer4->Add( m_staticText12, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_CDTimeTCtrl = new wxTextCtrl( m_EditPanel, ID_CDTimeTCtrl, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_PROCESS_ENTER );
	bSizer4->Add( m_CDTimeTCtrl, 0, wxALL, 5 );
	
	bSizer5->Add( bSizer4, 0, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer3;
	bSizer3 = new wxBoxSizer( wxHORIZONTAL );
	
	wxStaticText* m_staticText4;
	m_staticText4 = new wxStaticText( m_EditPanel, wxID_ANY, wxT("BuyCast"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText4->Wrap( -1 );
	bSizer3->Add( m_staticText4, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
	
	m_BuyCastSpin = new wxSpinCtrl( m_EditPanel, ID_BuyCastSpin, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 999999, 1 );
	bSizer3->Add( m_BuyCastSpin, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 3 );
	
	wxStaticText* m_staticText41;
	m_staticText41 = new wxStaticText( m_EditPanel, wxID_ANY, wxT("SellCast"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText41->Wrap( -1 );
	bSizer3->Add( m_staticText41, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 3 );
	
	m_SellCastSpin = new wxSpinCtrl( m_EditPanel, ID_SellCastSpin, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 999999, 3 );
	bSizer3->Add( m_SellCastSpin, 1, wxBOTTOM|wxRIGHT|wxLEFT, 3 );
	
	wxStaticText* m_staticText3;
	m_staticText3 = new wxStaticText( m_EditPanel, wxID_ANY, wxT("MaxSoltNum"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText3->Wrap( -1 );
	bSizer3->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 3 );
	
	m_MaxSoltNumSpin = new wxSpinCtrl( m_EditPanel, ID_MaxSoltNumSpin, wxEmptyString, wxDefaultPosition, wxSize( 50,-1 ), wxSP_ARROW_KEYS, 0, 255, 0 );
	bSizer3->Add( m_MaxSoltNumSpin, 0, wxBOTTOM|wxRIGHT|wxLEFT, 3 );
	
	bSizer5->Add( bSizer3, 0, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer18;
	bSizer18 = new wxBoxSizer( wxHORIZONTAL );
	
	wxStaticBoxSizer* sbSizer31;
	sbSizer31 = new wxStaticBoxSizer( new wxStaticBox( m_EditPanel, wxID_ANY, wxT("Icon") ), wxVERTICAL );
	
	m_IconCBox = new wxBitmapComboBox( m_EditPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 100,-1 ), 0, NULL, wxCB_READONLY ); 
	sbSizer31->Add( m_IconCBox, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
	
	wxBoxSizer* bSizer17;
	bSizer17 = new wxBoxSizer( wxHORIZONTAL );
	
	m_AddIconButton = new wxButton( m_EditPanel, ID_AddIconButton, wxT("Add"), wxDefaultPosition, wxSize( 45,-1 ), 0 );
	bSizer17->Add( m_AddIconButton, 0, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 3 );
	
	m_DelIconButton = new wxButton( m_EditPanel, ID_DelIconButton, wxT("Delete"), wxDefaultPosition, wxSize( 45,-1 ), 0 );
	bSizer17->Add( m_DelIconButton, 0, wxALIGN_RIGHT|wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 3 );
	
	m_ModifyIconButton = new wxButton( m_EditPanel, ID_ModifyIconButton, wxT("Modify"), wxDefaultPosition, wxSize( 45,-1 ), 0 );
	bSizer17->Add( m_ModifyIconButton, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 3 );
	
	sbSizer31->Add( bSizer17, 0, wxEXPAND, 5 );
	
	bSizer18->Add( sbSizer31, 0, 0, 5 );
	
	m_HelpStrTCtrl = new wxTextCtrl( m_EditPanel, ID_HelpStrTCtrl, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_LEFT|wxTE_MULTILINE|wxTE_PROCESS_ENTER );
	bSizer18->Add( m_HelpStrTCtrl, 1, wxALL|wxEXPAND, 5 );
	
	bSizer5->Add( bSizer18, 0, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer9;
	bSizer9 = new wxBoxSizer( wxHORIZONTAL );
	
	m_PMListCtrl = new wxListCtrl( m_EditPanel, ID_PMListCtrl, wxDefaultPosition, wxSize( -1,150 ), wxLC_REPORT|wxLC_SINGLE_SEL );
	bSizer9->Add( m_PMListCtrl, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
	
	wxBoxSizer* bSizer11;
	bSizer11 = new wxBoxSizer( wxVERTICAL );
	
	m_PMAddButton = new wxButton( m_EditPanel, ID_PMAddButton, wxT("Add"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer11->Add( m_PMAddButton, 0, wxALL, 3 );
	
	m_PMRemoveButton = new wxButton( m_EditPanel, ID_PMRemoveButton, wxT("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer11->Add( m_PMRemoveButton, 0, wxALL, 3 );
	
	m_PMModifyButton = new wxButton( m_EditPanel, ID_PMModifyButton, wxT("Edit"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer11->Add( m_PMModifyButton, 0, wxALL, 3 );
	
	bSizer9->Add( bSizer11, 0, wxEXPAND, 5 );
	
	bSizer5->Add( bSizer9, 0, wxEXPAND, 5 );
	
	m_staticline1 = new wxStaticLine( m_EditPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
	bSizer5->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
	
	m_EquimentPanel = new wxPanel( m_EditPanel, ID_EquimentPanel, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxStaticBoxSizer* sbSizer3;
	sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( m_EquimentPanel, wxID_ANY, wxT("Equipment") ), wxVERTICAL );
	
	wxBoxSizer* bSizer23;
	bSizer23 = new wxBoxSizer( wxHORIZONTAL );
	
	wxStaticText* m_staticText9;
	m_staticText9 = new wxStaticText( m_EquimentPanel, wxID_ANY, wxT("Equip Value"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText9->Wrap( -1 );
	bSizer23->Add( m_staticText9, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_EquipValSpin = new wxSpinCtrl( m_EquimentPanel, ID_EquipValSpin, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 9999, 2 );
	bSizer23->Add( m_EquipValSpin, 0, wxALL, 5 );
	
	wxStaticText* m_staticText10;
	m_staticText10 = new wxStaticText( m_EquimentPanel, wxID_ANY, wxT("Equip Solt"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText10->Wrap( -1 );
	bSizer23->Add( m_staticText10, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	wxArrayString m_EquipSoltChoiceChoices;
	m_EquipSoltChoice = new wxChoice( m_EquimentPanel, ID_EquipSoltChoice, wxDefaultPosition, wxDefaultSize, m_EquipSoltChoiceChoices, 0 );
	m_EquipSoltChoice->SetSelection( 0 );
	bSizer23->Add( m_EquipSoltChoice, 1, wxALL|wxEXPAND, 5 );
	
	sbSizer3->Add( bSizer23, 1, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer24;
	bSizer24 = new wxBoxSizer( wxHORIZONTAL );
	
	wxStaticText* m_staticText131;
	m_staticText131 = new wxStaticText( m_EquimentPanel, wxID_ANY, wxT("Model Name"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText131->Wrap( -1 );
	bSizer24->Add( m_staticText131, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_ModelNameTCtrl = new wxTextCtrl( m_EquimentPanel, ID_ModelNameTCtrl, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_LEFT|wxTE_READONLY );
	bSizer24->Add( m_ModelNameTCtrl, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );
	
	m_button17 = new wxButton( m_EquimentPanel, wxID_ANY, wxT(".."), wxDefaultPosition, wxSize( 20,-1 ), 0 );
	bSizer24->Add( m_button17, 0, wxTOP|wxBOTTOM, 5 );
	
	m_button18 = new wxButton( m_EquimentPanel, wxID_ANY, wxT("D"), wxDefaultPosition, wxSize( 20,-1 ), 0 );
	bSizer24->Add( m_button18, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
	
	m_staticText16 = new wxStaticText( m_EquimentPanel, wxID_ANY, wxT("Scale"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText16->Wrap( -1 );
	bSizer24->Add( m_staticText16, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_ScaleTCtrl = new wxTextCtrl( m_EquimentPanel, ID_ScaleTCtrl, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	bSizer24->Add( m_ScaleTCtrl, 0, wxALL, 5 );
	
	m_EditModelCBox = new wxCheckBox( m_EquimentPanel, ID_EditModelCBox, wxT("Edit Model"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer24->Add( m_EditModelCBox, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	sbSizer3->Add( bSizer24, 0, wxEXPAND, 5 );
	
	m_EquimentPanel->SetSizer( sbSizer3 );
	m_EquimentPanel->Layout();
	sbSizer3->Fit( m_EquimentPanel );
	bSizer5->Add( m_EquimentPanel, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
	
	m_WeaponPanel = new wxPanel( m_EditPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxStaticBoxSizer* sbSizer1;
	sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( m_WeaponPanel, wxID_ANY, wxT("Weapon") ), wxHORIZONTAL );
	
	m_staticText13 = new wxStaticText( m_WeaponPanel, wxID_ANY, wxT("WeaponType"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText13->Wrap( -1 );
	sbSizer1->Add( m_staticText13, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	wxArrayString m_WeaponTypeChoiceChoices;
	m_WeaponTypeChoice = new wxChoice( m_WeaponPanel, ID_WeaponTypeChoice, wxDefaultPosition, wxDefaultSize, m_WeaponTypeChoiceChoices, 0 );
	m_WeaponTypeChoice->SetSelection( 0 );
	sbSizer1->Add( m_WeaponTypeChoice, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_WeaponPanel->SetSizer( sbSizer1 );
	m_WeaponPanel->Layout();
	sbSizer1->Fit( m_WeaponPanel );
	bSizer5->Add( m_WeaponPanel, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
	
	m_EditPanel->SetSizer( bSizer5 );
	m_EditPanel->Layout();
	bSizer5->Fit( m_EditPanel );
	m_splitter1->SplitVertically( m_panel4, m_EditPanel, 0 );
	bSizer21->Add( m_splitter1, 1, wxEXPAND, 5 );
	
	m_panel6->SetSizer( bSizer21 );
	m_panel6->Layout();
	bSizer21->Fit( m_panel6 );
	m_DrawPanel = new wxPanel( m_splitter2, ID_DrawPanel, wxDefaultPosition, wxSize( 300,-1 ), wxSTATIC_BORDER|wxTAB_TRAVERSAL );
	m_splitter2->SplitVertically( m_panel6, m_DrawPanel, 0 );
	bSizer1->Add( m_splitter2, 1, wxEXPAND, 5 );
	
	this->SetSizer( bSizer1 );
	this->Layout();
	
	// Connect Events
	m_ItemListCtrl->Connect( wxEVT_COMMAND_LIST_COL_CLICK, wxListEventHandler( ItemEditorFrameUI::OnItemListColClick ), NULL, this );
	m_ItemListCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( ItemEditorFrameUI::OnItemListDeselected ), NULL, this );
	m_ItemListCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, wxListEventHandler( ItemEditorFrameUI::OnItemListRightClick ), NULL, this );
	m_ItemListCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( ItemEditorFrameUI::OnItemListSelected ), NULL, this );
	m_ItemTypeChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( ItemEditorFrameUI::OnItemTypeChoice ), NULL, this );
	m_NewItemButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnNewItemButton ), NULL, this );
	m_ModifyButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnModifyItem ), NULL, this );
	m_ItemNameTextCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_ItemNameTextCtrl->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_CDTimeTCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_CDTimeTCtrl->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_BuyCastSpin->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_BuyCastSpin->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_SellCastSpin->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_SellCastSpin->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_MaxSoltNumSpin->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_MaxSoltNumSpin->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_IconCBox->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_AddIconButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnIconClick ), NULL, this );
	m_DelIconButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnIconClick ), NULL, this );
	m_ModifyIconButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnIconClick ), NULL, this );
	m_HelpStrTCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_HelpStrTCtrl->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_PMListCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( ItemEditorFrameUI::OnPMListDeselected ), NULL, this );
	m_PMListCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( ItemEditorFrameUI::OnPMListSelected ), NULL, this );
	m_PMAddButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnPMAddClick ), NULL, this );
	m_PMRemoveButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnPMRemoveClick ), NULL, this );
	m_PMModifyButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnPMModifyClick ), NULL, this );
	m_EquipValSpin->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_EquipValSpin->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_EquipSoltChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_button17->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnChioceModelClick ), NULL, this );
	m_button18->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnModelNameRemove ), NULL, this );
	m_ScaleTCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_ScaleTCtrl->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_EditModelCBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ItemEditorFrameUI::OnEditModelCheck ), NULL, this );
	m_WeaponTypeChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( ItemEditorFrameUI::OnChangeSetting ), NULL, this );
	m_DrawPanel->Connect( wxEVT_ERASE_BACKGROUND, wxEraseEventHandler( ItemEditorFrameUI::OnDraw ), NULL, this );
	m_DrawPanel->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( ItemEditorFrameUI::OnKeyDown ), NULL, this );
	m_DrawPanel->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Connect( wxEVT_MIDDLE_DOWN, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Connect( wxEVT_MIDDLE_UP, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Connect( wxEVT_RIGHT_UP, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Connect( wxEVT_MOTION, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Connect( wxEVT_MIDDLE_DCLICK, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Connect( wxEVT_RIGHT_DCLICK, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Connect( wxEVT_LEAVE_WINDOW, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( ItemEditorFrameUI::OnDrawPanelMouse ), NULL, this );
	m_DrawPanel->Connect( wxEVT_SIZE, wxSizeEventHandler( ItemEditorFrameUI::OnDrawPanelResize ), NULL, this );
}
Exemplo n.º 23
0
CorrelParamsFrame::CorrelParamsFrame(const CorrelParams& correl_params,
	GdaVarTools::Manager& var_man,
	Project* project_)
: wxFrame((wxWindow*) 0, wxID_ANY, _("Correlogram Parameters"),
					wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE),
CorrelParamsObservable(correl_params, var_man), project(project_),
var_txt(0), var_choice(0), dist_txt(0), dist_choice(0), bins_txt(0),
bins_spn_ctrl(0), thresh_cbx(0), thresh_tctrl(0), thresh_slider(0),
all_pairs_rad(0), est_pairs_txt(0), est_pairs_num_txt(0),
rand_samp_rad(0), max_iter_txt(0), max_iter_tctrl(0),
help_btn(0), apply_btn(0)
{
	wxLogMessage("Entering CorrelParamsFrame::CorrelParamsFrame");
	
	wxPanel* panel = new wxPanel(this);
	panel->SetBackgroundColour(*wxWHITE);
	SetBackgroundColour(*wxWHITE);
	{
		var_txt = new wxStaticText(panel, XRCID("ID_VAR_TXT"), _("Variable:"));
		var_choice = new wxChoice(panel, XRCID("ID_VAR_CHOICE"),
                                  wxDefaultPosition,wxSize(80,-1));
		wxString var_nm = "";
		if (var_man.GetVarsCount() > 0)
            var_nm = var_man.GetName(0);
        
        var_time_txt = new wxStaticText(panel, XRCID("ID_VAR_TIME_TXT"), _("Time:"));
        var_time_choice = new wxChoice(panel, XRCID("ID_VAR_TIME_CHOICE"),
                                  wxDefaultPosition,wxSize(80,-1));
        
        Connect(XRCID("ID_VAR_TIME_CHOICE"), wxEVT_CHOICE,
                wxCommandEventHandler(CorrelParamsFrame::OnTime1));
        
        is_time = project->GetTableInt()->IsTimeVariant();
        time_steps = project->GetTableInt()->GetTimeSteps();
        for (int i=0; i<time_steps; i++) {
            wxString s;
            s << project->GetTableInt()->GetTimeString(i);
            var_time_choice->Append(s);
        }
        if (is_time == false) {
            v1_time = 0;
            var_time_txt->Hide();
            var_time_choice->Hide();
        } else {
            v1_time = 0;
            var_time_choice->SetSelection(v1_time);
        }
        
        UpdateVarChoiceFromTable(var_nm);
        Connect(XRCID("ID_VAR_CHOICE"), wxEVT_CHOICE,
                wxCommandEventHandler(CorrelParamsFrame::OnVarChoiceSelected));
	}
	wxBoxSizer* var_h_szr = new wxBoxSizer(wxHORIZONTAL);
	var_h_szr->Add(var_txt, 0, wxALIGN_CENTER_VERTICAL);
	var_h_szr->AddSpacer(5);
	var_h_szr->Add(var_choice, 0, wxALIGN_CENTER_VERTICAL);
    var_h_szr->AddSpacer(5);
    var_h_szr->Add(var_time_txt, 0, wxALIGN_CENTER_VERTICAL);
    var_h_szr->AddSpacer(5);
    var_h_szr->Add(var_time_choice, 0, wxALIGN_CENTER_VERTICAL);
	
	dist_txt = new wxStaticText(panel, XRCID("ID_DIST_TXT"), _("Distance:"));
	dist_choice = new wxChoice(panel, XRCID("ID_DIST_CHOICE"),
                               wxDefaultPosition, wxSize(160,-1));
	dist_choice->Append("Euclidean Distance");
	dist_choice->Append("Arc Distance (mi)");
	dist_choice->Append("Arc Distance (km)");
	if (correl_params.dist_metric == WeightsMetaInfo::DM_arc) {
		if (correl_params.dist_units == WeightsMetaInfo::DU_km) {
			dist_choice->SetSelection(2);
		} else {
			dist_choice->SetSelection(1);
		}
	} else {
		dist_choice->SetSelection(0);
	}
    
	Connect(XRCID("ID_DIST_CHOICE"), wxEVT_CHOICE,
            wxCommandEventHandler(CorrelParamsFrame::OnDistanceChoiceSelected));
    
	wxBoxSizer* dist_h_szr = new wxBoxSizer(wxHORIZONTAL);
	dist_h_szr->Add(dist_txt, 0, wxALIGN_CENTER_VERTICAL);
	dist_h_szr->AddSpacer(5);
	dist_h_szr->Add(dist_choice, 0, wxALIGN_CENTER_VERTICAL);
	
	{
		bins_txt = new wxStaticText(panel, XRCID("ID_BINS_TXT"), _("Number Bins:"));
		wxString vs;
		vs << correl_params.bins;
		bins_spn_ctrl = new wxSpinCtrl(panel, XRCID("ID_BINS_SPN_CTRL"),
                                       vs,  wxDefaultPosition, wxSize(75,-1),
                                       wxSP_ARROW_KEYS | wxTE_PROCESS_ENTER,
                                       CorrelParams::min_bins_cnst,
                                       CorrelParams::max_bins_cnst,
                                       correl_params.bins);
        num_bins = correl_params.bins;
		Connect(XRCID("ID_BINS_SPN_CTRL"), wxEVT_SPINCTRL,
                wxSpinEventHandler(CorrelParamsFrame::OnBinsSpinEvent));
		Connect(XRCID("ID_BINS_SPN_CTRL"), wxEVT_TEXT_ENTER,
                wxCommandEventHandler(CorrelParamsFrame::OnBinsTextCtrl));
	}
	wxBoxSizer* bins_h_szr = new wxBoxSizer(wxHORIZONTAL);
	bins_h_szr->Add(bins_txt, 0, wxALIGN_CENTER_VERTICAL);
	bins_h_szr->AddSpacer(5);
	bins_h_szr->Add(bins_spn_ctrl, 0, wxALIGN_CENTER_VERTICAL);
	
	thresh_cbx = new wxCheckBox(panel, XRCID("ID_THRESH_CBX"), _("Max Distance:"));
	thresh_cbx->SetValue(false);
	thresh_tctrl = new wxTextCtrl(panel, XRCID("ID_THRESH_TCTRL"), "",
                                  wxDefaultPosition, wxSize(100,-1),
                                  wxTE_PROCESS_ENTER);
	thresh_tctrl->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
	thresh_tctrl->Enable(false);
	//UpdateThreshTctrlVal();
	Connect(XRCID("ID_THRESH_CBX"), wxEVT_CHECKBOX,
					wxCommandEventHandler(CorrelParamsFrame::OnThreshCheckBox));
	Connect(XRCID("ID_THRESH_TCTRL"), wxEVT_TEXT_ENTER,
					wxCommandEventHandler(CorrelParamsFrame::OnThreshTextCtrl));

	wxBoxSizer* thresh_h_szr = new wxBoxSizer(wxHORIZONTAL);
	thresh_h_szr->Add(thresh_cbx, 0, wxALIGN_CENTER_VERTICAL);
	thresh_h_szr->AddSpacer(5);
	thresh_h_szr->Add(thresh_tctrl, 0, wxALIGN_CENTER_VERTICAL);
    thresh_slider = new wxSlider(panel, XRCID("ID_THRESH_SLDR"),
                                 sldr_tcks/2, 0, sldr_tcks,
                                 wxDefaultPosition, wxSize(180,-1));
    
	Connect(XRCID("ID_THRESH_SLDR"), wxEVT_SLIDER,
					wxCommandEventHandler(CorrelParamsFrame::OnThreshSlider));
    
	thresh_slider->Enable(false);
	wxBoxSizer* thresh_sld_h_szr = new wxBoxSizer(wxHORIZONTAL);
	thresh_sld_h_szr->Add(thresh_slider, 0, wxALIGN_CENTER_VERTICAL);
	wxBoxSizer* thresh_v_szr = new wxBoxSizer(wxVERTICAL);
	thresh_v_szr->Add(thresh_h_szr, 0, wxBOTTOM, 5);
	thresh_v_szr->Add(thresh_sld_h_szr, 0, wxALIGN_CENTER_HORIZONTAL);
	
	all_pairs_rad = new wxRadioButton(panel, XRCID("ID_ALL_PAIRS_RAD"),
                                      _("All Pairs"), wxDefaultPosition,
                                      wxDefaultSize,
                                      wxALIGN_CENTER_VERTICAL | wxRB_GROUP);
	all_pairs_rad->SetValue(correl_params.method == CorrelParams::ALL_PAIRS);
	Connect(XRCID("ID_ALL_PAIRS_RAD"), wxEVT_RADIOBUTTON,
            wxCommandEventHandler(CorrelParamsFrame::OnAllPairsRadioSelected));
    
	est_pairs_txt = new wxStaticText(panel, XRCID("ID_EST_PAIRS_TXT"), _("Estimated Pairs:"));
	est_pairs_num_txt = new wxStaticText(panel, XRCID("ID_EST_PAIRS_NUM_TXT"), "4,000,000");
	wxBoxSizer* est_pairs_h_szr = new wxBoxSizer(wxHORIZONTAL);
	est_pairs_h_szr->Add(est_pairs_txt, 0, wxALIGN_CENTER_VERTICAL);
	est_pairs_h_szr->AddSpacer(5);
	est_pairs_h_szr->Add(est_pairs_num_txt, 0, wxALIGN_CENTER_VERTICAL);
	wxBoxSizer* all_pairs_v_szr = new wxBoxSizer(wxVERTICAL);
	all_pairs_v_szr->Add(all_pairs_rad);
	all_pairs_v_szr->AddSpacer(2);
	all_pairs_v_szr->Add(est_pairs_h_szr, 0, wxLEFT, 18);
	
	rand_samp_rad = new wxRadioButton(panel, XRCID("ID_RAND_SAMP_RAD"), _("Random Sample"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_VERTICAL);
	rand_samp_rad->SetValue(correl_params.method != CorrelParams::ALL_PAIRS);
	Connect(XRCID("ID_RAND_SAMP_RAD"), wxEVT_RADIOBUTTON, wxCommandEventHandler(CorrelParamsFrame::OnRandSampRadioSelected));
	max_iter_txt = new wxStaticText(panel, XRCID("ID_MAX_ITER_TXT"), _("Sample Size:"));
	{
		wxString vs;
		vs << correl_params.max_iterations;
		max_iter_tctrl = new wxTextCtrl(panel, XRCID("ID_MAX_ITER_TCTRL"),
                                        vs, wxDefaultPosition,
                                        wxSize(100,-1), wxTE_PROCESS_ENTER);
		max_iter_tctrl->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
		Connect(XRCID("ID_MAX_ITER_TCTRL"), wxEVT_TEXT_ENTER,
                wxCommandEventHandler(CorrelParamsFrame::OnMaxIterTextCtrl));
	}
	wxBoxSizer* max_iter_h_szr = new wxBoxSizer(wxHORIZONTAL);
	max_iter_h_szr->Add(max_iter_txt, 0, wxALIGN_CENTER_VERTICAL);
	max_iter_h_szr->AddSpacer(8);
	max_iter_h_szr->Add(max_iter_tctrl, 0, wxALIGN_CENTER_VERTICAL);
   
	wxBoxSizer* random_opt_h_szr = new wxBoxSizer(wxHORIZONTAL);
    {
        wxStaticText* st17 = new wxStaticText(panel, wxID_ANY, _("Use specified seed:"),
                                              wxDefaultPosition, wxSize(128,-1));
        wxBoxSizer *hbox17 = new wxBoxSizer(wxHORIZONTAL);
        chk_seed = new wxCheckBox(panel, wxID_ANY, "");
        seedButton = new wxButton(panel, wxID_OK, _("Change"), wxDefaultPosition, wxSize(64, -1));
        random_opt_h_szr->Add(st17, 0, wxALIGN_CENTER_VERTICAL);
        random_opt_h_szr->Add(chk_seed,0, wxALIGN_CENTER_VERTICAL);
        random_opt_h_szr->Add(seedButton, 0, wxALIGN_CENTER_VERTICAL);
        if (GdaConst::use_gda_user_seed) {
            chk_seed->SetValue(true);
            seedButton->Enable();
        }
        chk_seed->Bind(wxEVT_CHECKBOX, &CorrelParamsFrame::OnSeedCheck, this);
        seedButton->Bind(wxEVT_BUTTON, &CorrelParamsFrame::OnChangeSeed, this);
    }
    
	wxBoxSizer* rand_samp_v_szr = new wxBoxSizer(wxVERTICAL);
	rand_samp_v_szr->Add(rand_samp_rad);
	rand_samp_v_szr->AddSpacer(2);
	rand_samp_v_szr->Add(max_iter_h_szr, 0, wxLEFT, 12);
	rand_samp_v_szr->Add(random_opt_h_szr, 0, wxLEFT, 12);
		
	help_btn = new wxButton(panel, XRCID("ID_HELP_BTN"), _("Help"),
                            wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
	apply_btn = new wxButton(panel, XRCID("ID_APPLY_BTN"), _("Apply"),
                             wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
    
	Connect(XRCID("ID_HELP_BTN"), wxEVT_BUTTON,
            wxCommandEventHandler(CorrelParamsFrame::OnHelpBtn));
	Connect(XRCID("ID_APPLY_BTN"), wxEVT_BUTTON,
            wxCommandEventHandler(CorrelParamsFrame::OnApplyBtn));
    
	wxBoxSizer* btns_h_szr = new wxBoxSizer(wxHORIZONTAL);
	btns_h_szr->Add(help_btn, 0, wxALIGN_CENTER_VERTICAL);
	btns_h_szr->AddSpacer(15);
	btns_h_szr->Add(apply_btn, 0, wxALIGN_CENTER_VERTICAL);
	
	UpdateEstPairs();
	
	// Arrange above widgets in panel using sizers.
	// Top level panel sizer will be panel_h_szr
	// Below that will be panel_v_szr
	// panel_v_szr will directly receive widgets
	
	wxBoxSizer* panel_v_szr = new wxBoxSizer(wxVERTICAL);
	panel_v_szr->Add(var_h_szr, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
	panel_v_szr->AddSpacer(2);
	panel_v_szr->Add(dist_h_szr, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
	panel_v_szr->AddSpacer(3);
	panel_v_szr->Add(bins_h_szr, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
	panel_v_szr->AddSpacer(3);
	panel_v_szr->Add(thresh_v_szr, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
	panel_v_szr->Add(all_pairs_v_szr, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
	panel_v_szr->AddSpacer(5);
	panel_v_szr->Add(rand_samp_v_szr, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
	panel_v_szr->AddSpacer(10);
	panel_v_szr->Add(btns_h_szr, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
	
	wxBoxSizer* panel_h_szr = new wxBoxSizer(wxHORIZONTAL);
	panel_h_szr->Add(panel_v_szr, 1, wxEXPAND);
	panel->SetSizer(panel_h_szr);
	
	// Top Sizer for Frame
	wxBoxSizer* top_h_sizer = new wxBoxSizer(wxHORIZONTAL);
	top_h_sizer->Add(panel, 1, wxEXPAND|wxALL, 8);
	
	SetSizerAndFit(top_h_sizer);
	
	wxCommandEvent ev;
    if (project->GetNumRecords() > 5000)
        OnRandSampRadioSelected(ev);
    else
        OnAllPairsRadioSelected(ev);
        
	SetIcon(wxIcon(GeoDaIcon_16x16_xpm));
    Show(true);
    var_choice->SetFocus();
	wxLogMessage("Exiting CorrelParamsFrame::CorrelParamsFrame");
}
Exemplo n.º 24
0
ParamCon::ParamCon(ToolPanel *pan, int tp, wxString pname, wxString labelname, double initval, double step, int places, int labelwid, int numwid)
{
	//mainwin = main;
	//wxControl::Create(panel, wxID_ANY, wxDefaultPosition, wxSize(250, 30), wxBORDER_NONE, wxDefaultValidator, name);
	ostype = GetSystem();
	wxControl::Create(pan, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE);
	numstep = step;
	name = pname;
	plabel = labelname;
	decimals = places;
	type = tp;
	labelwidth = labelwid;
	numwidth = numwid;
	panel = pan;
	pad = panel->controlborder;
	//pad = 0;
	if(ostype == Mac) pad = 0;
	mainwin = panel->mainwin;
	//wxFont textfont(10, wxFONTFAMILY_SWISS, wxNORMAL, wxNORMAL, false, wxT("Tahoma"));
    textfont = wxFont(wxFontInfo(8).FaceName("Tahoma"));
	//textfont = wxFont(8, wxFONTFAMILY_SWISS, wxNORMAL, wxNORMAL, false, "Tahoma");
	//if(ostype == Mac) textfont = wxFont(10, wxFONTFAMILY_SWISS, wxNORMAL, wxNORMAL, false, "Tahoma");
	if(ostype == Mac) {
        textfont = wxFont(wxFontInfo(11).FaceName("Tahoma"));
        smalltextfont = wxFont(wxFontInfo(9).FaceName("Tahoma"));
		//textfont = wxFont(11, wxFONTFAMILY_SWISS, wxNORMAL, wxNORMAL, false, "Tahoma");
		//smalltextfont = wxFont(9, wxFONTFAMILY_SWISS, wxNORMAL, wxNORMAL, false, "Tahoma");
	}
	//boxfont.New(8, wxFONTFAMILY_SWISS, wxNORMAL, wxNORMAL, false, wxT("Tahoma"));
	//wxFont textfont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));

	min = 0;
	max = 1000000;

	if(initval < 0) min = -1000000;
	if(initval < min) min = initval * 10;
	if(initval > max) max = initval * 100;
	oldvalue = initval;

	sizer = new wxBoxSizer(wxHORIZONTAL);
	snum.Printf("%.1f", initval);
	snum = numstring(initval, places);

	if(labelname == "") {
		label = NULL;
		labelwidth = 0;
	}
	else {
		label = new ToolText(this, panel->toolbox, name, labelname, wxDefaultPosition, wxSize(labelwidth, -1), wxALIGN_CENTRE);
		label->SetFont(textfont);
		if(ostype == Mac && labelwidth < 40) label->SetFont(smalltextfont);
		sizer->Add(label, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, pad);
	}

	numbox = new wxTextCtrl(this, wxID_ANY, snum, wxDefaultPosition, wxSize(numwidth, -1), wxTE_PROCESS_ENTER);
	numbox->SetFont(textfont);
	sizer->Add(numbox, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, pad);

	if(type == spincon) {
		spin = new wxSpinButton(this, wxID_ANY, wxDefaultPosition, wxSize(17, 23), wxSP_VERTICAL|wxSP_ARROW_KEYS);  // 21
		spin->SetRange(-1000000, 1000000);
	}	

	SetInitialSize(wxDefaultSize);
	Move(wxDefaultPosition);

	if(type == spincon) sizer->Add(spin, 0, wxALIGN_CENTER_VERTICAL, 0);
	SetSizer(sizer);
	Layout();

	Connect(wxEVT_SPIN_UP, wxSpinEventHandler(ParamCon::OnSpinUp));
	Connect(wxEVT_SPIN_DOWN, wxSpinEventHandler(ParamCon::OnSpinDown));
	Connect(wxEVT_SPIN, wxSpinEventHandler(ParamCon::OnSpin));
	Connect(wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler(ParamCon::OnEnter));
}
Exemplo n.º 25
0
PlotConfigurationDialogBase::PlotConfigurationDialogBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxFlexGridSizer* fgSizer111;
	fgSizer111 = new wxFlexGridSizer( 0, 1, 0, 0 );
	fgSizer111->SetFlexibleDirection( wxBOTH );
	fgSizer111->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	wxFlexGridSizer* fgSizer13;
	fgSizer13 = new wxFlexGridSizer( 0, 2, 0, 0 );
	fgSizer13->AddGrowableCol( 0 );
	fgSizer13->AddGrowableRow( 0 );
	fgSizer13->SetFlexibleDirection( wxBOTH );
	fgSizer13->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_listbook1 = new wxListbook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLB_DEFAULT );
	m_panel1 = new wxPanel( m_listbook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxFlexGridSizer* fgSizer14;
	fgSizer14 = new wxFlexGridSizer( 0, 1, 0, 0 );
	fgSizer14->SetFlexibleDirection( wxBOTH );
	fgSizer14->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	wxFlexGridSizer* fgSizer191;
	fgSizer191 = new wxFlexGridSizer( 0, 2, 0, 0 );
	fgSizer191->SetFlexibleDirection( wxBOTH );
	fgSizer191->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_cbSOG = new wxCheckBox( m_panel1, wxID_ANY, _("GPS Speed (SOG)"), wxDefaultPosition, wxDefaultSize, 0 );
	m_cbSOG->SetValue(true); 
	fgSizer191->Add( m_cbSOG, 0, wxALL, 5 );
	
	m_cbPDS10 = new wxCheckBox( m_panel1, wxID_ANY, _("PDS 10"), wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer191->Add( m_cbPDS10, 0, wxALL, 5 );
	
	m_cbPDS60 = new wxCheckBox( m_panel1, wxID_ANY, _("PDS 60"), wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer191->Add( m_cbPDS60, 0, wxALL, 5 );
	
	m_button5 = new wxButton( m_panel1, wxID_ANY, _("?"), wxDefaultPosition, wxSize( 20,-1 ), 0 );
	fgSizer191->Add( m_button5, 0, wxALL, 5 );
	
	
	fgSizer14->Add( fgSizer191, 1, wxEXPAND, 5 );
	
	wxStaticBoxSizer* sbSizer3;
	sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( m_panel1, wxID_ANY, _("VMG") ), wxVERTICAL );
	
	wxFlexGridSizer* fgSizer171;
	fgSizer171 = new wxFlexGridSizer( 0, 2, 0, 0 );
	fgSizer171->SetFlexibleDirection( wxBOTH );
	fgSizer171->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_cbVMG = new wxCheckBox( sbSizer3->GetStaticBox(), wxID_ANY, _("Course"), wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer171->Add( m_cbVMG, 0, wxALL, 5 );
	
	m_tVMGCourse = new wxTextCtrl( sbSizer3->GetStaticBox(), wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer171->Add( m_tVMGCourse, 0, wxALL, 5 );
	
	
	sbSizer3->Add( fgSizer171, 1, wxEXPAND, 5 );
	
	
	fgSizer14->Add( sbSizer3, 1, wxEXPAND, 5 );
	
	
	m_panel1->SetSizer( fgSizer14 );
	m_panel1->Layout();
	fgSizer14->Fit( m_panel1 );
	m_listbook1->AddPage( m_panel1, _("Speed"), false );
	m_panel2 = new wxPanel( m_listbook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxFlexGridSizer* fgSizer17;
	fgSizer17 = new wxFlexGridSizer( 0, 2, 0, 0 );
	fgSizer17->SetFlexibleDirection( wxBOTH );
	fgSizer17->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_cbCOG = new wxCheckBox( m_panel2, wxID_ANY, _("GPS Course (COG)"), wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer17->Add( m_cbCOG, 0, wxALL, 5 );
	
	m_cbPDC10 = new wxCheckBox( m_panel2, wxID_ANY, _("PDC 10"), wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer17->Add( m_cbPDC10, 0, wxALL, 5 );
	
	m_cbPDC60 = new wxCheckBox( m_panel2, wxID_ANY, _("PDC 60"), wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer17->Add( m_cbPDC60, 0, wxALL, 5 );
	
	m_cbHDG = new wxCheckBox( m_panel2, wxID_ANY, _("Heading"), wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer17->Add( m_cbHDG, 0, wxALL, 5 );
	
	m_cbCourseFFTWPlot = new wxCheckBox( m_panel2, wxID_ANY, _("FFTW Plot"), wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer17->Add( m_cbCourseFFTWPlot, 0, wxALL, 5 );
	
	m_cbHDM = new wxCheckBox( m_panel2, wxID_ANY, _("Magnetic Heading"), wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer17->Add( m_cbHDM, 0, wxALL, 5 );
	
	
	m_panel2->SetSizer( fgSizer17 );
	m_panel2->Layout();
	fgSizer17->Fit( m_panel2 );
	m_listbook1->AddPage( m_panel2, _("Course"), true );
	m_panel3 = new wxPanel( m_listbook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxFlexGridSizer* fgSizer19;
	fgSizer19 = new wxFlexGridSizer( 0, 1, 0, 0 );
	fgSizer19->SetFlexibleDirection( wxBOTH );
	fgSizer19->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_cbAWS = new wxCheckBox( m_panel3, wxID_ANY, _("Apparent Wind Speed (NMEA MWV)"), wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer19->Add( m_cbAWS, 0, wxALL, 5 );
	
	m_cbTWS = new wxCheckBox( m_panel3, wxID_ANY, _("True Wind Speed (via gpps speed)"), wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer19->Add( m_cbTWS, 0, wxALL, 5 );
	
	
	m_panel3->SetSizer( fgSizer19 );
	m_panel3->Layout();
	fgSizer19->Fit( m_panel3 );
	m_listbook1->AddPage( m_panel3, _("Wind Speed"), false );
	m_panel4 = new wxPanel( m_listbook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxFlexGridSizer* fgSizer20;
	fgSizer20 = new wxFlexGridSizer( 0, 1, 0, 0 );
	fgSizer20->SetFlexibleDirection( wxBOTH );
	fgSizer20->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_cbAWA = new wxCheckBox( m_panel4, wxID_ANY, _("Apparent Wind Direction (NMEA MWV)"), wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer20->Add( m_cbAWA, 0, wxALL, 5 );
	
	m_cbTWA = new wxCheckBox( m_panel4, wxID_ANY, _("True Wind Angle (via GPS speed)"), wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer20->Add( m_cbTWA, 0, wxALL, 5 );
	
	m_cbTWD = new wxCheckBox( m_panel4, wxID_ANY, _("True Wind Direction (via GPS speed)"), wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer20->Add( m_cbTWD, 0, wxALL, 5 );
	
	
	m_panel4->SetSizer( fgSizer20 );
	m_panel4->Layout();
	fgSizer20->Fit( m_panel4 );
	m_listbook1->AddPage( m_panel4, _("Wind Direction"), false );
	m_panel5 = new wxPanel( m_listbook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxFlexGridSizer* fgSizer201;
	fgSizer201 = new wxFlexGridSizer( 0, 2, 0, 0 );
	fgSizer201->SetFlexibleDirection( wxBOTH );
	fgSizer201->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_cbBAR = new wxCheckBox( m_panel5, wxID_ANY, _("Barometer Pressure( (NMEA MDA)"), wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer201->Add( m_cbBAR, 0, wxALL, 5 );
	
	
	m_panel5->SetSizer( fgSizer201 );
	m_panel5->Layout();
	fgSizer201->Fit( m_panel5 );
	m_listbook1->AddPage( m_panel5, _("Barometer"), false );
	#ifdef __WXGTK__ // Small icon style not supported in GTK
	wxListView* m_listbook1ListView = m_listbook1->GetListView();
	long m_listbook1Flags = m_listbook1ListView->GetWindowStyleFlag();
	if( m_listbook1Flags & wxLC_SMALL_ICON )
	{
		m_listbook1Flags = ( m_listbook1Flags & ~wxLC_SMALL_ICON ) | wxLC_ICON;
	}
	m_listbook1ListView->SetWindowStyleFlag( m_listbook1Flags );
	#endif
	
	fgSizer13->Add( m_listbook1, 1, wxEXPAND | wxALL, 5 );
	
	
	fgSizer111->Add( fgSizer13, 1, wxEXPAND, 5 );
	
	wxFlexGridSizer* fgSizer101;
	fgSizer101 = new wxFlexGridSizer( 0, 4, 0, 0 );
	fgSizer101->SetFlexibleDirection( wxBOTH );
	fgSizer101->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_staticText13 = new wxStaticText( this, wxID_ANY, _("Font"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText13->Wrap( -1 );
	fgSizer101->Add( m_staticText13, 0, wxALL, 5 );
	
	m_fpPlotFont = new wxFontPickerCtrl( this, wxID_ANY, wxNullFont, wxDefaultPosition, wxDefaultSize, wxFNTP_DEFAULT_STYLE );
	m_fpPlotFont->SetMaxPointSize( 100 ); 
	fgSizer101->Add( m_fpPlotFont, 0, wxALL, 5 );
	
	m_staticText12 = new wxStaticText( this, wxID_ANY, _("Minimum Height"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText12->Wrap( -1 );
	fgSizer101->Add( m_staticText12, 0, wxALL, 5 );
	
	m_sPlotMinHeight = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 10, 1000, 80 );
	fgSizer101->Add( m_sPlotMinHeight, 0, wxALL, 5 );
	
	m_staticText121 = new wxStaticText( this, wxID_ANY, _("Colors"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText121->Wrap( -1 );
	fgSizer101->Add( m_staticText121, 0, wxALL, 5 );
	
	wxString m_cColorsChoices[] = { _("Standard"), _("Light"), _("Retro"), _("Sky") };
	int m_cColorsNChoices = sizeof( m_cColorsChoices ) / sizeof( wxString );
	m_cColors = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_cColorsNChoices, m_cColorsChoices, 0 );
	m_cColors->SetSelection( 0 );
	fgSizer101->Add( m_cColors, 0, wxALL, 5 );
	
	m_staticText11 = new wxStaticText( this, wxID_ANY, _("Transparency"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText11->Wrap( -1 );
	fgSizer101->Add( m_staticText11, 0, wxALL, 5 );
	
	m_sPlotTransparency = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 90, 20 );
	fgSizer101->Add( m_sPlotTransparency, 0, wxALL, 5 );
	
	m_staticText122 = new wxStaticText( this, wxID_ANY, _("Style"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText122->Wrap( -1 );
	fgSizer101->Add( m_staticText122, 0, wxALL, 5 );
	
	wxString m_cPlotStyleChoices[] = { _("Continuous"), _("Sweep") };
	int m_cPlotStyleNChoices = sizeof( m_cPlotStyleChoices ) / sizeof( wxString );
	m_cPlotStyle = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_cPlotStyleNChoices, m_cPlotStyleChoices, 0 );
	m_cPlotStyle->SetSelection( 0 );
	fgSizer101->Add( m_cPlotStyle, 0, wxALL, 5 );
	
	
	fgSizer111->Add( fgSizer101, 1, wxEXPAND, 5 );
	
	wxFlexGridSizer* fgSizer16;
	fgSizer16 = new wxFlexGridSizer( 0, 2, 0, 0 );
	fgSizer16->SetFlexibleDirection( wxBOTH );
	fgSizer16->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_cbShowTitleBar = new wxCheckBox( this, wxID_ANY, _("Show Title Bar (restart required)\nWindow Manager may not support this"), wxDefaultPosition, wxDefaultSize, 0 );
	m_cbShowTitleBar->SetValue(true); 
	fgSizer16->Add( m_cbShowTitleBar, 0, wxALL, 5 );
	
	
	fgSizer111->Add( fgSizer16, 1, wxEXPAND, 5 );
	
	wxFlexGridSizer* fgSizer11;
	fgSizer11 = new wxFlexGridSizer( 0, 3, 0, 0 );
	fgSizer11->SetFlexibleDirection( wxBOTH );
	fgSizer11->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_bAbout = new wxButton( this, wxID_ANY, _("About"), wxDefaultPosition, wxDefaultSize, 0 );
	fgSizer11->Add( m_bAbout, 0, wxALL, 5 );
	
	m_sdbSizer1 = new wxStdDialogButtonSizer();
	m_sdbSizer1OK = new wxButton( this, wxID_OK );
	m_sdbSizer1->AddButton( m_sdbSizer1OK );
	m_sdbSizer1->Realize();
	
	fgSizer11->Add( m_sdbSizer1, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 );
	
	
	fgSizer111->Add( fgSizer11, 1, wxEXPAND, 5 );
	
	
	this->SetSizer( fgSizer111 );
	this->Layout();
	fgSizer111->Fit( this );
	
	this->Centre( wxBOTH );
	
	// Connect Events
	m_button5->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PlotConfigurationDialogBase::OnPDS ), NULL, this );
	m_tVMGCourse->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PlotConfigurationDialogBase::OnPlotChange ), NULL, this );
	m_fpPlotFont->Connect( wxEVT_COMMAND_FONTPICKER_CHANGED, wxFontPickerEventHandler( PlotConfigurationDialogBase::OnPlotChange ), NULL, this );
	m_sPlotMinHeight->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( PlotConfigurationDialogBase::OnPlotChange ), NULL, this );
	m_cColors->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PlotConfigurationDialogBase::OnPlotChange ), NULL, this );
	m_sPlotTransparency->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( PlotConfigurationDialogBase::OnPlotChange ), NULL, this );
	m_bAbout->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PlotConfigurationDialogBase::OnAbout ), NULL, this );
}
Exemplo n.º 26
0
wxSizer* ToolbarPanel::CreateMainLayout()
{
	wxSizer* top_sizer = new wxBoxSizer(wxVERTICAL);
	top_sizer->AddSpacer(10);

// 	// Name
// 	{
// 		wxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
// 		sizer->Add(new wxStaticText(this, wxID_ANY, LANG[LK_NAME]));
// 		sizer->Add(m_name = new wxTextCtrl(this, wxID_ANY));
// 		top_sizer->Add(sizer);
// 	}
// 	// State
// 	{
// 		wxStaticBox* bounding = new wxStaticBox(this, wxID_ANY, LANG[LK_STATE]);
// 		wxSizer* sizer = new wxStaticBoxSizer(bounding, wxHORIZONTAL);
// 		{
// 			m_loop = new wxCheckBox(this, wxID_ANY, LANG[LK_LOOP]);	
// 			m_loop->SetValue(true);
// 			Connect(m_loop->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ToolbarPanel::OnSetLoop));
// 			sizer->Add(m_loop);
// 		}
// 		sizer->AddSpacer(5);
// 		{
// 			m_local_mode_draw = new wxCheckBox(this, wxID_ANY, LANG[LK_LOCAL_DRAW]);	
// 			m_local_mode_draw->SetValue(false);
// 			Connect(m_local_mode_draw->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ToolbarPanel::OnSetLocalModeDraw));
// 			sizer->Add(m_local_mode_draw);
// 		}
// 		top_sizer->Add(sizer);
// 	}
// 	top_sizer->AddSpacer(10);

	// Mode
	m_static_mode = new wxCheckBox(this, wxID_ANY, LANG[LK_STATIC_MODE]);
	Connect(m_static_mode->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ToolbarPanel::OnSetStaticMode));
	top_sizer->Add(m_static_mode);

	// Count
	ee::SliderCtrlOne* s_count = new ee::SliderCtrlOne(this, LANG[LK_COUNT], 
		"count", this, PS_COUNT, ee::SliderItem("", "", COUNT, 1, 5000));
	top_sizer->Add(s_count);
	m_sliders.push_back(s_count);
	m_count_ctrl = s_count;
	// Emission Time
	ee::SliderCtrlOne* s_emission_time = new ee::SliderCtrlOne(this, LANG[LK_EMISSION_TIME], 
		"emission_time", this, PS_EMISSION_TIME, ee::SliderItem("", "", EMISSION_TIME, 10, 5000));
	top_sizer->Add(s_emission_time);
	top_sizer->AddSpacer(10);
	m_sliders.push_back(s_emission_time);
	m_time_ctrl = s_emission_time;

	// Life
	ee::SliderCtrlTwo* s_life = new ee::SliderCtrlTwo(this, LANG[LK_LIFE], "life", this, PS_LIFE_TIME, 
		ee::SliderItem(LANG[LK_CENTER], ITEM_ATTR_CENTER, LIFE_CENTER, 0, 5000), ee::SliderItem(LANG[LK_OFFSET], ITEM_ATTR_OFFSET, LIFE_OFFSET, 0, 2500));
	top_sizer->Add(s_life);
	top_sizer->AddSpacer(10);
	m_sliders.push_back(s_life);
	// Hori
	{
		wxStaticBox* bounding = new wxStaticBox(this, wxID_ANY, LANG[LK_HORI]);
		wxSizer* horiSizer = new wxStaticBoxSizer(bounding, wxHORIZONTAL);
		{
			wxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
			sizer->Add(new wxStaticText(this, wxID_ANY, LANG[LK_MIN]));	

			m_min_hori = new wxSpinCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(70, -1), wxSP_ARROW_KEYS, -360, 360, MIN_HORI);
			Connect(m_min_hori->GetId(), wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(ToolbarPanel::OnSetHori));
			sizer->Add(m_min_hori);

			horiSizer->Add(sizer);
		}
		{
			wxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
			sizer->Add(new wxStaticText(this, wxID_ANY, LANG[LK_MAX]));	

			m_max_hori = new wxSpinCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(70, -1), wxSP_ARROW_KEYS, -360, 360, MAX_HORI);
			Connect(m_max_hori->GetId(), wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(ToolbarPanel::OnSetHori));
			sizer->Add(m_max_hori);

			horiSizer->Add(sizer);
		}
		top_sizer->Add(horiSizer);
	}
	top_sizer->AddSpacer(10);
	// Vert
	{
		wxStaticBox* bounding = new wxStaticBox(this, wxID_ANY, LANG[LK_VERT]);
		wxSizer* vertSizer = new wxStaticBoxSizer(bounding, wxHORIZONTAL);
		{
			wxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
			sizer->Add(new wxStaticText(this, wxID_ANY, LANG[LK_MIN]));

			m_min_vert = new wxSpinCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(70, -1), wxSP_ARROW_KEYS, -360, 360, MIN_VERT);
			Connect(m_min_vert->GetId(), wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(ToolbarPanel::OnSetVert));
			sizer->Add(m_min_vert);

			vertSizer->Add(sizer);
		}
		vertSizer->AddSpacer(10);
		{
			wxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
			sizer->Add(new wxStaticText(this, wxID_ANY, LANG[LK_MAX]));	

			m_max_vert = new wxSpinCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(70, -1), wxSP_ARROW_KEYS, -360, 360, MAX_VERT);
			Connect(m_max_vert->GetId(), wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler(ToolbarPanel::OnSetVert));
			sizer->Add(m_max_vert);

			vertSizer->Add(sizer);
		}
		top_sizer->Add(vertSizer);
	}
	top_sizer->AddSpacer(10);
	// Radial Speed
	ee::SliderCtrlTwo* s_r_spd = new ee::SliderCtrlTwo(this, LANG[LK_RADIAL_SPEED], "radial_speed", this, PS_RADIAL_SPEED, 
		ee::SliderItem(LANG[LK_CENTER], ITEM_ATTR_CENTER, RADIAL_SPEED_CENTER, -40000, 40000), ee::SliderItem(LANG[LK_OFFSET], ITEM_ATTR_OFFSET, RADIAL_SPEED_OFFSET, 0, 20000));
	top_sizer->Add(s_r_spd);
	top_sizer->AddSpacer(10);
	m_sliders.push_back(s_r_spd);
	// Tangential Speed
	ee::SliderCtrlTwo* s_t_spd = new ee::SliderCtrlTwo(this, LANG[LK_TANGENTIAL_SPEED], "tangential_spd", this, PS_TANGENTIAL_SPEED, 
		ee::SliderItem(LANG[LK_CENTER], ITEM_ATTR_CENTER, 0, -400, 400), ee::SliderItem(LANG[LK_OFFSET], ITEM_ATTR_OFFSET, 0, 0, 200));
	top_sizer->Add(s_t_spd);
	top_sizer->AddSpacer(10);
	m_sliders.push_back(s_t_spd);
	// Angular Speed
	ee::SliderCtrlTwo* s_a_spd = new ee::SliderCtrlTwo(this, LANG[LK_ANGULAR_SPEED], "angular_speed", this, PS_ANGULAR_SPEED, 
		ee::SliderItem(LANG[LK_CENTER], ITEM_ATTR_CENTER, ANGULAR_SPEED_CENTER, -3600, 3600), ee::SliderItem(LANG[LK_OFFSET], ITEM_ATTR_OFFSET, ANGULAR_SPEED_OFFSET, 0, 360));
	top_sizer->Add(s_a_spd);
	top_sizer->AddSpacer(10);
	m_sliders.push_back(s_a_spd);
	// Disturbance 
	{
		wxStaticBox* bounding = new wxStaticBox(this, wxID_ANY, LANG[LK_DISTURBANCE]);
		wxSizer* sizer = new wxStaticBoxSizer(bounding, wxVERTICAL);

		ee::SliderCtrlTwo* s_dis_r = new ee::SliderCtrlTwo(this, LANG[LK_RANGE], "disturbance_radius", this, PS_DISTURBANCE_RADIUS, 
			ee::SliderItem(LANG[LK_CENTER], ITEM_ATTR_CENTER, DISTURBANCE_RADIUS_CENTER, 0, 9999), ee::SliderItem(LANG[LK_OFFSET], ITEM_ATTR_OFFSET, DISTURBANCE_RADIUS_OFFSET, 0, 1000));
		sizer->Add(s_dis_r);
		m_sliders.push_back(s_dis_r);

		ee::SliderCtrlTwo* s_dis_spd = new ee::SliderCtrlTwo(this, LANG[LK_SPEED], "disturbance_spd", this, PS_DISTURBANCE_SPD, 
			ee::SliderItem(LANG[LK_CENTER], ITEM_ATTR_CENTER, DISTURBANCE_SPD_CENTER, 0, 9999), ee::SliderItem(LANG[LK_OFFSET], ITEM_ATTR_OFFSET, DISTURBANCE_SPD_OFFSET, 0, 1000));
		sizer->Add(s_dis_spd);
		m_sliders.push_back(s_dis_spd);

		top_sizer->Add(sizer);
		top_sizer->AddSpacer(10);
	}
	// Gravity
	ee::SliderCtrlOne* s_gravity = new ee::SliderCtrlOne(this, LANG[LK_GRAVITY], "gravity", 
		this, PS_GRAVITY, ee::SliderItem("", "", GRAVITY, -5000, 25000));
	top_sizer->Add(s_gravity);
	top_sizer->AddSpacer(10);
	m_sliders.push_back(s_gravity);
	// Linear Acc
	ee::SliderCtrlTwo* s_lacc = new ee::SliderCtrlTwo(this, LANG[LK_LINEAR_ACC], "linear_acc", this, PS_LINEAR_ACC, 
		ee::SliderItem(LANG[LK_CENTER], ITEM_ATTR_CENTER, LINEAR_ACC_CENTER, -9999, 9999), ee::SliderItem(LANG[LK_OFFSET], ITEM_ATTR_OFFSET, LINEAR_ACC_OFFSET, 0, 999));
	top_sizer->Add(s_lacc);
	top_sizer->AddSpacer(10);
	m_sliders.push_back(s_lacc);
	// Fadeout Time
	ee::SliderCtrlOne* s_fadeout = new ee::SliderCtrlOne(this, LANG[LK_FADEOUT_TIME], 
		"fadeout_time", this, PS_FADEOUT_TIME, ee::SliderItem("", "", FADEOUT_TIME, 10, 2500));
	top_sizer->Add(s_fadeout);
	top_sizer->AddSpacer(10);
	m_sliders.push_back(s_fadeout);
	// Ground
	{
		const int size = 3;
		wxString choices[size];
		choices[0] = LANG[LK_NO_GROUND];
		choices[1] = LANG[LK_GROUND_WITH_BOUNCE];
		choices[2] = LANG[LK_GROUND_NO_BOUNCE];
		m_ground = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, size, choices);
		m_ground->SetSelection(1);
		Connect(m_ground->GetId(), wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(ToolbarPanel::OnSetGround));
		top_sizer->Add(m_ground);
	}
	top_sizer->AddSpacer(10);
	// Start Position
	ee::SliderCtrlTwo* s_start_pos = new ee::SliderCtrlTwo(this, LANG[LK_START_POSITION], "start_pos", this, PS_START_POS, 
		ee::SliderItem(LANG[LK_RADIUS], ITEM_ATTR_RADIUS, START_RADIUS, 0, 5000), 
		ee::SliderItem(LANG[LK_HEIGHT], ITEM_ATTR_HEIGHT, START_HEIGHT, -25000, 25000));
	top_sizer->Add(s_start_pos);
	top_sizer->AddSpacer(10);
	m_sliders.push_back(s_start_pos);
	// orient_to_movement
	{
		m_orient_to_movement = new wxCheckBox(this, wxID_ANY, LANG[LK_ORIENT_MOVEMENT]);	
		Connect(m_orient_to_movement->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ToolbarPanel::OnSetOrientToMovement));
		top_sizer->Add(m_orient_to_movement);
	}
	top_sizer->AddSpacer(10);
	// 	// orient_to_parent
	// 	{
	// 		m_orient_to_parent = new wxCheckBox(this, wxID_ANY, LANG[LK_ORIENT_PARENT]);
	// 		leftSizer->Add(m_orient_to_parent);
	// 	}
	// 	leftSizer->AddSpacer(10);

	// Blend
	{
		wxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);

		sizer->Add(new wxStaticText(this, wxID_ANY, "»ìºÏ"));

		std::vector<std::string> names;
		ee::FastBlendModes::Instance()->GetAllNameCN(names);
		wxArrayString wx_names;
		for (int i = 0, n = names.size(); i < n; ++i) {
			wx_names.Add(names[i]);
		}
		m_blend = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wx_names);
		m_blend->SetSelection(0);
		Connect(m_blend->GetId(), wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(ToolbarPanel::OnSetBlend));
		sizer->Add(m_blend);

		top_sizer->Add(sizer);
	}

	return top_sizer;
}
Exemplo n.º 27
0
wxsSizerParentQP::wxsSizerParentQP(wxsAdvQPP* parent,wxsSizerExtra* Extra):
    wxsAdvQPPChild(parent,_("Sizer")),
    m_Extra(Extra)
{
    //(*Initialize(wxsSizerParentQP)
    wxStaticBoxSizer* StaticBoxSizer2;
    wxStaticBoxSizer* StaticBoxSizer3;
    wxGridSizer* GridSizer1;
    wxBoxSizer* BoxSizer1;
    wxStaticBoxSizer* StaticBoxSizer1;
    wxGridSizer* GridSizer2;

    Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("wxID_ANY"));
    BoxSizer1 = new wxBoxSizer(wxVERTICAL);
    StaticBoxSizer1 = new wxStaticBoxSizer(wxVERTICAL, this, _("Border"));
    GridSizer1 = new wxGridSizer(3, 3, 0, 0);
    GridSizer1->Add(-1,-1,0, wxALIGN_CENTER_VERTICAL, 5);
    BrdTop = new wxCheckBox(this, ID_CHECKBOX1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX1"));
    BrdTop->SetValue(false);
    GridSizer1->Add(BrdTop, 0, wxALIGN_CENTER_VERTICAL, 5);
    GridSizer1->Add(-1,-1,0, wxALIGN_CENTER_VERTICAL, 5);
    BrdLeft = new wxCheckBox(this, ID_CHECKBOX2, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX2"));
    BrdLeft->SetValue(false);
    GridSizer1->Add(BrdLeft, 0, wxALIGN_CENTER_VERTICAL, 5);
    BrdAll = new wxCheckBox(this, ID_CHECKBOX8, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX8"));
    BrdAll->SetValue(false);
    GridSizer1->Add(BrdAll, 0, wxALIGN_CENTER_VERTICAL, 5);
    BrdRight = new wxCheckBox(this, ID_CHECKBOX3, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX3"));
    BrdRight->SetValue(false);
    GridSizer1->Add(BrdRight, 0, wxALIGN_CENTER_VERTICAL, 5);
    GridSizer1->Add(-1,-1,0, wxALIGN_CENTER_VERTICAL, 5);
    BrdBottom = new wxCheckBox(this, ID_CHECKBOX4, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX4"));
    BrdBottom->SetValue(false);
    GridSizer1->Add(BrdBottom, 0, wxALIGN_CENTER_VERTICAL, 5);
    StaticBoxSizer1->Add(GridSizer1, 0, wxEXPAND, 5);
    BrdSize = new wxSpinCtrl(this, ID_SPINCTRL1, _T("0"), wxDefaultPosition, wxDLG_UNIT(this,wxSize(38,-1)), 0, 0, 100, 0, _T("ID_SPINCTRL1"));
    BrdSize->SetValue(_T("0"));
    StaticBoxSizer1->Add(BrdSize, 0, wxTOP|wxEXPAND, 5);
    BrdDlg = new wxCheckBox(this, ID_CHECKBOX7, _("Dialog Units"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX7"));
    BrdDlg->SetValue(false);
    StaticBoxSizer1->Add(BrdDlg, 0, wxTOP|wxEXPAND, 5);
    BoxSizer1->Add(StaticBoxSizer1, 0, wxEXPAND, 5);
    StaticBoxSizer2 = new wxStaticBoxSizer(wxVERTICAL, this, _("Placement"));
    GridSizer2 = new wxGridSizer(3, 3, 0, 0);
    PlaceLT = new wxRadioButton(this, ID_RADIOBUTTON4, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_RADIOBUTTON4"));
    GridSizer2->Add(PlaceLT, 0, wxALIGN_CENTER_VERTICAL, 5);
    PlaceCT = new wxRadioButton(this, ID_RADIOBUTTON5, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_RADIOBUTTON5"));
    GridSizer2->Add(PlaceCT, 0, wxALIGN_CENTER_VERTICAL, 5);
    PlaceRT = new wxRadioButton(this, ID_RADIOBUTTON6, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_RADIOBUTTON6"));
    GridSizer2->Add(PlaceRT, 0, wxALIGN_CENTER_VERTICAL, 5);
    PlaceLC = new wxRadioButton(this, ID_RADIOBUTTON7, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_RADIOBUTTON7"));
    GridSizer2->Add(PlaceLC, 0, wxALIGN_CENTER_VERTICAL, 5);
    PlaceCC = new wxRadioButton(this, ID_RADIOBUTTON8, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_RADIOBUTTON8"));
    GridSizer2->Add(PlaceCC, 0, wxALIGN_CENTER_VERTICAL, 5);
    PlaceRC = new wxRadioButton(this, ID_RADIOBUTTON9, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_RADIOBUTTON9"));
    GridSizer2->Add(PlaceRC, 0, wxALIGN_CENTER_VERTICAL, 5);
    PlaceLB = new wxRadioButton(this, ID_RADIOBUTTON10, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_RADIOBUTTON10"));
    GridSizer2->Add(PlaceLB, 0, wxALIGN_CENTER_VERTICAL, 5);
    PlaceCB = new wxRadioButton(this, ID_RADIOBUTTON11, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_RADIOBUTTON11"));
    GridSizer2->Add(PlaceCB, 0, wxALIGN_CENTER_VERTICAL, 5);
    PlaceRB = new wxRadioButton(this, ID_RADIOBUTTON12, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_RADIOBUTTON12"));
    GridSizer2->Add(PlaceRB, 0, wxALIGN_CENTER_VERTICAL, 5);
    StaticBoxSizer2->Add(GridSizer2, 0, wxEXPAND, 5);
    StaticLine1 = new wxStaticLine(this, ID_STATICLINE1, wxDefaultPosition, wxSize(10,-1), wxLI_HORIZONTAL, _T("ID_STATICLINE1"));
    StaticBoxSizer2->Add(StaticLine1, 0, wxTOP|wxBOTTOM|wxEXPAND, 5);
    PlaceShp = new wxCheckBox(this, ID_CHECKBOX6, _("Shaped"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX6"));
    PlaceShp->SetValue(false);
    StaticBoxSizer2->Add(PlaceShp, 0, wxEXPAND, 5);
    PlaceExp = new wxCheckBox(this, ID_CHECKBOX5, _("Expand"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX5"));
    PlaceExp->SetValue(false);
    StaticBoxSizer2->Add(PlaceExp, 0, wxTOP|wxEXPAND, 5);
    BoxSizer1->Add(StaticBoxSizer2, 0, wxEXPAND, 5);
    StaticBoxSizer3 = new wxStaticBoxSizer(wxVERTICAL, this, _("Proportion"));
    Proportion = new wxSpinCtrl(this, ID_SPINCTRL2, _T("0"), wxDefaultPosition, wxDLG_UNIT(this,wxSize(38,-1)), 0, 0, 100, 0, _T("ID_SPINCTRL2"));
    Proportion->SetValue(_T("0"));
    StaticBoxSizer3->Add(Proportion, 0, wxEXPAND, 5);
    BoxSizer1->Add(StaticBoxSizer3, 0, wxEXPAND, 5);
    SetSizer(BoxSizer1);
    BoxSizer1->Fit(this);
    BoxSizer1->SetSizeHints(this);

    Connect(ID_CHECKBOX1,wxEVT_COMMAND_CHECKBOX_CLICKED,wxCommandEventHandler(wxsSizerParentQP::OnBrdChange));
    Connect(ID_CHECKBOX2,wxEVT_COMMAND_CHECKBOX_CLICKED,wxCommandEventHandler(wxsSizerParentQP::OnBrdChange));
    Connect(ID_CHECKBOX8,wxEVT_COMMAND_CHECKBOX_CLICKED,wxCommandEventHandler(wxsSizerParentQP::OnBrdAll));
    Connect(ID_CHECKBOX3,wxEVT_COMMAND_CHECKBOX_CLICKED,wxCommandEventHandler(wxsSizerParentQP::OnBrdChange));
    Connect(ID_CHECKBOX4,wxEVT_COMMAND_CHECKBOX_CLICKED,wxCommandEventHandler(wxsSizerParentQP::OnBrdChange));
    Connect(ID_SPINCTRL1,wxEVT_COMMAND_SPINCTRL_UPDATED,wxSpinEventHandler(wxsSizerParentQP::OnBrdSizeChange));
    Connect(ID_CHECKBOX7,wxEVT_COMMAND_CHECKBOX_CLICKED,wxCommandEventHandler(wxsSizerParentQP::OnBrdDlgChange));
    Connect(ID_RADIOBUTTON4,wxEVT_COMMAND_RADIOBUTTON_SELECTED,wxCommandEventHandler(wxsSizerParentQP::OnPlaceChange));
    Connect(ID_RADIOBUTTON5,wxEVT_COMMAND_RADIOBUTTON_SELECTED,wxCommandEventHandler(wxsSizerParentQP::OnPlaceChange));
    Connect(ID_RADIOBUTTON6,wxEVT_COMMAND_RADIOBUTTON_SELECTED,wxCommandEventHandler(wxsSizerParentQP::OnPlaceChange));
    Connect(ID_RADIOBUTTON7,wxEVT_COMMAND_RADIOBUTTON_SELECTED,wxCommandEventHandler(wxsSizerParentQP::OnPlaceChange));
    Connect(ID_RADIOBUTTON8,wxEVT_COMMAND_RADIOBUTTON_SELECTED,wxCommandEventHandler(wxsSizerParentQP::OnPlaceChange));
    Connect(ID_RADIOBUTTON9,wxEVT_COMMAND_RADIOBUTTON_SELECTED,wxCommandEventHandler(wxsSizerParentQP::OnPlaceChange));
    Connect(ID_RADIOBUTTON10,wxEVT_COMMAND_RADIOBUTTON_SELECTED,wxCommandEventHandler(wxsSizerParentQP::OnPlaceChange));
    Connect(ID_RADIOBUTTON11,wxEVT_COMMAND_RADIOBUTTON_SELECTED,wxCommandEventHandler(wxsSizerParentQP::OnPlaceChange));
    Connect(ID_RADIOBUTTON12,wxEVT_COMMAND_RADIOBUTTON_SELECTED,wxCommandEventHandler(wxsSizerParentQP::OnPlaceChange));
    Connect(ID_CHECKBOX6,wxEVT_COMMAND_CHECKBOX_CLICKED,wxCommandEventHandler(wxsSizerParentQP::OnPlaceChange));
    Connect(ID_CHECKBOX5,wxEVT_COMMAND_CHECKBOX_CLICKED,wxCommandEventHandler(wxsSizerParentQP::OnPlaceChange));
    Connect(ID_SPINCTRL2,wxEVT_COMMAND_SPINCTRL_UPDATED,wxSpinEventHandler(wxsSizerParentQP::OnProportionChange));
    //*)

    ReadData();
}
Exemplo n.º 28
0
MainFrameBase::MainFrameBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	m_menuBar = new wxMenuBar( 0 );
	m_menuFile = new wxMenu();
	wxMenuItem* menuFileOpen;
	menuFileOpen = new wxMenuItem( m_menuFile, wxID_OPEN, wxString( _("Open layout...") ) + wxT('\t') + wxT("Ctrl+O"), wxEmptyString, wxITEM_NORMAL );
	m_menuFile->Append( menuFileOpen );
	
	wxMenuItem* m_separator1;
	m_separator1 = m_menuFile->AppendSeparator();
	
	wxMenuItem* menuFilePrint;
	menuFilePrint = new wxMenuItem( m_menuFile, wxID_PRINT, wxString( _("Print...") ) + wxT('\t') + wxT("Ctrl+P"), wxEmptyString, wxITEM_NORMAL );
	m_menuFile->Append( menuFilePrint );
	
	wxMenuItem* menuFilePreview;
	menuFilePreview = new wxMenuItem( m_menuFile, wxID_PREVIEW, wxString( _("Show print preview") ) , wxEmptyString, wxITEM_NORMAL );
	m_menuFile->Append( menuFilePreview );
	
	wxMenuItem* m_separator2;
	m_separator2 = m_menuFile->AppendSeparator();
	
	wxMenuItem* menuFileExit;
	menuFileExit = new wxMenuItem( m_menuFile, wxID_EXIT, wxString( _("E&xit") ) + wxT('\t') + wxT("Alt+X"), wxEmptyString, wxITEM_NORMAL );
	m_menuFile->Append( menuFileExit );
	
	m_menuBar->Append( m_menuFile, _("&File") ); 
	
	this->SetMenuBar( m_menuBar );
	
	wxBoxSizer* mainSizer;
	mainSizer = new wxBoxSizer( wxVERTICAL );
	
	wxBoxSizer* bSizer;
	bSizer = new wxBoxSizer( wxVERTICAL );
	
	m_canvas = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxSize( 420,597 ), wxDOUBLE_BORDER|wxTAB_TRAVERSAL );
	m_canvas->SetMinSize( wxSize( 420,597 ) );
	m_canvas->SetMaxSize( wxSize( 420,597 ) );
	
	bSizer->Add( m_canvas, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxTOP, 5 );
	
	mainSizer->Add( bSizer, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 );
	
	wxBoxSizer* bSizer4;
	bSizer4 = new wxBoxSizer( wxVERTICAL );
	
	m_spinPages = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 10, 0 );
	bSizer4->Add( m_spinPages, 1, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
	
	mainSizer->Add( bSizer4, 0, wxEXPAND, 5 );
	
	this->SetSizer( mainSizer );
	this->Layout();
	m_statusBar = this->CreateStatusBar( 1, wxST_SIZEGRIP, wxID_ANY );
	
	this->Centre( wxBOTH );
	
	// Connect Events
	this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainFrameBase::OnCloseFrame ) );
	this->Connect( menuFileOpen->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnOpen ) );
	this->Connect( menuFilePrint->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnPrint ) );
	this->Connect( menuFilePreview->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnPreview ) );
	this->Connect( menuFileExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnExitClick ) );
	m_canvas->Connect( wxEVT_PAINT, wxPaintEventHandler( MainFrameBase::OnPaint ), NULL, this );
	m_spinPages->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( MainFrameBase::OnPageNumber ), NULL, this );
}