示例#1
0
文件: CygwinDlg.cpp 项目: dxtravi/e
CygwinDlg::CygwinDlg(wxWindow *parent, cxCygwinDlgMode mode)
: wxDialog (parent, wxID_ANY, wxEmptyString, wxDefaultPosition), m_mode(mode) {
	if (m_mode == cxCYGWIN_INSTALL) SetTitle(_("Cygwin not installed!"));
	else SetTitle(_("Update Cygwin"));

	const wxString installMsg = _("e uses the Cygwin package to provide many of the powerful Unix-like commands not usually available on Windows. Without Cygwin, some of e's advanced features will be disabled.\n\nWould you like to install Cygwin now? (If you say no, e will ask you again when you try to use an advanced feature.)");
	const wxString updateMsg = _("To get full benefit of the bundle commands, your cygwin installation needs to be updated.");

	// Create controls
	wxStaticText* msg = new wxStaticText(this, wxID_ANY, (m_mode == cxCYGWIN_INSTALL) ? installMsg : updateMsg);
	msg->Wrap(300);
	wxStaticText* radioTitle = new wxStaticText(this, wxID_ANY, (m_mode == cxCYGWIN_INSTALL) ? _("Install Cygwin:") : _("Update Cygwin"));
	m_autoRadio = new wxRadioButton(this, wxID_ANY, _("Automatic"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
	m_manualRadio = new wxRadioButton(this, wxID_ANY, _("Manual"));

	// Create Layout
	wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
		mainSizer->Add(msg, 0, wxALL, 5);
		mainSizer->Add(radioTitle, 0, wxLEFT|wxTOP, 5);
		wxBoxSizer* radioSizer = new wxBoxSizer(wxVERTICAL);
			radioSizer->Add(m_autoRadio, 0, wxLEFT, 20);
			radioSizer->Add(m_manualRadio, 0, wxLEFT, 20);
			mainSizer->Add(radioSizer, 0, wxALL, 5);
		mainSizer->Add(CreateButtonSizer(wxOK|wxCANCEL), 0, wxEXPAND|wxALL, 5);

	SetSizerAndFit(mainSizer);
	Centre();
}
示例#2
0
void CConfigMain::CreateGUIControls()
{
	// Create the notebook and pages
	Notebook = new wxNotebook(this, ID_NOTEBOOK);
	wxPanel* const general_pane = new GeneralConfigPane(Notebook, ID_GENERALPAGE);
	wxPanel* const interface_pane = new InterfaceConfigPane(Notebook, ID_DISPLAYPAGE);
	wxPanel* const audio_pane = new AudioConfigPane(Notebook, ID_AUDIOPAGE);
	wxPanel* const gamecube_pane = new GameCubeConfigPane(Notebook, ID_GAMECUBEPAGE);
	wxPanel* const wii_pane = new WiiConfigPane(Notebook, ID_WIIPAGE);
	wxPanel* const path_pane = new PathConfigPane(Notebook, ID_PATHSPAGE);
	wxPanel* const advanced_pane = new AdvancedConfigPane(Notebook, ID_ADVANCEDPAGE);

	Notebook->AddPage(general_pane, _("General"));
	Notebook->AddPage(interface_pane, _("Interface"));
	Notebook->AddPage(audio_pane, _("Audio"));
	Notebook->AddPage(gamecube_pane, _("GameCube"));
	Notebook->AddPage(wii_pane, _("Wii"));
	Notebook->AddPage(path_pane, _("Paths"));
	Notebook->AddPage(advanced_pane, _("Advanced"));
	if (Movie::IsMovieActive() || NetPlay::IsNetPlayRunning())
		advanced_pane->Disable();

	wxBoxSizer* const main_sizer = new wxBoxSizer(wxVERTICAL);
	main_sizer->Add(Notebook, 1, wxEXPAND | wxALL, 5);
	main_sizer->Add(CreateButtonSizer(wxOK), 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);

	main_sizer->SetMinSize(400, 0);

	SetSizerAndFit(main_sizer);
	Center();
	SetFocus();
}
EditServerListDlg::EditServerListDlg(wxWindow *parent,
                                     const wxString& caption,
                                     const wxString& message,
				     const wxString& filename) : wxDialog(parent, -1, caption,
								      wxDefaultPosition, wxSize(400,200),
								      wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
  m_file = filename;

  wxBeginBusyCursor();

  wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );

  topsizer->Add( CreateTextSizer( message ), 0, wxALL, 10 );

  m_textctrl = new wxTextCtrl(this, -1, wxEmptyString,
			      wxDefaultPosition,
			      wxDefaultSize,
			      wxTE_MULTILINE);
  topsizer->Add( m_textctrl, 1, wxEXPAND | wxLEFT|wxRIGHT, 15 );

  topsizer->Add( CreateButtonSizer( wxOK | wxCANCEL ), 0, wxCENTRE | wxALL, 10 );

  SetAutoLayout( TRUE );
  SetSizer( topsizer );

  Centre( wxBOTH );

  if (wxFile::Exists(filename))
	m_textctrl->LoadFile(filename);

  m_textctrl->SetFocus();

  wxEndBusyCursor();
}
示例#4
0
AboutDolphin::AboutDolphin(wxWindow *parent, wxWindowID id,
		const wxString &title, const wxPoint &position,
		const wxSize& size, long style)
	: wxDialog(parent, id, title, position, size, style)
{
	wxMemoryInputStream istream(dolphin_logo_png, sizeof dolphin_logo_png);
	wxImage iDolphinLogo(istream, wxBITMAP_TYPE_PNG);
	wxStaticBitmap* const sbDolphinLogo = new wxStaticBitmap(this, wxID_ANY,
			wxBitmap(iDolphinLogo));

	const wxString Text = wxString::Format(_("Dolphin %s\n"
				"Copyright (c) 2003-2013+ Dolphin Team\n"
				"\n"
				"Branch: %s\n"
				"Revision: %s\n"
				"Compiled: %s @ %s\n"
				"\n"
				"Dolphin is a Gamecube/Wii emulator, which was\n"
				"originally written by F|RES and ector.\n"
				"Today Dolphin is an open source project with many\n"
				"contributors, too many to list.\n"
				"If interested, just go check out the project page at\n"
				"http://code.google.com/p/dolphin-emu/ .\n"
				"\n"
				"Special thanks to Bushing, Costis, CrowTRobo,\n"
				"Marcan, Segher, Titanik, or9 and Hotquik for their\n"
				"reverse engineering and docs/demos.\n"
				"\n"
				"Big thanks to Gilles Mouchard whose Microlib PPC\n"
				"emulator gave our development a kickstart.\n"
				"\n"
				"Thanks to Frank Wille for his PowerPC disassembler,\n"
				"which or9 and we modified to include Gekko specifics.\n"
				"\n"
				"Thanks to hcs/destop for their GC ADPCM decoder.\n"
				"\n"
				"We are not affiliated with Nintendo in any way.\n"
				"Gamecube and Wii are trademarks of Nintendo.\n"
				"The emulator should not be used to play games\n"
				"you do not legally own."),
		scm_desc_str, scm_branch_str, scm_rev_git_str, __DATE__, __TIME__);

	wxStaticText* const Message = new wxStaticText(this, wxID_ANY, Text);
	Message->Wrap(GetSize().GetWidth());

	wxBoxSizer* const sInfo = new wxBoxSizer(wxVERTICAL);
	sInfo->Add(Message, 1, wxEXPAND | wxALL, 5);

	wxBoxSizer* const sMainHor = new wxBoxSizer(wxHORIZONTAL);
	sMainHor->Add(sbDolphinLogo, 0, wxEXPAND | wxALL, 5);
	sMainHor->Add(sInfo);

	wxBoxSizer* const sMain = new wxBoxSizer(wxVERTICAL);
	sMain->Add(sMainHor, 1, wxEXPAND);
	sMain->Add(CreateButtonSizer(wxOK), 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);

	SetSizerAndFit(sMain);
	Center();
	SetFocus();
}
示例#5
0
wxSizer *wxDialogBase::CreateSeparatedButtonSizer(long flags)
{
    wxSizer *sizer = CreateButtonSizer(flags);
    if ( !sizer )
        return NULL;

    return CreateSeparatedSizer(sizer);
}
示例#6
0
ChoiceDialog::ChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption, const wxArrayString& choices, long styleDlg, const wxPoint& pos)
    : wxMultiChoiceDialog(parent, message, caption, choices, styleDlg, pos)
{
  wxSizer *sizer = GetSizer();
  sizer->Add(CreateButtonSizer(wxYES | wxNO | wxCANCEL));
  Fit();
  Layout();
}
示例#7
0
SlitPropertiesDlg::SlitPropertiesDlg(wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
    : wxDialog(parent, id, title, pos, size, style)
{
    wxBoxSizer *vSizer = new wxBoxSizer(wxVERTICAL);
    wxBoxSizer *hSizer = new wxBoxSizer(wxHORIZONTAL);
    wxStaticBoxSizer *szPosition = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Position (Center)")), wxVERTICAL);
    wxStaticBoxSizer *szSlitSize = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Size")), wxVERTICAL);
    // Position controls
    wxBoxSizer *hXSizer = new wxBoxSizer(wxHORIZONTAL);
    wxStaticText *xLabel = new wxStaticText(this, wxID_ANY, _("X"), wxDefaultPosition, wxDefaultSize, 0);
    hXSizer->Add(xLabel, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
    m_x = new wxSpinCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(80, -1), wxSP_ARROW_KEYS, 0, 8000, 0);
    hXSizer->Add(m_x, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
    szPosition->Add(hXSizer, 0, wxEXPAND, 5);

    wxBoxSizer *hYSizer = new wxBoxSizer(wxHORIZONTAL);
    wxStaticText* yLabel = new wxStaticText(this, wxID_ANY, _("Y"), wxDefaultPosition, wxDefaultSize, 0);
    hYSizer->Add(yLabel, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
    m_y = new wxSpinCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(80, -1), wxSP_ARROW_KEYS, 0, 8000, 0);
    hYSizer->Add(m_y, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
    szPosition->Add(hYSizer, 1, wxEXPAND, 5);
    hSizer->Add(szPosition, 1, 0, 5);

    // Size controls
    wxBoxSizer* hWidthSizer = new wxBoxSizer(wxHORIZONTAL);
    wxStaticText* widthLabel = new wxStaticText(this, wxID_ANY, _("Width"), wxDefaultPosition, wxSize(40, -1), 0);
    hWidthSizer->Add(widthLabel, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
    m_width = new wxSpinCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(80, -1), wxSP_ARROW_KEYS, 2, 1000, 2);
    hWidthSizer->Add(m_width, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
    szSlitSize->Add(hWidthSizer, 1, wxEXPAND, 5);

    wxBoxSizer* hHeightSizer = new wxBoxSizer(wxHORIZONTAL);
    wxStaticText* heightLabel = new wxStaticText(this, wxID_ANY, _("Height"), wxDefaultPosition, wxSize(40, -1), 0);
    hHeightSizer->Add(heightLabel, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
    m_height = new wxSpinCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(80, -1), wxSP_ARROW_KEYS, 2, 1000, 2);
    hHeightSizer->Add(m_height, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
    szSlitSize->Add(hHeightSizer, 1, wxEXPAND, 5);
    hSizer->Add(szSlitSize, 1, 0, 5);

    vSizer->Add(hSizer, 0, wxEXPAND, 5);
    // Angle controls
    wxBoxSizer* hAngleSizer = new wxBoxSizer(wxHORIZONTAL);
    wxStaticText* staticText1 = new wxStaticText(this, wxID_ANY, _("Angle (degrees)"), wxDefaultPosition, wxDefaultSize, 0);
    //staticText1->Wrap(-1);
    hAngleSizer->Add(staticText1, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
    m_angle = new wxSpinCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(80, -1), wxSP_ARROW_KEYS, -90, 90, 0);
    hAngleSizer->Add(m_angle, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);

    vSizer->Add(hAngleSizer, 0, wxEXPAND, 5);

    // ok/cancel buttons
    vSizer->Add(
        CreateButtonSizer(wxOK | wxCANCEL),
        wxSizerFlags(0).Expand().Border(wxALL, 10));

    SetSizerAndFit(vSizer);
}
/*******************************************************************
* GFXCOLOURISEDIALOG FUNCTIONS
*******************************************************************/
GfxColouriseDialog::GfxColouriseDialog(wxWindow* parent, ArchiveEntry* entry, Palette8bit* pal)
: wxDialog(parent, -1, "Colourise", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
{
	// Init variables
	this->entry = entry;
	this->palette = pal;

	// Set dialog icon
	wxIcon icon;
	icon.CopyFromBitmap(getIcon("t_colourise"));
	SetIcon(icon);

	// Setup main sizer
	wxBoxSizer* msizer = new wxBoxSizer(wxVERTICAL);
	SetSizer(msizer);
	wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
	msizer->Add(sizer, 1, wxEXPAND|wxALL, 6);

	// Add colour chooser
	wxBoxSizer* hbox = new wxBoxSizer(wxHORIZONTAL);
	sizer->Add(hbox, 0, wxEXPAND|wxALL, 4);

	cp_colour = new wxColourPickerCtrl(this, -1, wxColour(255, 0, 0));
	hbox->Add(new wxStaticText(this, -1, "Colour:"), 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
	hbox->Add(cp_colour, 0, wxEXPAND);

	// Add preview
	gfx_preview = new GfxCanvas(this, -1);
	sizer->Add(gfx_preview, 1, wxEXPAND|wxALL, 4);

	// Add buttons
	sizer->Add(CreateButtonSizer(wxOK|wxCANCEL), 0, wxEXPAND|wxBOTTOM, 4);

	// Setup preview
	gfx_preview->setViewType(GFXVIEW_CENTERED);
	gfx_preview->setPalette(pal);
	gfx_preview->SetInitialSize(wxSize(192, 192));
	Misc::loadImageFromEntry(gfx_preview->getImage(), entry);
	wxColour col = cp_colour->GetColour();
	gfx_preview->getImage()->colourise(rgba_t(col.Red(), col.Green(), col.Blue()), pal);
	gfx_preview->updateImageTexture();

	// Init layout
	Layout();

	// Bind events
	cp_colour->Bind(wxEVT_COLOURPICKER_CHANGED, &GfxColouriseDialog::onColourChanged, this);
	Bind(wxEVT_SIZE, &GfxColouriseDialog::onResize, this);

	// Setup dialog size
	SetInitialSize(wxSize(-1, -1));
	SetMinSize(GetSize());
	CenterOnParent();
}
示例#9
0
CARCodeAddEdit::CARCodeAddEdit(int _selection, std::vector<ActionReplay::ARCode>* _arCodes, wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& position, const wxSize& size, long style)
    : wxDialog(parent, id, title, position, size, style)
    , arCodes(_arCodes)
    , selection(_selection)
{
    Bind(wxEVT_BUTTON, &CARCodeAddEdit::SaveCheatData, this, wxID_OK);

    ActionReplay::ARCode tempEntries;
    wxString currentName;

    if (selection == wxNOT_FOUND)
    {
        tempEntries.name = "";
    }
    else
    {
        currentName = StrToWxStr(arCodes->at(selection).name);
        tempEntries = arCodes->at(selection);
    }

    wxBoxSizer* sEditCheat = new wxBoxSizer(wxVERTICAL);
    wxStaticBoxSizer* sbEntry = new wxStaticBoxSizer(wxVERTICAL, this, _("Cheat Code"));
    wxGridBagSizer* sgEntry = new wxGridBagSizer(0, 0);

    wxStaticText* EditCheatNameText = new wxStaticText(this, wxID_ANY, _("Name:"));
    wxStaticText* EditCheatCodeText = new wxStaticText(this, wxID_ANY, _("Code:"));

    EditCheatName = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
    EditCheatName->SetValue(currentName);

    EntrySelection = new wxSpinButton(this);
    EntrySelection->SetRange(1, std::max((int)arCodes->size(), 1));
    EntrySelection->SetValue((int)(arCodes->size() - selection));
    EntrySelection->Bind(wxEVT_SPIN, &CARCodeAddEdit::ChangeEntry, this);

    EditCheatCode = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(300, 100), wxTE_MULTILINE);

    UpdateTextCtrl(tempEntries);

    sgEntry->Add(EditCheatNameText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER | wxALL, 5);
    sgEntry->Add(EditCheatCodeText, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALIGN_CENTER | wxALL, 5);
    sgEntry->Add(EditCheatName, wxGBPosition(0, 1), wxGBSpan(1, 1), wxEXPAND | wxALL, 5);
    sgEntry->Add(EntrySelection, wxGBPosition(0, 2), wxGBSpan(2, 1), wxEXPAND | wxALL, 5);
    sgEntry->Add(EditCheatCode, wxGBPosition(1, 1), wxGBSpan(1, 1), wxEXPAND | wxALL, 5);
    sgEntry->AddGrowableCol(1);
    sgEntry->AddGrowableRow(1);
    sbEntry->Add(sgEntry, 1, wxEXPAND | wxALL);

    sEditCheat->Add(sbEntry, 1, wxEXPAND | wxALL, 5);
    sEditCheat->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxEXPAND | wxALL, 5);

    SetSizerAndFit(sEditCheat);
    SetFocus();
}
示例#10
0
void nsDialog::ApplyRootSizer(wxSizer* sz)
{
	wxBoxSizer* main = new wxBoxSizer(wxVERTICAL);


	wxSizer* okc = CreateButtonSizer(wxOK | wxCANCEL);
	sz->Add(okc, wxSizerFlags(1).Right());
	main->Add(sz, wxSizerFlags(1).Border(wxALL, 10));

	SetSizer( main );
	main->SetSizeHints( this );
}
示例#11
0
UDPConfigDiag::UDPConfigDiag(wxWindow * const parent, UDPWrapper * _wrp) :
	wxDialog(parent, -1, _("UDP Wiimote")),
	wrp(_wrp)
{
	wxBoxSizer *const outer_sizer = new wxBoxSizer(wxVERTICAL);
	wxBoxSizer *const sizer1 = new wxBoxSizer(wxVERTICAL);
	wxStaticBoxSizer *const sizer2 = new wxStaticBoxSizer(wxVERTICAL, this, _("Update"));

	outer_sizer->Add(sizer1, 0, wxTOP | wxLEFT | wxRIGHT | wxEXPAND, 5);
	outer_sizer->Add(sizer2, 1, wxLEFT | wxRIGHT | wxEXPAND, 10);

	enable = new wxCheckBox(this, wxID_ANY, _("Enable"));
	butt = new wxCheckBox(this, wxID_ANY, _("Buttons"));
	accel = new wxCheckBox(this, wxID_ANY, _("Acceleration"));
	point = new wxCheckBox(this, wxID_ANY, _("IR Pointer"));
	nun = new wxCheckBox(this, wxID_ANY, _("Nunchuk"));
	nunaccel = new wxCheckBox(this, wxID_ANY, _("Nunchuk Acceleration"));

	wxBoxSizer *const port_sizer = new wxBoxSizer(wxHORIZONTAL);
	port_sizer->Add(new wxStaticText(this, wxID_ANY, _("UDP Port:")), 0, wxALIGN_CENTER);
	port_tbox = new wxTextCtrl(this, wxID_ANY, StrToWxStr(wrp->port));
	port_sizer->Add(port_tbox, 1, wxLEFT | wxEXPAND, 5);

	enable->Bind(wxEVT_CHECKBOX, &UDPConfigDiag::ChangeState, this);
	butt->Bind(wxEVT_CHECKBOX, &UDPConfigDiag::ChangeUpdateFlags, this);
	accel->Bind(wxEVT_CHECKBOX, &UDPConfigDiag::ChangeUpdateFlags, this);
	point->Bind(wxEVT_CHECKBOX, &UDPConfigDiag::ChangeUpdateFlags, this);
	nun->Bind(wxEVT_CHECKBOX, &UDPConfigDiag::ChangeUpdateFlags, this);
	nunaccel->Bind(wxEVT_CHECKBOX, &UDPConfigDiag::ChangeUpdateFlags, this);
	port_tbox->Bind(wxEVT_TEXT, &UDPConfigDiag::ChangeState, this);

	enable->SetValue(wrp->udpEn);
	butt->SetValue(wrp->updButt);
	accel->SetValue(wrp->updAccel);
	point->SetValue(wrp->updIR);
	nun->SetValue(wrp->updNun);
	nunaccel->SetValue(wrp->updNunAccel);

	sizer1->Add(enable, 1, wxALL | wxEXPAND, 5);
	sizer1->Add(port_sizer, 1, wxBOTTOM | wxLEFT| wxRIGHT | wxEXPAND, 5);

	sizer2->Add(butt, 1, wxALL | wxEXPAND, 5);
	sizer2->Add(accel, 1, wxALL | wxEXPAND, 5);
	sizer2->Add(point, 1, wxALL | wxEXPAND, 5);
	sizer2->Add(nun, 1, wxALL | wxEXPAND, 5);
	sizer2->Add(nunaccel, 1, wxALL | wxEXPAND, 5);

	outer_sizer->Add(CreateButtonSizer(wxOK), 0, wxALL | wxALIGN_RIGHT, 5);

	SetSizerAndFit(outer_sizer);
	Center();
	SetFocus();
}
示例#12
0
void CalRestoreDialog::AddButtons(CalReviewDialog* parentDialog, wxBoxSizer* parentVSizer)
{
    wxBoxSizer *pButtonSizer = new wxBoxSizer(wxHORIZONTAL);
    wxButton *pRestore = new wxButton(parentDialog, wxID_OK, _("Restore"));
    pRestore->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &CalRestoreDialog::OnRestore, this);
    pButtonSizer->Add(
        pRestore,
        wxSizerFlags(0).Align(0).Border(wxRIGHT | wxLEFT | wxBOTTOM, 10));
    pButtonSizer->Add(
        CreateButtonSizer(wxCANCEL),
        wxSizerFlags(0).Align(0).Border(wxRIGHT | wxLEFT | wxBOTTOM, 10));
    parentVSizer->Add(pButtonSizer, wxSizerFlags(0).Center());
}
示例#13
0
ConfigDialog::ConfigDialog(wxWindow *parent, wxWindowID id, const wxString &title, bool change)
: wxDialog(parent, id, title)
{
	wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
	m_book = new wxBookCtrl(this, wxID_ANY);
	m_book->AddPage(createInitialPanel(m_book), HaStrings::strInitial);
	m_book->AddPage(createPasswordPanel(m_book), HaStrings::strChangePasswd);
	sizer->Add(m_book, wxSizerFlags().Border().Expand());
	wxSizer *sizer_bt = CreateButtonSizer(wxOK|wxCANCEL);
	if (sizer_bt != NULL) sizer->Add(sizer_bt, wxSizerFlags().Border().Expand());
	SetSizer(sizer);
	sizer->SetSizeHints(this);
}
示例#14
0
BreakPointDlg::BreakPointDlg(CBreakPointWindow *_Parent)
	: wxDialog(_Parent, wxID_ANY, wxT("BreakPoint"))
	, Parent(_Parent)
{
	m_pEditAddress = new wxTextCtrl(this, wxID_ANY, wxT("80000000"));

	wxBoxSizer *sMainSizer = new wxBoxSizer(wxVERTICAL);
	sMainSizer->Add(m_pEditAddress, 0, wxEXPAND | wxALL, 5);
	sMainSizer->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxALL, 5);

	SetSizerAndFit(sMainSizer);
	SetFocus();
}
示例#15
0
void wxGenericColourDialog::CreateWidgets()
{
    wxBeginBusyCursor();

    wxBoxSizer *topSizer = new wxBoxSizer( wxVERTICAL );

    const int sliderHeight = 160;

#if wxUSE_SLIDER
    const int sliderX = singleCustomColourRect.x + singleCustomColourRect.width + sectionSpacing;

    redSlider = new wxSlider(this, wxID_RED_SLIDER, colourData.m_dataColour.Red(), 0, 255,
        wxDefaultPosition, wxSize(wxDefaultCoord, sliderHeight), wxSL_VERTICAL|wxSL_LABELS|wxSL_INVERSE);
    greenSlider = new wxSlider(this, wxID_GREEN_SLIDER, colourData.m_dataColour.Green(), 0, 255,
        wxDefaultPosition, wxSize(wxDefaultCoord, sliderHeight), wxSL_VERTICAL|wxSL_LABELS|wxSL_INVERSE);
    blueSlider = new wxSlider(this, wxID_BLUE_SLIDER, colourData.m_dataColour.Blue(), 0, 255,
        wxDefaultPosition, wxSize(wxDefaultCoord, sliderHeight), wxSL_VERTICAL|wxSL_LABELS|wxSL_INVERSE);

    wxBoxSizer *sliderSizer = new wxBoxSizer( wxHORIZONTAL );

    // 1) space for sliders
    sliderSizer->Add( sliderX, sliderHeight );
    sliderSizer->Add( redSlider, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxALL, 10 );
    sliderSizer->Add( greenSlider, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxALL, 10 );
    sliderSizer->Add( blueSlider, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxALL, 10 );

    topSizer->Add( sliderSizer, 0, wxCENTRE | wxALL, 10 );
#else
    topSizer->Add( 1, sliderHeight, 0, wxCENTRE | wxALL, 15 );
#endif // wxUSE_SLIDER

#if wxUSE_STATLINE
    // 2) static line
    topSizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
#endif

    // 3) buttons
    wxSizer *buttonsizer = CreateButtonSizer( wxOK|wxCANCEL );
    buttonsizer->Add( new wxButton(this, wxID_ADD_CUSTOM, _("Add to custom colours") ), 0, wxLEFT|wxRIGHT, 10 );
    topSizer->Add( buttonsizer, 0, wxEXPAND | wxALL, 10 );

    SetAutoLayout( true );
    SetSizer( topSizer );

    topSizer->SetSizeHints( this );
    topSizer->Fit( this );

    Centre( wxBOTH );

    wxEndBusyCursor();
}
示例#16
0
wxMessageDialogEx::wxMessageDialogEx( wxWindow *parent, const wxString& message, const wxString &caption,
    long style, const wxPoint& position) :
    wxDialog( parent, -1, caption, position, wxDefaultSize, wxDEFAULT_DIALOG_STYLE )
{
    m_dialogStyle = style;

    wxBeginBusyCursor();

    wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );

    wxBoxSizer *icon_text = new wxBoxSizer( wxHORIZONTAL );

    // 1) icon
    if (style & wxICON_MASK)
    {
         wxStaticBitmap *icon = new wxStaticBitmap(
            this, -1, wxTheApp->GetStdIcon((int)(style & wxICON_MASK)));
         icon_text->Add( icon, 0, wxCENTER );
    }

    // 2) text
    icon_text->Add( CreateTextSizer( message ), 0, wxCENTER | wxLEFT, 10 );

    topsizer->Add( icon_text, 0, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 );

#if wxUSE_STATLINE
    // 3) static line
    topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
#endif

    // 4) buttons
    topsizer->Add( CreateButtonSizer( style ), 0, wxCENTRE | wxALL, 10 );

    SetAutoLayout( TRUE );
    SetSizer( topsizer );

    topsizer->SetSizeHints( this );
    topsizer->Fit( this );
    wxSize size( GetSize() );
    if (size.x < size.y*3/2)
    {
        size.x = size.y*3/2;
        SetSize( size );
    }

    Centre( wxBOTH | wxCENTER_FRAME);

    wxEndBusyCursor();
}
示例#17
0
	PaletteColouriseDialog(wxWindow* parent, Palette8bit* pal)
		: wxDialog(parent, -1, "Colourise", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
	{
		// Init variable
		this->palette = pal;

		// Set dialog icon
		wxIcon icon;
		icon.CopyFromBitmap(Icons::getIcon(Icons::GENERAL, "palette_colourise"));
		SetIcon(icon);

		// Setup main sizer
		wxBoxSizer* msizer = new wxBoxSizer(wxVERTICAL);
		SetSizer(msizer);
		wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
		msizer->Add(sizer, 1, wxEXPAND|wxALL, 6);

		// Add colour chooser
		wxBoxSizer* hbox = new wxBoxSizer(wxHORIZONTAL);
		sizer->Add(hbox, 0, wxEXPAND|wxALL, 4);

		cp_colour = new wxColourPickerCtrl(this, -1, wxColour(255, 0, 0));
		hbox->Add(new wxStaticText(this, -1, "Colour:"), 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
		hbox->Add(cp_colour, 0, wxEXPAND);

		// Add preview
		pal_preview = new PaletteCanvas(this, -1);
		sizer->Add(pal_preview, 1, wxEXPAND|wxALL, 4);

		// Add buttons
		sizer->Add(CreateButtonSizer(wxOK|wxCANCEL), 0, wxEXPAND|wxBOTTOM|wxTOP, 4);

		// Setup preview
		pal_preview->allowSelection(2);
		pal_preview->SetInitialSize(wxSize(384, 384));
		redraw();

		// Init layout
		Layout();

		// Bind events
		cp_colour->Bind(wxEVT_COLOURPICKER_CHANGED, &PaletteColouriseDialog::onColourChanged, this);
		pal_preview->Bind(wxEVT_LEFT_UP, &PaletteColouriseDialog::onPaletteLeftUp, this);

		// Setup dialog size
		SetInitialSize(wxSize(-1, -1));
		SetMinSize(GetSize());
		CenterOnParent();
	}
示例#18
0
GuitarInputConfigDialog::GuitarInputConfigDialog(wxWindow* const parent, InputConfig& config,
	const wxString& name, const int port_num)
	: InputConfigDialog(parent, config, name, port_num)
{
	const int space5 = FromDIP(5);

	auto* const group_box_buttons = new ControlGroupBox(
		Wiimote::GetGuitarGroup(port_num, WiimoteEmu::GuitarGroup::Buttons), this, this);
	auto* const group_left_strum = new ControlGroupBox(
		Wiimote::GetGuitarGroup(port_num, WiimoteEmu::GuitarGroup::Strum), this, this);

	auto* const buttons_strum_sizer = new wxBoxSizer(wxVERTICAL);
	buttons_strum_sizer->Add(group_box_buttons, 0, wxEXPAND);
	buttons_strum_sizer->AddSpacer(space5);
	buttons_strum_sizer->Add(group_left_strum, 0, wxEXPAND);

	auto* const group_box_frets = new ControlGroupBox(
		Wiimote::GetGuitarGroup(port_num, WiimoteEmu::GuitarGroup::Frets), this, this);
	ControlGroupBox* group_box_whammy = new ControlGroupBox(
		Wiimote::GetGuitarGroup(port_num, WiimoteEmu::GuitarGroup::Whammy), this, this);

	auto* const frets_whammy_sizer = new wxBoxSizer(wxVERTICAL);
	frets_whammy_sizer->Add(group_box_frets, 0, wxEXPAND);
	frets_whammy_sizer->AddSpacer(space5);
	frets_whammy_sizer->Add(group_box_whammy, 0, wxEXPAND);

	auto* const group_box_stick = new ControlGroupBox(
		Wiimote::GetGuitarGroup(port_num, WiimoteEmu::GuitarGroup::Stick), this, this);

	auto* const controls_sizer = new wxBoxSizer(wxHORIZONTAL);
	controls_sizer->AddSpacer(space5);
	controls_sizer->Add(buttons_strum_sizer, 0, wxEXPAND);
	controls_sizer->AddSpacer(space5);
	controls_sizer->Add(frets_whammy_sizer, 0, wxEXPAND);
	controls_sizer->AddSpacer(space5);
	controls_sizer->Add(group_box_stick, 0, wxEXPAND);
	controls_sizer->AddSpacer(space5);

	auto* const szr_main = new wxBoxSizer(wxVERTICAL);
	szr_main->AddSpacer(space5);
	szr_main->Add(controls_sizer, 1, wxEXPAND | wxLEFT | wxRIGHT, space5);
	szr_main->AddSpacer(space5);
	szr_main->Add(CreateButtonSizer(wxCLOSE | wxNO_DEFAULT), 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
	szr_main->AddSpacer(space5);

	SetSizerAndFit(szr_main);
	Center();
	UpdateGUI();
}
示例#19
0
CreateCodeDialog::CreateCodeDialog(wxWindow* const parent, const u32 address)
    : wxDialog(parent, wxID_ANY, _("Create AR Code")), m_code_address(address)
{
  wxStaticText* const label_name = new wxStaticText(this, wxID_ANY, _("Name: "));
  m_textctrl_name = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition,
                                   wxDLG_UNIT(this, wxSize(180, -1)));

  wxStaticText* const label_code = new wxStaticText(this, wxID_ANY, _("Code: "));
  m_textctrl_code = new wxTextCtrl(this, wxID_ANY, wxString::Format("0x%08x", address));
  m_textctrl_code->Disable();

  wxStaticText* const label_value = new wxStaticText(this, wxID_ANY, _("Value: "));
  m_textctrl_value = new wxTextCtrl(this, wxID_ANY, "0");

  m_checkbox_use_hex = new wxCheckBox(this, wxID_ANY, _("Use Hex"));
  m_checkbox_use_hex->SetValue(true);

  wxBoxSizer* const sizer_value_label = new wxBoxSizer(wxHORIZONTAL);
  const int space5 = FromDIP(5);
  sizer_value_label->Add(label_value);
  sizer_value_label->Add(m_checkbox_use_hex, 0, wxLEFT, space5);

  // main sizer
  wxBoxSizer* const sizer_main = new wxBoxSizer(wxVERTICAL);
  sizer_main->AddSpacer(space5);
  sizer_main->Add(label_name, 0, wxLEFT | wxRIGHT, space5);
  sizer_main->AddSpacer(space5);
  sizer_main->Add(m_textctrl_name, 0, wxLEFT | wxRIGHT, space5);
  sizer_main->AddSpacer(space5);
  sizer_main->Add(label_code, 0, wxLEFT | wxRIGHT, space5);
  sizer_main->AddSpacer(space5);
  sizer_main->Add(m_textctrl_code, 0, wxLEFT | wxRIGHT, space5);
  sizer_main->AddSpacer(space5);
  sizer_main->Add(sizer_value_label, 0, wxLEFT | wxRIGHT, space5);
  sizer_main->AddSpacer(space5);
  sizer_main->Add(m_textctrl_value, 0, wxLEFT | wxRIGHT, space5);
  sizer_main->AddSpacer(space5);
  sizer_main->Add(CreateButtonSizer(wxOK | wxCANCEL | wxNO_DEFAULT), 0, wxEXPAND | wxLEFT | wxRIGHT,
                  space5);
  sizer_main->AddSpacer(space5);

  // NOTE: Use default wxCANCEL handling.
  Bind(wxEVT_BUTTON, &CreateCodeDialog::PressOK, this, wxID_OK);

  SetSizerAndFit(sizer_main);
  SetFocus();
}
示例#20
0
ImageMessageBox::ImageMessageBox(wxWindow *parent, wxString title, 
				 wxString text, wxBitmap img, int style)  {
  if (! wxDialog::Create(parent, wxID_ANY, title))
    return;

  image = new wxStaticBitmap(this, wxID_ANY, img);

  wxBoxSizer *dlgsizer = new wxBoxSizer(wxVERTICAL);
  SetSizer(dlgsizer);
  dlgsizer->Add(image, 0, wxALL|wxALIGN_CENTER, 5);
  while (text.Len() != 0) {
    int index = text.Find('\n');
    if (index != -1) {
      wxStaticText *message = new wxStaticText(this, wxID_ANY, text.Mid(0, index+1));
      dlgsizer->Add(message, 0, wxALIGN_LEFT|wxEXPAND|wxLEFT|wxRIGHT, 10);
      text = text.Mid(index+1);
    } else {
      wxStaticText *message = new wxStaticText(this, wxID_ANY, text);
      dlgsizer->Add(message, 0, wxEXPAND|wxALIGN_LEFT|wxLEFT|wxRIGHT, 10);
      text = "";
    }
  }

  wxSizer *buttonbox = CreateButtonSizer(style);
  dlgsizer->Add(buttonbox, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 10);
  
  wxSizer *sizer = GetSizer();
  sizer->SetSizeHints(this);
  /*  
wxLogDebug("message %d", message->GetSize().GetHeight());
  sizer->SetMinSize(wxSize(sizer->GetMinSize().GetWidth(), 
			   img.GetHeight() + message->GetSize().GetHeight()+10)); 
  wxLogDebug("message2 %d", message->GetSize().GetHeight());
  
  sizer->SetSizeHints(this);
  wxLogDebug("message3 %d", message->GetSize().GetHeight());


  wxSize s ;
  s = message->GetBestSize();
  wxLogDebug("%d, %d", s.GetWidth(), s.GetHeight());
  s = message->GetAdjustedBestSize();
  wxLogDebug("%d, %d", s.GetWidth(), s.GetHeight());
  */
  Centre();
  return;
}
示例#21
0
PadMapDiag::PadMapDiag(wxWindow* const parent, int map[])
    : wxDialog(parent, wxID_ANY, _("Configure Pads"), wxDefaultPosition, wxDefaultSize)
    , m_mapping(map)
{
    wxBoxSizer* const h_szr = new wxBoxSizer(wxHORIZONTAL);

    h_szr->AddSpacer(20);

    // labels
    wxBoxSizer* const label_szr = new wxBoxSizer(wxVERTICAL);
    label_szr->Add(new wxStaticText(this, wxID_ANY, _("Local")), 0, wxALIGN_TOP);
    label_szr->AddStretchSpacer(1);
    label_szr->Add(new wxStaticText(this, wxID_ANY, _("In-Game")), 0, wxALIGN_BOTTOM);

    h_szr->Add(label_szr, 1, wxTOP | wxEXPAND, 20);

    // set up choices
    wxString pad_names[5];
    pad_names[0] = _("None");
    for (unsigned int i=1; i<5; ++i)
        pad_names[i] = wxString(_("Pad ")) + (wxChar)(wxT('0')+i);

    for (unsigned int i=0; i<4; ++i)
    {
        wxChoice* const pad_cbox = m_map_cbox[i]
                                   = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 5, pad_names);
        pad_cbox->Select(m_mapping[i] + 1);

        pad_cbox->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &PadMapDiag::OnAdjust, this);

        wxBoxSizer* const v_szr = new wxBoxSizer(wxVERTICAL);
        v_szr->Add(new wxStaticText(this,wxID_ANY, pad_names[i + 1]), 1, wxALIGN_CENTER_HORIZONTAL);
        v_szr->Add(pad_cbox, 1);

        h_szr->Add(v_szr, 1, wxTOP | wxEXPAND, 20);
    }

    h_szr->AddSpacer(20);

    wxBoxSizer* const main_szr = new wxBoxSizer(wxVERTICAL);
    main_szr->Add(h_szr);
    main_szr->AddSpacer(5);
    main_szr->Add(CreateButtonSizer(wxOK), 0, wxEXPAND | wxLEFT | wxRIGHT, 20);
    main_szr->AddSpacer(5);
    SetSizerAndFit(main_szr);
    SetFocus();
}
CDVRPTRClientPreferences::CDVRPTRClientPreferences(wxWindow* parent, int id, const wxString& callsign1,
								   const wxString& callsign2, const wxString& readDevice, const wxString& writeDevice,
								   DVRPTR_VERSION version, const wxString& port, bool rxInvert,
								   bool txInvert, bool channel, unsigned int modLevel, unsigned int txDelay,
								   const wxString& dvdDevice, const wxString& message, bool bleep) :
wxDialog(parent, id, wxString(_("DVRPTR Client Preferences")), wxDefaultPosition, wxDefaultSize, wxRESIZE_BORDER | wxDEFAULT_DIALOG_STYLE),
m_callsign(NULL),
m_soundcard(NULL),
m_modem(NULL),
m_dongle(NULL),
m_message(NULL),
m_bleep(NULL)
{
	wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);

	wxNotebook* noteBook = new wxNotebook(this, -1);

	m_callsign = new CDVRPTRClientCallsignSet(noteBook, -1, APPLICATION_NAME, callsign1, callsign2);
	noteBook->AddPage(m_callsign, _("Callsign"), true);

	m_soundcard = new CSoundcardSet(noteBook, -1, APPLICATION_NAME, readDevice, writeDevice);
	noteBook->AddPage(m_soundcard, _("Sound Card"), false);

	m_modem = new CDVRPTRClientModemSet(noteBook, -1, APPLICATION_NAME, version, port, rxInvert, txInvert, channel, modLevel, txDelay);
	noteBook->AddPage(m_modem, _("Modem"), false);

	m_dongle = new CDVDongleSet(noteBook, -1, APPLICATION_NAME, dvdDevice);
	noteBook->AddPage(m_dongle, _("DV-Dongle"), false);

	m_message = new CMessageSet(noteBook, -1, APPLICATION_NAME, message);
	noteBook->AddPage(m_message, _("Message"), false);

	m_bleep = new CBleepSet(noteBook, -1, APPLICATION_NAME, bleep);
	noteBook->AddPage(m_bleep, _("Bleep"), false);

	mainSizer->Add(noteBook, 1, wxALL | wxGROW, BORDER_SIZE);

	mainSizer->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE);

	SetAutoLayout(true);
	Layout();

	mainSizer->Fit(this);
	mainSizer->SetSizeHints(this);

	SetSizer(mainSizer);
}
示例#23
0
BreakPointDlg::BreakPointDlg(wxWindow* _Parent) : wxDialog(_Parent, wxID_ANY, _("Add Breakpoint"))
{
  Bind(wxEVT_BUTTON, &BreakPointDlg::OnOK, this, wxID_OK);

  m_pEditAddress = new wxTextCtrl(this, wxID_ANY, "80000000");

  const int space5 = FromDIP(5);
  wxBoxSizer* main_szr = new wxBoxSizer(wxVERTICAL);
  main_szr->AddSpacer(space5);
  main_szr->Add(m_pEditAddress, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
  main_szr->AddSpacer(space5);
  main_szr->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
  main_szr->AddSpacer(space5);

  SetSizerAndFit(main_szr);
  SetFocus();
}
示例#24
0
OViSEPathConfigDialog::OViSEPathConfigDialog( wxString  PluginPath,
                                              wxString  MediaPath,
                                              wxWindow* parent )
	: PathConfigDialog( parent )
{
	this->mPluginDirPicker->SetPath( PluginPath );
	this->mMediaDirPicker->SetPath( MediaPath );

	wxSizer* ButtonSizer = CreateButtonSizer( wxOK | wxCANCEL );

	if ( ButtonSizer )
	{
		mMainSizer->Add( ButtonSizer, 0, wxEXPAND,5 );
		this->Layout();
		mMainSizer->SetSizeHints( this );
	}
}
示例#25
0
	CreateTextureXDialog(wxWindow* parent) : wxDialog(parent, -1, "Create Texture Definitions")
	{
		// Setup layout
		auto m_vbox = new wxBoxSizer(wxVERTICAL);
		SetSizer(m_vbox);

		// --- Format options ---
		auto frame      = new wxStaticBox(this, -1, "Format");
		auto framesizer = new wxStaticBoxSizer(frame, wxVERTICAL);
		m_vbox->Add(framesizer, 0, wxEXPAND | wxALL, UI::pad());

		// Doom format
		rb_format_doom_ = new wxRadioButton(
			this, -1, "Doom (TEXTURE1 + PNAMES)", wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
		rb_format_strife_   = new wxRadioButton(this, -1, "Strife (TEXTURE1 + PNAMES)");
		rb_format_textures_ = new wxRadioButton(this, -1, "ZDoom (TEXTURES)");
		WxUtils::layoutVertically(
			framesizer,
			{ rb_format_doom_, rb_format_strife_, rb_format_textures_ },
			wxSizerFlags(1).Expand().Border(wxALL, UI::pad()));


		// --- Source options ---
		frame      = new wxStaticBox(this, -1, "Source");
		framesizer = new wxStaticBoxSizer(frame, wxVERTICAL);
		m_vbox->Add(framesizer, 0, wxEXPAND | wxALL, UI::pad());

		// New list
		rb_new_ = new wxRadioButton(this, -1, "Create New (Empty)", wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
		framesizer->Add(rb_new_, 0, wxEXPAND | wxALL, UI::pad());

		// Import from Base Resource Archive
		rb_import_bra_ = new wxRadioButton(this, -1, "Import from Base Resource Archive:");
		framesizer->Add(rb_import_bra_, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, UI::pad());

		// Add buttons
		m_vbox->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxEXPAND | wxALL, UI::pad());

		// Bind events
		rb_new_->Bind(wxEVT_RADIOBUTTON, &CreateTextureXDialog::onRadioNewSelected, this);
		rb_import_bra_->Bind(wxEVT_RADIOBUTTON, &CreateTextureXDialog::onRadioNewSelected, this);

		SetInitialSize(wxSize(-1, -1));
		wxWindowBase::Layout();
	}
示例#26
0
YearDeleter::YearDeleter(wxFrame *frame, Database *database)
      :wxDialog(frame, wxID_ANY, wxT("Year deleter"), wxPoint(100,100), wxSize(500, 180),
       wxDEFAULT_DIALOG_STYLE | wxSTAY_ON_TOP)
{
  this->database = database;

  wxStaticText *study_program_text = new wxStaticText(this, -1, "Study program:");
  wxFont font = study_program_text->GetFont();
  font.SetWeight(wxFONTWEIGHT_BOLD);
  study_program_text->SetFont(font);
  wxStaticText *year_text = new wxStaticText(this, -1, "Year:");
  year_text->SetFont(font);

  wxArrayString *sp = database->getFaculties();
  study_program = new wxComboBox(this, ID_DELETER_STUDY_PROGRAM, wxT(""), wxPoint(120,27),
                                 wxSize(300,25), *sp, wxCB_READONLY);
  study_program->SetSelection(0);

  wxArrayString *sy = database->getYears(study_program->GetValue());
  year = new wxComboBox(this, wxID_ANY, wxT(""), wxPoint(120,67), wxSize(300,25), *sy, wxCB_READONLY);
  year->SetSelection(0);

  //Create button
  create = new wxButton(this, ID_DELETER_DELETE_YEAR, wxT("Delete"));
  if(year->GetCount() == 0)
    create->Enable(false);

  //Positioning of elements in dialog
  wxFlexGridSizer *flex = new wxFlexGridSizer(2, 2, 25, 10);
  flex->Add(study_program_text, 0, wxALIGN_RIGHT | wxTOP, 3);
  flex->Add(study_program, 0, wxALIGN_LEFT);
  flex->Add(year_text, 0, wxALIGN_RIGHT | wxTOP, 3);
  flex->Add(year, 0, wxALIGN_LEFT);

  wxBoxSizer *button_row = new wxBoxSizer(wxHORIZONTAL);
  button_row->Add(CreateButtonSizer(wxCANCEL), 0, wxALIGN_LEFT);
  button_row->AddStretchSpacer(1);
  button_row->Add(create, 0, wxALIGN_RIGHT);

  wxBoxSizer *column = new wxBoxSizer(wxVERTICAL);
  column->Add(flex, 0, wxALL | wxEXPAND, 10);
  column->Add(button_row, 0, wxRIGHT | wxLEFT | wxEXPAND, 10);

  SetSizer(column);
}//CourseCreator
示例#27
0
RemoteLoginDlg::RemoteLoginDlg(wxWindow *parent, const wxString& username, const wxString& site, bool askToSave)
: wxDialog (parent, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER) {
	SetTitle (_("Login failed"));

	wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
	{
		wxStaticText* labelInfo = new wxStaticText(this, wxID_ANY, _("Please enter new login for\n") + site);
		mainSizer->Add(labelInfo, 0, wxALL, 5);

		wxFlexGridSizer* gridSizer = new wxFlexGridSizer(2,2, 0, 0);
		{
			gridSizer->AddGrowableCol(1); // col 2 is sizable

			wxStaticText* labelUsername = new wxStaticText(this, wxID_ANY, _("Username:"******"Username for login"));
			gridSizer->Add(m_profileUsername, 1, wxEXPAND|wxALL, 5);

			wxStaticText* labelPassword = new wxStaticText(this, wxID_ANY, _("Password:"******""), wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD);
			m_profilePassword->SetToolTip(_("Password for login"));
			gridSizer->Add(m_profilePassword, 1, wxEXPAND|wxALL, 5);

			mainSizer->Add(gridSizer, 1, wxEXPAND|wxALL, 5);
		}

		m_saveProfile = new wxCheckBox(this, wxID_ANY, _("Save as profile"));
		mainSizer->Add(m_saveProfile, 0, wxALL, 5);

		// Buttons
		mainSizer->Add(CreateButtonSizer(wxOK|wxCANCEL), 0, wxEXPAND|wxALL, 5);
	}

	if (!askToSave) mainSizer->Hide(m_saveProfile);
	if (!username.empty()) {
		m_profileUsername->SetValue(username);
		m_profilePassword->SetFocus();
	}
	else m_profileUsername->SetFocus();

	SetSizerAndFit(mainSizer);
	Centre();
}
示例#28
0
void S57QueryDialog::CreateControls()
{
    wxBoxSizer* topSizer = new wxBoxSizer( wxVERTICAL );
    SetSizer( topSizer );

    m_phtml = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
                                wxHW_SCROLLBAR_AUTO );
    
    m_phtml->SetBorders( 5 );

    m_phtml->SetMinSize( wxSize( 100, 100 ) );            // this will constrain the dialog, too
    topSizer->Add( m_phtml, 1, wxBOTTOM | wxEXPAND, 10 );

    topSizer->FitInside( this );

    wxSizer* ok = CreateButtonSizer( wxOK );
    topSizer->Add( ok, 0, wxALIGN_CENTER_HORIZONTAL | wxBOTTOM, 5 );
}
示例#29
0
wxSizer *wxDialogBase::CreateSeparatedButtonSizer(long flags)
{
    wxSizer *sizer = CreateButtonSizer(flags);
    if ( !sizer )
        return NULL;

    // Mac Human Interface Guidelines recommend not to use static lines as
    // grouping elements
#if wxUSE_STATLINE && !defined(__WXMAC__)
    wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
    topsizer->Add(new wxStaticLine(this),
                   wxSizerFlags().Expand().DoubleBorder(wxBOTTOM));
    topsizer->Add(sizer, wxSizerFlags().Expand());
    sizer = topsizer;
#endif // wxUSE_STATLINE

    return sizer;
}
ScalarSelectionDialog::ScalarSelectionDialog(wxWindow* parent)
	: wxDialog(parent, wxID_ANY, "Select value"),
	m_type(typeid(void))
{
	wxBoxSizer* sizVert = new wxBoxSizer(wxVERTICAL);
	sizVert->AddSpacer(5);
	sizVert->Add(new wxStaticText(this, wxID_ANY, "Select a value"));
	sizVert->AddSpacer(2);
	m_pTextCtrl = new wxTextCtrl(this, wxID_ANY);
	//m_pTextCtrl->Bind(wxEVT_TEXT, &ScalarSelectionDialog::TextChanged, this);
	sizVert->Add(m_pTextCtrl);
	sizVert->AddSpacer(5);

	sizVert->Add(CreateButtonSizer(wxOK | wxCANCEL));
	sizVert->AddSpacer(5);
	
	SetSizerAndFit(sizVert);
}