Example #1
0
void FindReplaceDialog::ShowReplaceControls(bool show)
{
    // detach the find string & its label from the gridbag sizer
    bool isFindDlg(false);
    isFindDlg = gbSizer->GetItemPosition(sz) == wxGBPosition(1, 0);
    if(show == false) {
        // is this dialog is already a 'Find' dialog?
        if(isFindDlg) { return; }

        // remove 'Replace' dialog items
        gbSizer->Detach(m_replaceWithLabel);
        gbSizer->Detach(m_replaceString);

        // reposition the options static sizer
        gbSizer->Detach(sz);
        gbSizer->Add(sz, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL | wxEXPAND, 5);

    } else {
        // is this dialog is already a 'Replace' dialog?
        if(!isFindDlg) { return; }

        // remmove the 'Options' item frmo pos 1,0
        gbSizer->Detach(sz);
        gbSizer->Add(m_replaceWithLabel, wxGBPosition(1, 0), wxDefaultSpan, wxALL | wxEXPAND, 5);
        gbSizer->Add(m_replaceString, wxGBPosition(1, 1), wxDefaultSpan, wxALL | wxEXPAND, 5);
        gbSizer->Add(sz, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL | wxEXPAND, 5);
    }

    wxString label = show ? wxT("Replace") : wxT("Find");
    m_replace->Show(show);
    m_replaceAll->Show(show);
    m_replaceString->Show(show);
    m_replacementsMsg->Show(show);
    m_replaceWithLabel->Show(show);
    m_selectionOnly->Show(show);

    SetLabel(label);
    this->Fit();
    GetSizer()->Layout();
}
Example #2
0
// Assumes a 10x10 grid, and returns the first empty cell found.  This is
// really stupid but it is only used by the Add methods that match the base
// class virtuals, which should normally not be used anyway...
wxGBPosition wxGridBagSizer::FindEmptyCell()
{
    int row, col;

    for (row=0; row<10; row++)
        for (col=0; col<10; col++)
        {
            wxGBPosition pos(row, col);
            if ( !CheckForIntersection(pos, wxDefaultSpan) )
                return pos;
        }
    return wxGBPosition(-1, -1);
}
void thirdPagePanel::pageFilling()
{
    thirdPageDivider->Add(graphBlock,3, wxALL | wxEXPAND, 5);

    parent->SetStatusText(wxT("Figure 3.1 - LMFC of the given system"));
    thirdPageDivider->Add(hintFrameScrollWin,1, wxALL | wxEXPAND, 5);

    hintFrameSizer->Add(new wxStaticText(hintFrameScrollWin,-1,wxT("some text\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nyup,text")),wxGBPosition(0,0),wxGBSpan(1,1),wxGROW);
    hintFrameSizer->Add(thirdPageProceed,wxGBPosition(1,0),wxGBSpan(1,1),wxGROW);
    hintFrameSizer->AddGrowableCol(0);
    hintFrameSizer->AddGrowableRow(0);
    hintFrameSizer->Layout();
    return;
}
Example #4
0
MyAboutDlg::MyAboutDlg(wxWindow* parent):wxDialog(parent, wxID_ANY,
		wxT("(Onega) libraries of coreinfo"), wxDefaultPosition,
		wxSize(600, 480), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
	wxGridBagSizer *gbsizer=new wxGridBagSizer();
	main = new wxTextCtrl(this, wxID_ANY,
			wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxHSCROLL);
	main->SetWindowStyle(main->GetWindowStyle() & ~wxTE_DONTWRAP | wxTE_BESTWRAP);
	gbsizer->Add(main, wxGBPosition(0,0), wxDefaultSpan, wxGROW);
	gbsizer->AddGrowableRow(0);
	gbsizer->AddGrowableCol(0);
	SetSizer(gbsizer);
	sprintf(cmdbuf, "grep so /proc/%d/maps |awk '{print $6}' | uniq | sort", getpid());
	main->SetValue(exec_cmd(cmdbuf));
}
Example #5
0
ThingTypeReplacePanel::ThingTypeReplacePanel(wxWindow* parent) : wxPanel(parent, -1) {
	// Setup sizer
	wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
	SetSizer(sizer);

	wxGridBagSizer* gbsizer = new wxGridBagSizer(4, 4);
	sizer->AddStretchSpacer();
	sizer->Add(gbsizer, 0, wxALIGN_CENTER|wxALL, 4);
	sizer->AddStretchSpacer();

	// From type
	gbsizer->Add(new wxStaticText(this, -1, "Replace Type:"), wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT);
	spin_from = new wxSpinCtrl(this, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 999999);
	gbsizer->Add(spin_from, wxGBPosition(0, 1), wxDefaultSpan, wxEXPAND);
	//btn_browse_from = new wxButton(this, -1, "...", wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
	//gbsizer->Add(btn_browse_from, wxGBPosition(0, 2), wxDefaultSpan, wxEXPAND);

	// To type
	gbsizer->Add(new wxStaticText(this, -1, "With Type:"), wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT);
	spin_to = new wxSpinCtrl(this, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 999999);
	gbsizer->Add(spin_to, wxGBPosition(1, 1), wxDefaultSpan, wxEXPAND);
	//btn_browse_to = new wxButton(this, -1, "...", wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
	//gbsizer->Add(btn_browse_to, wxGBPosition(1, 2), wxDefaultSpan, wxEXPAND);
}
/* ThingPropsPanel::setupExtraFlagsTab
 * Creates and sets up the 'Extra Flags' tab
 *******************************************************************/
wxPanel* ThingPropsPanel::setupExtraFlagsTab()
{
	// Create panel
	wxPanel* panel = new wxPanel(stc_tabs, -1);

	// Setup sizer
	wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
	panel->SetSizer(sizer);

	// Init flags
	wxGridBagSizer* gb_sizer_flags = new wxGridBagSizer(4, 4);
	sizer->Add(gb_sizer_flags, 1, wxEXPAND|wxALL, 10);
	int row = 0;
	int col = 0;

	// Get all extra flag names
	vector<string> flags;
	for (unsigned a = 0; a < udmf_flags_extra.size(); a++)
	{
		UDMFProperty* prop = theGameConfiguration->getUDMFProperty(udmf_flags_extra[a], MOBJ_THING);
		flags.push_back(prop->getName());
	}

	// Add flag checkboxes
	int flag_mid = flags.size() / 3;
	if (flags.size() % 3 == 0) flag_mid--;
	for (unsigned a = 0; a < flags.size(); a++)
	{
		wxCheckBox* cb_flag = new wxCheckBox(panel, -1, flags[a], wxDefaultPosition, wxDefaultSize, wxCHK_3STATE);
		gb_sizer_flags->Add(cb_flag, wxGBPosition(row++, col), wxDefaultSpan, wxEXPAND);
		cb_flags_extra.push_back(cb_flag);

		if (row > flag_mid)
		{
			row = 0;
			col++;
		}
	}

	gb_sizer_flags->AddGrowableCol(0, 1);
	gb_sizer_flags->AddGrowableCol(1, 1);
	gb_sizer_flags->AddGrowableCol(2, 1);

	return panel;
}
Example #7
0
DiffPanel::DiffPanel(wxWindow* parent, EditorFrame& parentFrame, CatalystWrapper& cw, wxBitmap& bitmap):
	wxPanel(parent, wxID_ANY, wxPoint(-100,-100)), 
	m_parentFrame(&parentFrame), m_leftEditor(NULL), m_rightEditor(NULL), m_currentEditor(NULL) 
{
	Hide(); // Hidden during construction

	// Create ctrls
	m_leftEditor = new EditorCtrl(cw, bitmap, this, parentFrame);
	m_rightEditor = new EditorCtrl(cw, bitmap, this, parentFrame);
	m_leftEditor->SetScrollbarLeft();
	m_rightEditor->SetGutterRight();
	
	m_diffBar = new DiffBar(this, cw, m_leftEditor, m_rightEditor);
	m_leftMarkBar = new DiffMarkBar(this, m_diffBar->GetLineMatches(), m_leftEditor, true);
	m_rightMarkBar = new DiffMarkBar(this, m_diffBar->GetLineMatches(), m_rightEditor, false);

	m_leftTitle = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
	m_rightTitle = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
	wxButton* swapButton = new wxButton(this, ID_BUTTON_SWAP, wxT("<->"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);

	m_currentEditor = m_leftEditor; // default focus is left

	// Layout sizers
	m_mainSizer = new wxGridBagSizer();
	{
		m_mainSizer->AddGrowableRow(1);
		m_mainSizer->AddGrowableCol(1);
		m_mainSizer->AddGrowableCol(3);

		m_mainSizer->Add(m_leftTitle, wxGBPosition(0,0), wxGBSpan(1,2), wxEXPAND);
		m_mainSizer->Add(swapButton, wxGBPosition(0,2));
		m_mainSizer->Add(m_rightTitle, wxGBPosition(0,3), wxGBSpan(1,2), wxEXPAND);

		m_mainSizer->Add(m_leftMarkBar, wxGBPosition(1,0), wxGBSpan(1,1), wxEXPAND);
		m_mainSizer->Add(m_leftEditor, wxGBPosition(1,1), wxGBSpan(1,1), wxEXPAND);
		m_mainSizer->Add(m_diffBar, wxGBPosition(1,2), wxGBSpan(1,1), wxEXPAND);
		m_mainSizer->Add(m_rightEditor, wxGBPosition(1,3), wxGBSpan(1,1), wxEXPAND);
		m_mainSizer->Add(m_rightMarkBar, wxGBPosition(1,4), wxGBSpan(1,1), wxEXPAND);
	}

	SetSizer(m_mainSizer);
}
Example #8
0
CLoginDlg::CLoginDlg(wxDialog *parent, const wxString &title)
    : wxDialog(parent, wxID_ANY, title)
{
    wxIcon icoApp(wxString::FromUTF8("./images/icon/jo_browser.ico"), wxBITMAP_TYPE_ICO);
    SetIcon(icoApp);

    SetBackgroundColour(wxColor(242, 243, 247));
    SetInitialSize(wxSize(500, 300));

    wxGridBagSizer *bCtrlSizer = new  wxGridBagSizer(3, 4);
    ///服务器信息
    m_staticTextServer = new wxStaticText(this, wxID_ANY, wxT("     服务器"), wxDefaultPosition, wxSize(100, -1), wxALIGN_RIGHT);
    m_textServer = new wxTextCtrl(this, wxID_ANY, wxT("192.168.1.106"), wxDefaultPosition, wxSize(200, -1), wxALIGN_LEFT);
    bCtrlSizer->Add(m_staticTextServer, wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
    bCtrlSizer->Add(m_textServer, wxGBPosition(0, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL |  wxALIGN_RIGHT);

    ///用户名
    m_staticTextUser = new wxStaticText(this, wxID_ANY, wxT("用户名称"), wxDefaultPosition,  wxSize(100, -1), wxALIGN_RIGHT);
    m_textUser = new wxTextCtrl(this, wxID_ANY, wxT("admin"), wxDefaultPosition, wxSize(200, -1), wxALIGN_LEFT);
    bCtrlSizer->Add(m_staticTextUser, wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL |  wxALIGN_LEFT);
    bCtrlSizer->Add(m_textUser, wxGBPosition(1, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL |  wxALIGN_RIGHT);

    ///密码
    m_staticTextPassw = new wxStaticText(this, wxID_ANY, wxT("          密码"), wxDefaultPosition,  wxSize(100, -1), wxALIGN_RIGHT);
    m_textPassw = new wxTextCtrl(this, wxID_ANY, wxT("admin"), wxDefaultPosition,  wxSize(200, -1), wxTE_PASSWORD | wxALIGN_LEFT);
    bCtrlSizer->Add(m_staticTextPassw, wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL |  wxALIGN_LEFT);
    bCtrlSizer->Add(m_textPassw, wxGBPosition(2, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL |  wxALIGN_RIGHT);

    wxBoxSizer *btnSizer = new wxBoxSizer(wxHORIZONTAL);
    ///登录取消
    m_btnLogin = new wxButton(this, wxID_OK, wxT("登录"), wxDefaultPosition, wxDefaultSize, 0);
    m_btnLogin->SetDefault();
    m_btnCancel = new wxButton(this, wxID_CANCEL, wxT("取消"), wxDefaultPosition, wxDefaultSize, 0);
    btnSizer-> AddSpacer(240);
    btnSizer->Add(m_btnLogin, 0, wxALIGN_CENTER);
    btnSizer->AddSpacer(15);
    btnSizer->Add(m_btnCancel, 1, wxALIGN_CENTER);

    ///对话框
    wxBoxSizer* dlgSizer = new wxBoxSizer(wxVERTICAL);
    dlgSizer->AddSpacer(60);
    dlgSizer->Add(bCtrlSizer, 0, wxALIGN_CENTRE);
    //dlgSizer->AddSpacer(5);
    dlgSizer->Add(btnSizer, 1, wxALIGN_CENTRE);

    SetSizer(dlgSizer);
    Layout();
    CenterOnScreen();

    m_textServer->SetFocus();
}
Example #9
0
ThroughputDetail::ThroughputDetail(wxWindow *parent, int row)
:TestDetailDialog( parent, wxID_DIALOG_THROUGHPUT_DETAIL, wxT("Detaljer för Genomströmning"), wxDefaultPosition, wxSize(700,400), wxDEFAULT_DIALOG_STYLE )
{
	m_List = new wxListCtrl( 
				this, 
				wxID_ANY, 
				wxDefaultPosition, 
				wxSize( 700, 400 ), 
				wxLC_REPORT | wxLC_SINGLE_SEL );

	m_List->InsertColumn(0, wxT("Typ"), wxLIST_FORMAT_LEFT, 130);
	m_List->InsertColumn(1, wxT("Adress"), wxLIST_FORMAT_LEFT, 300);
	m_List->InsertColumn(2, wxT("Genomströmning"), wxLIST_FORMAT_LEFT, 200);

	m_SizerMain->Add( m_List, wxGBPosition( 0, 0 ), wxDefaultSpan, wxEXPAND );

	this->SetSizer( m_SizerMain );

	RefreshList( row );
}
Example #10
0
/* AngleControl::AngleControl
 * AngleControl class constructor
 *******************************************************************/
AngleControl::AngleControl(wxWindow* parent) : wxControl(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE)
{
	wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
	SetSizer(sizer);

	// Setup visual angle panel
	wxPanel* panel = new wxPanel(this, -1);
	sizer->Add(panel, 1, wxEXPAND|wxALL, 4);
	wxGridBagSizer* gb_sizer = new wxGridBagSizer(4, 4);
	panel->SetSizer(gb_sizer);

	// Fixed size
	panel->SetInitialSize(wxSize(140, 140));
	panel->SetMaxSize(wxSize(140, 140));

	// Angle buttons
	gb_sizer->Add(rb_angles[0] = new wxRadioButton(panel, -1, ""), wxGBPosition(2, 4), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT);		// East
	gb_sizer->Add(rb_angles[1] = new wxRadioButton(panel, -1, ""), wxGBPosition(1, 3), wxDefaultSpan, wxALIGN_TOP|wxALIGN_RIGHT);					// NorthEast
	gb_sizer->Add(rb_angles[2] = new wxRadioButton(panel, -1, ""), wxGBPosition(0, 2), wxDefaultSpan, wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM);	// North
	gb_sizer->Add(rb_angles[3] = new wxRadioButton(panel, -1, ""), wxGBPosition(1, 1), wxDefaultSpan, wxALIGN_TOP|wxALIGN_LEFT);					// NorthWest
	gb_sizer->Add(rb_angles[4] = new wxRadioButton(panel, -1, ""), wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT);		// West
	gb_sizer->Add(rb_angles[5] = new wxRadioButton(panel, -1, ""), wxGBPosition(3, 1), wxDefaultSpan, wxALIGN_BOTTOM|wxALIGN_LEFT);					// SouthWest
	gb_sizer->Add(rb_angles[6] = new wxRadioButton(panel, -1, ""), wxGBPosition(4, 2), wxDefaultSpan, wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP);		// South
	gb_sizer->Add(rb_angles[7] = new wxRadioButton(panel, -1, ""), wxGBPosition(3, 3), wxDefaultSpan, wxALIGN_BOTTOM|wxALIGN_RIGHT);				// SouthEast
	for (unsigned a = 0; a < 5; a++)
	{
		gb_sizer->AddGrowableCol(a, 1);
		gb_sizer->AddGrowableRow(a, 1);
	}

	// Angle text box
	text_angle = new NumberTextCtrl(this);
	sizer->Add(text_angle, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);

	// Bind events
	for (unsigned a = 0; a < 8; a++)
		rb_angles[a]->Bind(wxEVT_RADIOBUTTON, &AngleControl::onAngleButtonClicked, this);
}
TaskProgressDialog::TaskProgressDialog ( wxWindow* parent)
	: wxDialog ( parent, -1, _("Please wait..."), wxDefaultPosition, wxDefaultSize , wxCAPTION)
{
	wxClientDC dc(this);
	dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
	long widthText = 0;
	long heightText = 0;
	long lineHeight = 0;
	dc.GetTextExtent(initial_text, &widthText, &heightText, NULL, NULL, NULL);
	dc.GetTextExtent("ABEND", NULL, &lineHeight, NULL, NULL, NULL);
	
	auto wrapsizer = new wxBoxSizer(wxVERTICAL);
	
	auto centerizer = new wxGridBagSizer( 0, 0 );
	centerizer->AddGrowableCol( 0 );
	centerizer->AddGrowableRow( 0 );
	centerizer->SetFlexibleDirection( wxBOTH );
	centerizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL );
	wrapsizer->Add( centerizer, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL);
	
	wxSize textSize(widthText, heightText);
	message = new wxGenericStaticText(this, -1, "" ,wxDefaultPosition, textSize,wxALIGN_CENTRE_HORIZONTAL);
	message->SetMinSize(textSize);
	centerizer->Add(message,wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, lineHeight/2);
	
	gauge = new wxGauge(this,-1,100,wxDefaultPosition,wxDefaultSize,wxGA_HORIZONTAL | wxGA_SMOOTH);
	wrapsizer->Add(gauge,wxSizerFlags().Expand().Border(wxBOTTOM|wxLEFT|wxRIGHT,lineHeight/2).Proportion(0));
	
	EnableCloseButton(false);
	SetSizerAndFit(wrapsizer);
	CenterOnParent();
	
#ifdef __WXGTK__
	pulse_timer = new wxTimer(this,ID_PulseTimer);
#endif
}
Example #12
0
void AudioConfigPane::InitializeGUI()
{
  m_dsp_engine_strings.Add(_("DSP HLE Emulation (fast)"));
  m_dsp_engine_strings.Add(_("DSP LLE Recompiler"));
  m_dsp_engine_strings.Add(_("DSP LLE Interpreter (slow)"));

  m_dsp_engine_radiobox =
    new wxRadioBox(this, wxID_ANY, _("DSP Emulation Engine"), wxDefaultPosition, wxDefaultSize,
      m_dsp_engine_strings, 0, wxRA_SPECIFY_ROWS);
  m_dpl2_decoder_checkbox = new wxCheckBox(this, wxID_ANY, _("Dolby Pro Logic II Decoder"));
  m_volume_slider = new DolphinSlider(this, wxID_ANY, 0, 0, 100, wxDefaultPosition, wxDefaultSize,
    wxSL_VERTICAL | wxSL_INVERSE);
  m_volume_text = new wxStaticText(this, wxID_ANY, "");
  m_audio_backend_choice =
    new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_audio_backend_strings);
  if (m_latency_control_supported)
  {
    m_audio_latency_spinctrl =
      new wxSpinCtrl(this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 200);
    m_audio_latency_label = new wxStaticText(this, wxID_ANY, _("Latency (ms):"));
  }
  m_stretch_checkbox = new wxCheckBox(this, wxID_ANY, _("Enable Audio Stretching"));
  m_stretch_label = new wxStaticText(this, wxID_ANY, _("Buffer Size:"));
  m_stretch_slider =
    new DolphinSlider(this, wxID_ANY, 80, 5, 300, wxDefaultPosition, wxDefaultSize);
  m_stretch_text = new wxStaticText(this, wxID_ANY, "");
  if (m_latency_control_supported)
  {
    m_audio_latency_spinctrl->SetToolTip(_("Sets the latency (in ms). Higher values may reduce audio "
      "crackling. Certain backends only."));
  }
  m_dpl2_decoder_checkbox->SetToolTip(
    _("Enables Dolby Pro Logic II emulation using 5.1 surround. Certain backends only."));
  m_stretch_checkbox->SetToolTip(_("Enables stretching of the audio to match emulation speed."));
  m_stretch_slider->SetToolTip(_("Size of stretch buffer in milliseconds. "
    "Values too low may cause audio crackling."));

  const int space5 = FromDIP(5);

  wxStaticBoxSizer* const volume_sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Volume"));
  volume_sizer->Add(m_volume_slider, 1, wxALIGN_CENTER_HORIZONTAL);
  volume_sizer->Add(m_volume_text, 0, wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT, space5);
  volume_sizer->AddSpacer(space5);

  wxGridBagSizer* const backend_grid_sizer = new wxGridBagSizer(space5, space5);
  backend_grid_sizer->Add(new wxStaticText(this, wxID_ANY, _("Audio Backend:")), wxGBPosition(0, 0),
    wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
  backend_grid_sizer->Add(m_audio_backend_choice, wxGBPosition(0, 1), wxDefaultSpan,
    wxALIGN_CENTER_VERTICAL);
  backend_grid_sizer->Add(m_dpl2_decoder_checkbox, wxGBPosition(1, 0), wxGBSpan(1, 2),
    wxALIGN_CENTER_VERTICAL);
  if (m_latency_control_supported)
  {
    backend_grid_sizer->Add(m_audio_latency_label, wxGBPosition(2, 0), wxDefaultSpan,
      wxALIGN_CENTER_VERTICAL);
    backend_grid_sizer->Add(m_audio_latency_spinctrl, wxGBPosition(2, 1), wxDefaultSpan,
      wxALIGN_CENTER_VERTICAL);
  }
  wxStaticBoxSizer* const backend_static_box_sizer =
    new wxStaticBoxSizer(wxVERTICAL, this, _("Backend Settings"));
  backend_static_box_sizer->AddSpacer(space5);
  backend_static_box_sizer->Add(backend_grid_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
  backend_static_box_sizer->AddSpacer(space5);

  wxBoxSizer* const dsp_audio_sizer = new wxBoxSizer(wxHORIZONTAL);
  dsp_audio_sizer->AddSpacer(space5);
  dsp_audio_sizer->Add(m_dsp_engine_radiobox, 1, wxEXPAND | wxTOP | wxBOTTOM, space5);
  dsp_audio_sizer->AddSpacer(space5);
  dsp_audio_sizer->Add(volume_sizer, 0, wxEXPAND | wxTOP | wxBOTTOM, space5);
  dsp_audio_sizer->AddSpacer(space5);

  wxGridBagSizer* const latency_sizer = new wxGridBagSizer();
  latency_sizer->Add(m_stretch_slider, wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
  latency_sizer->Add(m_stretch_text, wxGBPosition(0, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);

  wxGridBagSizer* const stretching_grid_sizer = new wxGridBagSizer(space5, space5);
  stretching_grid_sizer->Add(m_stretch_checkbox, wxGBPosition(0, 0), wxGBSpan(1, 2),
    wxALIGN_CENTER_VERTICAL);
  stretching_grid_sizer->Add(m_stretch_label, wxGBPosition(1, 0), wxDefaultSpan,
    wxALIGN_CENTER_VERTICAL);
  stretching_grid_sizer->Add(latency_sizer, wxGBPosition(1, 1), wxDefaultSpan,
    wxALIGN_CENTER_VERTICAL);

  wxStaticBoxSizer* const stretching_box_sizer =
    new wxStaticBoxSizer(wxVERTICAL, this, _("Audio Stretching Settings"));
  stretching_box_sizer->AddSpacer(space5);
  stretching_box_sizer->Add(stretching_grid_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
  stretching_box_sizer->AddSpacer(space5);

  wxBoxSizer* const main_sizer = new wxBoxSizer(wxVERTICAL);
  main_sizer->AddSpacer(space5);
  main_sizer->Add(dsp_audio_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
  main_sizer->AddSpacer(space5);
  main_sizer->Add(backend_static_box_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
  main_sizer->AddSpacer(space5);
  main_sizer->Add(stretching_box_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
  main_sizer->AddSpacer(space5);

  SetSizerAndFit(main_sizer);
}
Example #13
0
/* InterfacePrefsPanel::InterfacePrefsPanel
 * InterfacePrefsPanel class constructor
 *******************************************************************/
InterfacePrefsPanel::InterfacePrefsPanel(wxWindow* parent) : PrefsPanelBase(parent)
{
	// Create sizer
	wxBoxSizer* psizer = new wxBoxSizer(wxVERTICAL);
	SetSizer(psizer);

	// Create frame+sizer
	wxStaticBox* frame = new wxStaticBox(this, -1, "Interface Preferences");
	wxStaticBoxSizer* fsizer = new wxStaticBoxSizer(frame, wxVERTICAL);
	psizer->Add(fsizer, 1, wxEXPAND|wxALL, 4);

	STabCtrl* stc_tabs = new STabCtrl(this);
	fsizer->Add(stc_tabs, 1, wxEXPAND | wxALL, 4);

	// --- General ---
	wxPanel* panel = new wxPanel(stc_tabs, -1);
	wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
	panel->SetSizer(sizer);
	wxGridBagSizer*	gb_sizer = new wxGridBagSizer(8, 8);
	sizer->Add(gb_sizer, 1, wxALL | wxEXPAND, 8);
	stc_tabs->AddPage(panel, "General");

	// Show startpage
	int row = 0;
	cb_start_page = new wxCheckBox(panel, -1, "Show Start Page on Startup");
	gb_sizer->Add(cb_start_page, wxGBPosition(row++, 0), wxGBSpan(1, 2), wxEXPAND);

	// Show file browser
	cb_file_browser = new wxCheckBox(panel, -1, "Show File Browser tab in the Archive Manager panel *");
	gb_sizer->Add(cb_file_browser, wxGBPosition(row++, 0), wxGBSpan(1, 2), wxEXPAND);

	// Monospace list font
	cb_list_monospace = new wxCheckBox(panel, -1, "Use monospaced font for lists");
	gb_sizer->Add(cb_list_monospace, wxGBPosition(row++, 0), wxGBSpan(1, 2), wxEXPAND);

	// Toolbar size
	string sizes[] = { "Small (16px)", "Medium (24px)", "Large (32px)" };
	choice_toolbar_size = new wxChoice(panel, -1, wxDefaultPosition, wxDefaultSize, 3, sizes);
	gb_sizer->Add(new wxStaticText(panel, -1, "Toolbar icon size:"), wxGBPosition(row, 0), wxDefaultSpan, wxALIGN_CENTRE_VERTICAL);
	gb_sizer->Add(choice_toolbar_size, wxGBPosition(row, 1), wxDefaultSpan, wxEXPAND);
	gb_sizer->Add(new wxStaticText(panel, -1, "*"), wxGBPosition(row++, 2), wxDefaultSpan, wxALIGN_CENTRE_VERTICAL);

	// Icon set
	vector<string> sets = Icons::getIconSets(Icons::GENERAL);
	choice_iconset_general = new wxChoice(panel, -1, wxDefaultPosition, wxDefaultSize, sets.size(), &sets[0]);
	gb_sizer->Add(new wxStaticText(panel, -1, "Icons:"), wxGBPosition(row, 0), wxDefaultSpan, wxALIGN_CENTRE_VERTICAL);
	gb_sizer->Add(choice_iconset_general, wxGBPosition(row, 1), wxDefaultSpan, wxEXPAND);
	gb_sizer->Add(new wxStaticText(panel, -1, "*"), wxGBPosition(row++, 2), wxDefaultSpan, wxALIGN_CENTRE_VERTICAL);

	gb_sizer->AddGrowableCol(1, 1);
	sizer->Add(new wxStaticText(panel, -1, "* requires restart to take effect"), 0, wxALL | wxALIGN_RIGHT, 8);


	// --- Entry List ---
	panel = new wxPanel(stc_tabs, -1);
	sizer = new wxBoxSizer(wxVERTICAL);
	panel->SetSizer(sizer);
	gb_sizer = new wxGridBagSizer(8, 8);
	sizer->Add(gb_sizer, 1, wxALL | wxEXPAND, 8);
	stc_tabs->AddPage(panel, "Entry List");

	// Show entry size as string instead of a number
	row = 0;
	cb_size_as_string = new wxCheckBox(panel, -1, "Show entry size as a string with units");
	gb_sizer->Add(cb_size_as_string, wxGBPosition(row++, 0), wxGBSpan(1, 2), wxEXPAND);

	// Filter directories
	cb_filter_dirs = new wxCheckBox(panel, -1, "Ignore directories when filtering by name");
	gb_sizer->Add(cb_filter_dirs, wxGBPosition(row++, 0), wxGBSpan(1, 2), wxEXPAND);

	// Entry list background colour by type
	cb_elist_bgcol = new wxCheckBox(panel, -1, "Colour entry list item background by entry type");
	gb_sizer->Add(cb_elist_bgcol, wxGBPosition(row++, 0), wxGBSpan(1, 2), wxEXPAND);

	// Context menu submenus
	cb_context_submenus = new wxCheckBox(panel, -1, "Group related entry context menu items into submenus");
	gb_sizer->Add(cb_context_submenus, wxGBPosition(row++, 0), wxGBSpan(1, 2), wxEXPAND);

	// Icon set
	sets = Icons::getIconSets(Icons::ENTRY);
	choice_iconset_entry = new wxChoice(panel, -1, wxDefaultPosition, wxDefaultSize, sets.size(), &sets[0]);
	gb_sizer->Add(new wxStaticText(panel, -1, "Icons:"), wxGBPosition(row, 0), wxDefaultSpan, wxALIGN_CENTRE_VERTICAL);
	gb_sizer->Add(choice_iconset_entry, wxGBPosition(row, 1), wxDefaultSpan, wxEXPAND);
	gb_sizer->Add(new wxStaticText(panel, -1, "*"), wxGBPosition(row++, 2), wxDefaultSpan, wxALIGN_CENTRE_VERTICAL);

	gb_sizer->AddGrowableCol(1, 1);
	sizer->Add(new wxStaticText(panel, -1, "* requires restart to take effect"), 0, wxALL | wxALIGN_RIGHT, 8);

	

	//// Tab style
	//string styles[] ={ "Flat (Default)", "Glossy", "Rounded" };
	//choice_tab_style = new wxChoice(this, -1, wxDefaultPosition, wxDefaultSize, 3, styles);
	//hbox = new wxBoxSizer(wxHORIZONTAL);
	//sizer->Add(hbox, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);
	//hbox->Add(new wxStaticText(this, -1, "Tab style:"), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
	//hbox->Add(choice_tab_style, 0, wxEXPAND|wxRIGHT, 4);
	//sizer->Add(new wxStaticText(this, -1, "You need to quit and restart SLADE 3 for tab style changes to take effect."), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
}
CDExtraClientPanel::CDExtraClientPanel(wxWindow* parent, int id) :
wxPanel(parent, id),
m_timer(this, Timer_Connected),
m_reflector(NULL),
m_connect(NULL),
m_module(NULL),
m_status1(NULL),
m_transmit(NULL),
m_status2(NULL),
m_hrdYour(NULL),
m_hrdMy(NULL),
m_hrdReflector(NULL),
m_hrdMessage(NULL),
m_heard(NULL),
m_reflectorName(),
m_connected(false),
m_busy(false),
m_hosts(),
m_initialised(false)
{
	wxGridBagSizer* panelSizer = new wxGridBagSizer();

	wxStaticText* reflectorLabel = new wxStaticText(this, -1, _("Reflector"), wxDefaultPosition, wxSize(LABEL_WIDTH2, -1), wxALIGN_RIGHT);
	panelSizer->Add(reflectorLabel, wxGBPosition(0, 0), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxFileName fileName(wxFileName::GetHomeDir(), HOSTS_FILE_NAME);

	if (!fileName.IsFileReadable()) {
		wxLogMessage(wxT("File %s not readable"), fileName.GetFullPath().c_str());
#if defined(__WINDOWS__)
		fileName.Assign(::wxGetCwd(), HOSTS_FILE_NAME);
#else
		fileName.Assign(wxT(DATA_DIR), HOSTS_FILE_NAME);
#endif
		if (!fileName.IsFileReadable())
			wxLogMessage(wxT("File %s not readable"), fileName.GetFullPath().c_str());
	}

	CDExtraClientHostFile file(fileName.GetFullPath());
	unsigned int hostCount = file.getCount();

	m_reflector = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1));
	for (unsigned int i = 0U; i < hostCount; i++) {
		m_hosts.Add(file.getHost(i));
		m_reflector->Append(file.getName(i));
	}
	panelSizer->Add(m_reflector, wxGBPosition(0, 1), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxString reflector;
	::wxGetApp().getLastReflector(reflector);
	bool res = m_reflector->SetStringSelection(reflector);
	if (!res)
		m_reflector->SetSelection(0);

	m_connect = new wxToggleButton(this, Button_Connect, _("Connect"), wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1));
	panelSizer->Add(m_connect, wxGBPosition(0, 2), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticText* moduleLabel = new wxStaticText(this, -1, _("Module"), wxDefaultPosition, wxSize(LABEL_WIDTH2, -1), wxALIGN_RIGHT);
	panelSizer->Add(moduleLabel, wxGBPosition(0, 3), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_module = new wxChoice(this, Choice_Module, wxDefaultPosition, wxSize(CONTROL_WIDTH2, -1));
	m_module->Append(wxT("A"));
	m_module->Append(wxT("B"));
	m_module->Append(wxT("C"));
	m_module->Append(wxT("D"));
	panelSizer->Add(m_module, wxGBPosition(0, 4), wxDefaultSpan, wxALL, BORDER_SIZE);

	unsigned int module;
	::wxGetApp().getLastModule(module);
	m_module->SetSelection(module);

	m_status1 = new wxStaticText(this, -1, _("Not connected"));
	panelSizer->Add(m_status1, wxGBPosition(0, 5), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_transmit = new wxToggleButton(this, Button_Transmit, _("Transmit"), wxDefaultPosition, wxSize(CONTROL_WIDTH1 * 2 + BORDER_SIZE * 2, -1));
	panelSizer->Add(m_transmit, wxGBPosition(1, 1), wxGBSpan(1, 2), wxALL, BORDER_SIZE);

	m_status2 = new wxStaticText(this, -1, wxEmptyString);
	panelSizer->Add(m_status2, wxGBPosition(1, 4), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticBoxSizer* info1Sizer = new wxStaticBoxSizer(new wxStaticBox(this, -1, _("Current"), wxDefaultPosition, wxSize(INFO_WIDTH, INFO_HEIGHT)), wxVERTICAL);

	wxGridBagSizer* info2Sizer = new wxGridBagSizer(BORDER_SIZE, BORDER_SIZE);

	wxStaticText* hrdYourLabel = new wxStaticText(this, -1, _("Your:"), wxDefaultPosition, wxSize(LABEL_WIDTH1, -1), wxALIGN_RIGHT);
	info2Sizer->Add(hrdYourLabel, wxGBPosition(0, 0), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_hrdYour = new wxStaticText(this, -1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1));
	info2Sizer->Add(m_hrdYour, wxGBPosition(0, 1), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticText* hrdMyLabel = new wxStaticText(this, -1, _("My:"), wxDefaultPosition, wxSize(LABEL_WIDTH1, -1), wxALIGN_RIGHT);
	info2Sizer->Add(hrdMyLabel, wxGBPosition(0, 2), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_hrdMy = new wxStaticText(this, -1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1));
	info2Sizer->Add(m_hrdMy, wxGBPosition(0, 3), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticText* hrdReflectorLabel = new wxStaticText(this, -1, wxT("Reflector:"), wxDefaultPosition, wxSize(LABEL_WIDTH1, -1), wxALIGN_RIGHT);
	info2Sizer->Add(hrdReflectorLabel, wxGBPosition(0, 4), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_hrdReflector = new wxStaticText(this, -1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1));
	info2Sizer->Add(m_hrdReflector, wxGBPosition(0, 5), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticText* hrdMessageLabel = new wxStaticText(this, -1, _("Message:"), wxDefaultPosition, wxSize(LABEL_WIDTH1, -1), wxALIGN_RIGHT);
	info2Sizer->Add(hrdMessageLabel, wxGBPosition(1, 0), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_hrdMessage = new wxStaticText(this, -1, wxEmptyString, wxDefaultPosition, wxSize(LABEL_WIDTH1 * 3U, -1), wxALIGN_RIGHT);
	info2Sizer->Add(m_hrdMessage, wxGBPosition(1, 1), wxGBSpan(1, 3), wxALL, BORDER_SIZE);

	info1Sizer->Add(info2Sizer);

	panelSizer->Add(info1Sizer, wxGBPosition(2, 0), wxGBSpan(5, 6), wxALL | wxEXPAND, BORDER_SIZE);

	m_heard = new wxListCtrl(this, -1, wxDefaultPosition, wxSize(HEARD_WIDTH, HEARD_HEIGHT), wxLC_REPORT | wxLC_SINGLE_SEL);
	m_heard->InsertColumn(0L, _("Date/Time"));
	m_heard->SetColumnWidth(0L, DATETIME_WIDTH);
	m_heard->InsertColumn(1L, _("Your"));
	m_heard->SetColumnWidth(1L, CALLSIGN_WIDTH);
	m_heard->InsertColumn(2L, _("My"));
	m_heard->SetColumnWidth(2L, CALLSIGN_WIDTH);
	m_heard->InsertColumn(3L, _("Reflector"));
	m_heard->SetColumnWidth(3L, CALLSIGN_WIDTH);
	m_heard->InsertColumn(4L, _("Message"));
	m_heard->SetColumnWidth(4L, MESSAGE_WIDTH);
	panelSizer->Add(m_heard, wxGBPosition(7, 0), wxGBSpan(11, 6), wxALL | wxEXPAND, BORDER_SIZE);

	SetSizer(panelSizer);
	panelSizer->SetSizeHints(this);

	m_timer.Start(5000);
}
Example #15
0
int bmx_wxgridbagsizer_setitemposition(wxGridBagSizer * gb, int index, int row, int col) {
	return static_cast<int>(gb->SetItemPosition(index, wxGBPosition(row, col)));
}
/*
 * Control creation for ColdfireUnlockerDialogue
 */
void ColdfireUnlockerPanel::CreateControls()
{
////@begin ColdfireUnlockerDialogue content construction
    // Generated by DialogBlocks, 23/10/2010 14:32:45 (Personal Edition)

    ColdfireUnlockerPanel* dialogue = this;

    wxBoxSizer* dialogueSizerV = new wxBoxSizer(wxVERTICAL);
    dialogue->SetSizer(dialogueSizerV);

    //====================================================================

    wxStaticBox* itemStaticBoxSizer3Static = new wxStaticBox(dialogue, wxID_ANY, _("1. JTAG Chain"));
    wxStaticBoxSizer* itemStaticBoxSizer3 = new wxStaticBoxSizer(itemStaticBoxSizer3Static, wxHORIZONTAL);
    dialogueSizerV->Add(itemStaticBoxSizer3, 0, wxGROW|wxALL, 5);

    initChainButtonControl = new wxButton( dialogue, ID_INIT_CHAIN_BUTTON, _("Initialise JTAG chain"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStaticBoxSizer3->Add(initChainButtonControl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    numberOfDeviceStaticControl = new wxStaticText( dialogue, wxID_NUMBER_OF_DEVICES_STATIC, _("Number of devices found: -"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStaticBoxSizer3->Add(numberOfDeviceStaticControl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    //====================================================================

    wxStaticBox* itemStaticBoxSizer6Static = new wxStaticBox(dialogue, wxID_ANY, _("2. Select device in chain to erase"));
    wxStaticBoxSizer* itemStaticBoxSizer6 = new wxStaticBoxSizer(itemStaticBoxSizer6Static, wxVERTICAL);
    dialogueSizerV->Add(itemStaticBoxSizer6, 0, wxGROW|wxALL, 5);

    wxGridBagSizer* gridBagSizer = new wxGridBagSizer(4,4);
    itemStaticBoxSizer6->Add(gridBagSizer, 0, wxGROW|wxALL, 5);

    wxStaticText* itemStaticText8 = new wxStaticText( dialogue, wxID_STATIC, _("JTAG Device #"), wxDefaultPosition, wxDefaultSize, 0 );
    gridBagSizer->Add(itemStaticText8, wxGBPosition(0,1), wxGBSpan(1,1),wxALIGN_CENTER_VERTICAL);

    wxStaticText* itemStaticText9 = new wxStaticText( dialogue, wxID_STATIC, _("IR\nLength"), wxDefaultPosition, wxDefaultSize, 0 );
    gridBagSizer->Add(itemStaticText9, wxGBPosition(0,2), wxGBSpan(1,1),wxALIGN_CENTER_VERTICAL);

    jtagIdcodeStaticText = new wxStaticText( dialogue, wxID_JTAG_IDCODE_STATIC, _("IDCODE: - 00000000 "), wxDefaultPosition, wxDefaultSize, 0 );
    gridBagSizer->Add(jtagIdcodeStaticText, wxGBPosition(0,3), wxGBSpan(1,1),wxALIGN_CENTER_VERTICAL);

    wxArrayString jtagDeviceChoiceControlStrings;
//    jtagDeviceChoiceControl = new wxChoice( dialogue, ID_JTAG_DEVICE_CHOICE, wxDefaultPosition, wxSize(150,30), jtagDeviceChoiceControlStrings, 0 );
    jtagDeviceChoiceControl = new wxChoice( dialogue, ID_JTAG_DEVICE_CHOICE, wxDefaultPosition, wxDefaultSize, jtagDeviceChoiceControlStrings, 0 );
    jtagDeviceChoiceControl->Enable(false);
    gridBagSizer->Add(jtagDeviceChoiceControl, wxGBPosition(1,1), wxGBSpan(1,1),wxALIGN_CENTER_VERTICAL);

    irLengthSpinControl = new wxSpinCtrl( dialogue, ID_IR_LENGTH_SPINCTRL, _T("0"), wxDefaultPosition, wxSize(40, -1), wxSP_ARROW_KEYS, 0, 100, 0 );
    gridBagSizer->Add(irLengthSpinControl, wxGBPosition(1,2), wxGBSpan(1,1),wxALIGN_CENTER_VERTICAL);

    freescalePINStaticControl = new wxStaticText( dialogue, wxID_PIN_STATIC, _("Freescale PIN: -"), wxDefaultPosition, wxDefaultSize, 0 );
    gridBagSizer->Add(freescalePINStaticControl, wxGBPosition(1,3), wxGBSpan(1,1),wxALIGN_CENTER_VERTICAL);

    totalIrLengthStaticControl = new wxStaticText( dialogue, wxID_STATIC, _("Total IR Length: -"), wxDefaultPosition, wxDefaultSize, 0 );
    gridBagSizer->Add(totalIrLengthStaticControl, wxGBPosition(2,1), wxGBSpan(1,1),wxALIGN_CENTER_VERTICAL);

    descriptionStaticControl = new wxStaticText( dialogue, wxID_STATIC, _("Desc: -"), wxDefaultPosition, wxDefaultSize, 0 );
    gridBagSizer->Add(descriptionStaticControl, wxGBPosition(2,2), wxGBSpan(1,2),wxALIGN_CENTER_VERTICAL);

    //====================================================================

    wxStaticBox* itemStaticBoxSizer18Static = new wxStaticBox(dialogue, wxID_ANY, _("3. Select target device type and speed"));
    wxStaticBoxSizer* itemStaticBoxSizer18 = new wxStaticBoxSizer(itemStaticBoxSizer18Static, wxHORIZONTAL);
    dialogueSizerV->Add(itemStaticBoxSizer18, 0, wxGROW|wxALL, 5);

    wxArrayString targetDeviceChoiceControlStrings;
    targetDeviceChoiceControl = new wxChoice( dialogue, ID_TARGET_DEVICE_CHOICE, wxDefaultPosition, wxDefaultSize, targetDeviceChoiceControlStrings, 0 );
    itemStaticBoxSizer18->Add(targetDeviceChoiceControl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    targetSpeedTextControl = new NumberTextEditCtrl( dialogue, ID_SPEED_TEXTCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
    itemStaticBoxSizer18->Add(targetSpeedTextControl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText21 = new wxStaticText( dialogue, wxID_STATIC, _("kHz"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStaticBoxSizer18->Add(itemStaticText21, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    //====================================================================

    wxStaticBox* itemStaticBoxSizer22Static = new wxStaticBox(dialogue, wxID_ANY, _("4. Select Flash clock limits and equation"));
    wxStaticBoxSizer* itemStaticBoxSizer22 = new wxStaticBoxSizer(itemStaticBoxSizer22Static, wxVERTICAL);
    dialogueSizerV->Add(itemStaticBoxSizer22, 0, wxGROW|wxALL, 5);

    wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxHORIZONTAL);
    itemStaticBoxSizer22->Add(itemBoxSizer23, 0, wxGROW, 5);

    wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer23->Add(itemBoxSizer24, 1, wxGROW|wxALL, 5);

    wxStaticText* itemStaticText25 = new wxStaticText( dialogue, wxID_STATIC, _("Minimum Frequency"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer24->Add(itemStaticText25, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    minimumFrequencyTextControl = new NumberTextEditCtrl( dialogue, ID_MIN_FREQ_TEXTCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer24->Add(minimumFrequencyTextControl, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer27 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer23->Add(itemBoxSizer27, 1, wxGROW|wxALL, 5);

    wxStaticText* itemStaticText28 = new wxStaticText( dialogue, wxID_STATIC, _("Maximum Frequency"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer27->Add(itemStaticText28, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    maximumFrequencyTextControl = new NumberTextEditCtrl( dialogue, ID_MAX_FREQ_TEXTCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer27->Add(maximumFrequencyTextControl, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    wxArrayString equationChoiceControlStrings;
    equationChoiceControl = new wxChoice( dialogue, ID_EQUATION_CHOICE, wxDefaultPosition, wxDefaultSize, equationChoiceControlStrings, 0 );
    itemStaticBoxSizer22->Add(equationChoiceControl, 0, wxGROW|wxALL, 5);

    //====================================================================

    wxStaticBox* itemStaticBoxSizer31Static = new wxStaticBox(dialogue, wxID_ANY, _("5. Select Erase parameters"));
    wxStaticBoxSizer* itemStaticBoxSizer31 = new wxStaticBoxSizer(itemStaticBoxSizer31Static, wxHORIZONTAL);
    dialogueSizerV->Add(itemStaticBoxSizer31, 0, wxGROW|wxALL, 5);

    wxBoxSizer* itemBoxSizer32 = new wxBoxSizer(wxVERTICAL);
    itemStaticBoxSizer31->Add(itemBoxSizer32, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText33 = new wxStaticText( dialogue, wxID_STATIC, _("Unlock Instruction (hex)"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer32->Add(itemStaticText33, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    unlockInstructionTextControl = new NumberTextEditCtrl( dialogue, ID_UNLOCK_VALUE_TEXTCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer32->Add(unlockInstructionTextControl, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    wxBoxSizer* itemBoxSizer35 = new wxBoxSizer(wxVERTICAL);
    itemStaticBoxSizer31->Add(itemBoxSizer35, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText36 = new wxStaticText( dialogue, wxID_STATIC, _("Clk Divider value (hex)"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer35->Add(itemStaticText36, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    clockDividerTextControl = new NumberTextEditCtrl( dialogue, ID_CLOCK_DIVIDER_VALUE_TEXTCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer35->Add(clockDividerTextControl, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    versionStaticControl = new wxStaticText( dialogue, wxID_VERSION_STATIC, _("CF Unlocker V4"), wxDefaultPosition, wxDefaultSize, 0 );
    dialogueSizerV->Add(versionStaticControl, 0, wxALIGN_RIGHT|wxALL, 5);

    //====================================================================

    wxBoxSizer* itemBoxSizer39 = new wxBoxSizer(wxHORIZONTAL);
    dialogueSizerV->Add(itemBoxSizer39, 0, wxGROW|wxALL, 5);

    wxButton* itemButton40 = new wxButton( dialogue, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer39->Add(itemButton40, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    itemBoxSizer39->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    unlockButtonControl = new wxButton( dialogue, ID_UNLOCK_BUTTON, _("6. Unlock and Erase"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer39->Add(unlockButtonControl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

////@end ColdfireUnlockerDialogue content construction
}
Example #17
0
wxGBSizerItem * bmx_wxgridbagsizer_finditematposition(wxGridBagSizer * gb, int row, int col) {
	return gb->FindItemAtPosition(wxGBPosition(row, col));
}
Example #18
0
// -----------------------------------------------------------------------------
// GfxCropDialog class constructor
// -----------------------------------------------------------------------------
GfxCropDialog::GfxCropDialog(wxWindow* parent, SImage* image, Palette* palette) :
	wxDialog(parent, -1, "Crop", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
	// Set max crop size
	if (image)
	{
		max_width_  = image->width();
		max_height_ = image->height();
	}
	else
		max_width_ = max_height_ = 0;
	crop_rect_.set(0, 0, max_width_, max_height_);

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

	// Setup main sizer
	auto msizer = new wxBoxSizer(wxVERTICAL);
	SetSizer(msizer);
	auto sizer = new wxBoxSizer(wxVERTICAL);
	msizer->Add(sizer, 1, wxEXPAND | wxALL, UI::padLarge());

	// Add preview
	canvas_preview_ = new CropCanvas(this, image, palette);
	sizer->Add(canvas_preview_, 1, wxEXPAND | wxBOTTOM, UI::pad());

	// Add crop controls
	auto frame      = new wxStaticBox(this, -1, "Crop Borders");
	auto framesizer = new wxStaticBoxSizer(frame, wxVERTICAL);
	sizer->Add(framesizer, 0, wxEXPAND | wxBOTTOM, UI::padLarge());

	// Absolute
	auto hbox = new wxBoxSizer(wxHORIZONTAL);
	framesizer->Add(hbox, 0, wxEXPAND | wxALL, UI::pad());
	rb_absolute_ = new wxRadioButton(frame, -1, "Absolute");
	rb_absolute_->SetValue(true);
	hbox->Add(rb_absolute_, 0, wxEXPAND | wxRIGHT, UI::pad());

	// Relative
	rb_relative_ = new wxRadioButton(frame, -1, "Relative");
	hbox->Add(rb_relative_, 0, wxEXPAND);

	auto gb_sizer = new wxGridBagSizer(UI::pad(), UI::pad());
	framesizer->Add(gb_sizer, 1, wxEXPAND | wxALL, UI::pad());

	// Left
	gb_sizer->Add(new wxStaticText(frame, -1, "Left:"), wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
	text_left_ = new NumberTextCtrl(frame);
	text_left_->SetWindowStyleFlag(wxTE_PROCESS_ENTER);
	text_left_->setNumber(0);
	gb_sizer->Add(text_left_, wxGBPosition(0, 1), wxDefaultSpan, wxEXPAND);

	// Top
	gb_sizer->Add(new wxStaticText(frame, -1, "Top:"), wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
	text_top_ = new NumberTextCtrl(frame);
	text_top_->SetWindowStyleFlag(wxTE_PROCESS_ENTER);
	text_top_->setNumber(0);
	gb_sizer->Add(text_top_, wxGBPosition(1, 1), wxDefaultSpan, wxEXPAND);

	// Right
	gb_sizer->Add(new wxStaticText(frame, -1, "Right:"), wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
	text_right_ = new NumberTextCtrl(frame);
	text_right_->SetWindowStyleFlag(wxTE_PROCESS_ENTER);
	text_right_->setNumber(image->width());
	gb_sizer->Add(text_right_, wxGBPosition(2, 1), wxDefaultSpan, wxEXPAND);

	// Bottom
	gb_sizer->Add(new wxStaticText(frame, -1, "Bottom:"), wxGBPosition(3, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
	text_bottom_ = new NumberTextCtrl(frame);
	text_bottom_->SetWindowStyleFlag(wxTE_PROCESS_ENTER);
	text_bottom_->setNumber(image->height());
	gb_sizer->Add(text_bottom_, wxGBPosition(3, 1), wxDefaultSpan, wxEXPAND);

	gb_sizer->AddGrowableCol(1);

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

	bindEvents();

	// Setup dialog size
	SetInitialSize(wxSize(-1, -1));
	wxTopLevelWindowBase::SetMinSize(GetSize());
	CenterOnParent();
}
Example #19
0
wxObject* wxsGridBagSizer::OnBuildPreview(wxWindow* Parent,long Flags)
{
	wxWindow* NewParent = Parent;

	if ( !(Flags & pfExact) )
	{
		NewParent = new wxsSizerPreview(Parent);
	}

	wxGridBagSizer* Sizer = OnBuildSizerPreview(NewParent);
	int Count = GetChildCount();
	for ( int i=0; i<Count; i++ )
	{
		wxsItem* Child = GetChild(i);
		wxsGridBagSizerExtra* _Extra = (wxsGridBagSizerExtra*)GetChildExtra(i);

		// Reset span in case of wrong values
		if (_Extra->colspan < 1) _Extra->colspan = 1;
		if (_Extra->rowspan < 1) _Extra->rowspan = 1;

		// How many rows / cols ?
		int nbRows = 0;
		int nbCols = 0;
		for (int j = 0 ; j < Count ; j++)
		{
			wxsGridBagSizerExtra* ExtraRows = (wxsGridBagSizerExtra*)GetChildExtra(j);

			if (nbRows < ExtraRows->row + ExtraRows->rowspan)
				nbRows = ExtraRows->row + ExtraRows->rowspan;

			if (nbCols < ExtraRows->col + ExtraRows->colspan)
				nbCols = ExtraRows->col + ExtraRows->colspan;
		}

		// Set the position in the sizer in case of wrong values
		if (_Extra->col < 0 && _Extra->row < 0)
		{
			_Extra->col = 0;
			_Extra->row = nbRows;
		}
		if (_Extra->col < 0) _Extra->col = nbCols;
		if (_Extra->row < 0) _Extra->row = nbRows;

		// We pass either Parent passed to current BuildPreview function
		// or pointer to additional parent currently created
		wxObject* ChildPreview = Child->BuildPreview(NewParent,Flags);
		if ( !ChildPreview ) continue;

		wxSizer* ChildAsSizer = wxDynamicCast(ChildPreview,wxSizer);
		wxWindow* ChildAsWindow = wxDynamicCast(ChildPreview,wxWindow);
		wxGBSizerItem* ChildAsItem = wxDynamicCast(ChildPreview,wxGBSizerItem);
		if ( ChildAsSizer )
		{
			Sizer->Add(ChildAsSizer,
			wxGBPosition(_Extra->row, _Extra->col), wxGBSpan(_Extra->rowspan, _Extra->colspan),
			wxsSizerFlagsProperty::GetWxFlags(_Extra->Flags),
			_Extra->Border.GetPixels(Parent));
		}
		else if ( ChildAsWindow )
		{
			Sizer->Add(ChildAsWindow,
			wxGBPosition(_Extra->row, _Extra->col), wxGBSpan(_Extra->rowspan, _Extra->colspan),
			wxsSizerFlagsProperty::GetWxFlags(_Extra->Flags),
			_Extra->Border.GetPixels(Parent));
		}
		else if ( ChildAsItem )
		{
			ChildAsItem->SetProportion(_Extra->Proportion);
			ChildAsItem->SetFlag(wxsSizerFlagsProperty::GetWxFlags(_Extra->Flags));
			ChildAsItem->SetBorder(_Extra->Border.GetPixels(Parent));
			ChildAsItem->SetSpan(wxGBSpan(_Extra->rowspan, _Extra->colspan));
			ChildAsItem->SetPos(wxGBPosition(_Extra->row, _Extra->col));
			Sizer->Add(ChildAsItem);
		}
	}

	if ( !(Flags & pfExact) )
	{
		NewParent->SetSizer(Sizer);
		if ( !GetChildCount() )
		{
			// Setting custom size for childless sizer to prevent
			// zero-size items
			NewParent->SetInitialSize(wxSize(20,20));
			NewParent->SetSizeHints(20,20);
			NewParent->SetSize(wxSize(20,20));
		}
		else
		{
			Sizer->Fit(NewParent);
			Sizer->SetSizeHints(NewParent);
		}
		return NewParent;
	}
	return Sizer;
}
Example #20
0
void PathConfigPane::InitializeGUI()
{
  m_iso_paths_listbox = new wxListBox(this, wxID_ANY);
  m_recursive_iso_paths_checkbox = new wxCheckBox(this, wxID_ANY, _("Search Subfolders"));
  m_add_iso_path_button = new wxButton(this, wxID_ANY, _("Add..."));
  m_remove_iso_path_button = new wxButton(this, wxID_ANY, _("Remove"));
  m_remove_iso_path_button->Disable();

  m_default_iso_filepicker = new wxFilePickerCtrl(
      this, wxID_ANY, wxEmptyString, _("Choose a default ISO:"),
      _("All GC/Wii files (elf, dol, gcm, iso, tgc, wbfs, ciso, gcz, wad)") +
          wxString::Format("|*.elf;*.dol;*.gcm;*.iso;*.tgc;*.wbfs;*.ciso;*.gcz;*.wad|%s",
                           wxGetTranslation(wxALL_FILES)),
      wxDefaultPosition, wxDefaultSize, wxFLP_USE_TEXTCTRL | wxFLP_OPEN | wxFLP_SMALL);
  m_nand_root_dirpicker =
      new wxDirPickerCtrl(this, wxID_ANY, wxEmptyString, _("Choose a NAND root directory:"),
                          wxDefaultPosition, wxDefaultSize, wxDIRP_USE_TEXTCTRL | wxDIRP_SMALL);
  m_dump_path_dirpicker =
      new wxDirPickerCtrl(this, wxID_ANY, wxEmptyString, _("Choose a dump directory:"),
                          wxDefaultPosition, wxDefaultSize, wxDIRP_USE_TEXTCTRL | wxDIRP_SMALL);
  m_wii_sdcard_filepicker = new wxFilePickerCtrl(
      this, wxID_ANY, wxEmptyString, _("Choose an SD Card file:"), wxFileSelectorDefaultWildcardStr,
      wxDefaultPosition, wxDefaultSize, wxDIRP_USE_TEXTCTRL | wxDIRP_SMALL);

  const int space5 = FromDIP(5);

  wxBoxSizer* const iso_button_sizer = new wxBoxSizer(wxHORIZONTAL);
  iso_button_sizer->Add(m_recursive_iso_paths_checkbox, 0, wxALIGN_CENTER_VERTICAL);
  iso_button_sizer->AddStretchSpacer();
  iso_button_sizer->Add(m_add_iso_path_button, 0, wxALIGN_CENTER_VERTICAL);
  iso_button_sizer->Add(m_remove_iso_path_button, 0, wxALIGN_CENTER_VERTICAL);

  wxStaticBoxSizer* const iso_listbox_sizer =
      new wxStaticBoxSizer(wxVERTICAL, this, _("ISO Directories"));
  iso_listbox_sizer->Add(m_iso_paths_listbox, 1, wxEXPAND);
  iso_listbox_sizer->AddSpacer(space5);
  iso_listbox_sizer->Add(iso_button_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
  iso_listbox_sizer->AddSpacer(space5);

  wxGridBagSizer* const picker_sizer = new wxGridBagSizer(space5, space5);
  picker_sizer->Add(new wxStaticText(this, wxID_ANY, _("Default ISO:")), wxGBPosition(0, 0),
                    wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
  picker_sizer->Add(m_default_iso_filepicker, wxGBPosition(0, 1), wxDefaultSpan, wxEXPAND);
  picker_sizer->Add(new wxStaticText(this, wxID_ANY, _("Wii NAND Root:")), wxGBPosition(1, 0),
                    wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
  picker_sizer->Add(m_nand_root_dirpicker, wxGBPosition(1, 1), wxDefaultSpan, wxEXPAND);
  picker_sizer->Add(new wxStaticText(this, wxID_ANY, _("Dump Path:")), wxGBPosition(2, 0),
                    wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
  picker_sizer->Add(m_dump_path_dirpicker, wxGBPosition(2, 1), wxDefaultSpan, wxEXPAND);
  picker_sizer->Add(new wxStaticText(this, wxID_ANY, _("SD Card Path:")), wxGBPosition(3, 0),
                    wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
  picker_sizer->Add(m_wii_sdcard_filepicker, wxGBPosition(3, 1), wxDefaultSpan, wxEXPAND);
  picker_sizer->AddGrowableCol(1);

  // Populate the Paths page
  wxBoxSizer* const main_sizer = new wxBoxSizer(wxVERTICAL);
  main_sizer->AddSpacer(space5);
  main_sizer->Add(iso_listbox_sizer, 1, wxEXPAND | wxLEFT | wxRIGHT, space5);
  main_sizer->AddSpacer(space5);
  main_sizer->Add(picker_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
  main_sizer->AddSpacer(space5);

  SetSizer(main_sizer);
}
Example #21
0
void AudioConfigPane::InitializeGUI()
{
	m_dsp_engine_strings.Add(_("DSP HLE emulation (fast)"));
	m_dsp_engine_strings.Add(_("DSP LLE recompiler"));
	m_dsp_engine_strings.Add(_("DSP LLE interpreter (slow)"));

	m_dsp_engine_radiobox = new wxRadioBox(this, wxID_ANY, _("DSP Emulator Engine"), wxDefaultPosition, wxDefaultSize, m_dsp_engine_strings, 0, wxRA_SPECIFY_ROWS);
	m_dpl2_decoder_checkbox = new wxCheckBox(this, wxID_ANY, _("Dolby Pro Logic II decoder"));
	m_volume_slider = new wxSlider(this, wxID_ANY, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL | wxSL_INVERSE);
	m_volume_text = new wxStaticText(this, wxID_ANY, "");
	m_audio_backend_choice = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_audio_backend_strings);
	m_audio_latency_spinctrl = new wxSpinCtrl(this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 30);
	m_time_stretching_checkbox = new wxCheckBox(this, wxID_ANY, _("Time Stretching"));
	m_RS_Hack_checkbox = new wxCheckBox(this, wxID_ANY, _("Rogue Squadron 2/3 Hack"));
	m_dsp_engine_radiobox->Bind(wxEVT_RADIOBOX, &AudioConfigPane::OnDSPEngineRadioBoxChanged, this);
	m_dpl2_decoder_checkbox->Bind(wxEVT_CHECKBOX, &AudioConfigPane::OnDPL2DecoderCheckBoxChanged, this);
	m_volume_slider->Bind(wxEVT_SLIDER, &AudioConfigPane::OnVolumeSliderChanged, this);
	m_audio_backend_choice->Bind(wxEVT_CHOICE, &AudioConfigPane::OnAudioBackendChanged, this);
	m_audio_latency_spinctrl->Bind(wxEVT_SPINCTRL, &AudioConfigPane::OnLatencySpinCtrlChanged, this);
	m_time_stretching_checkbox->Bind(wxEVT_CHECKBOX, &AudioConfigPane::OnTimeStretchingCheckBoxChanged, this);
	m_RS_Hack_checkbox->Bind(wxEVT_CHECKBOX, &AudioConfigPane::OnRS_Hack_checkboxChanged, this);

	m_audio_backend_choice->SetToolTip(_("Changing this will have no effect while the emulator is running."));
	m_audio_latency_spinctrl->SetToolTip(_("Sets the latency (in ms). Higher values may reduce audio crackling."));
#if defined(__APPLE__)
	m_dpl2_decoder_checkbox->SetToolTip(_("Enables Dolby Pro Logic II emulation using 5.1 surround. Not available on OS X."));
#else
	m_dpl2_decoder_checkbox->SetToolTip(_("Enables Dolby Pro Logic II emulation using 5.1 surround"));
#endif
	m_time_stretching_checkbox->SetToolTip(_("Enables Audio speed stretching to reduce artifacts in games running slower or faster than the original game."));
	m_RS_Hack_checkbox->SetToolTip(_("HACK to fix HLE audio under Rogue Squadron 2/3. This will break everything else so use carefully."));

	wxStaticBoxSizer* const dsp_engine_sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Sound Settings"));
	dsp_engine_sizer->Add(m_dsp_engine_radiobox, 0, wxALL | wxEXPAND, 5);
	dsp_engine_sizer->Add(m_dpl2_decoder_checkbox, 0, wxALL, 5);
	dsp_engine_sizer->Add(m_time_stretching_checkbox, 0, wxALL, 5);
	dsp_engine_sizer->Add(m_RS_Hack_checkbox, 0, wxALL, 5);

	wxStaticBoxSizer* const volume_sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Volume"));
	volume_sizer->Add(m_volume_slider, 1, wxLEFT | wxRIGHT, 13);
	volume_sizer->Add(m_volume_text, 0, wxALIGN_CENTER | wxALL, 5);

	wxGridBagSizer* const backend_grid_sizer = new wxGridBagSizer();
	backend_grid_sizer->Add(new wxStaticText(this, wxID_ANY, _("Audio Backend:")), wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxALL, 5);
	backend_grid_sizer->Add(m_audio_backend_choice, wxGBPosition(0, 1), wxDefaultSpan, wxALL, 5);
	backend_grid_sizer->Add(new wxStaticText(this, wxID_ANY, _("Latency:")), wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxALL, 5);
	backend_grid_sizer->Add(m_audio_latency_spinctrl, wxGBPosition(1, 1), wxDefaultSpan, wxALL, 5);

	wxStaticBoxSizer* const backend_static_box_sizer = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Backend Settings"));
	backend_static_box_sizer->Add(backend_grid_sizer, 0, wxEXPAND);

	wxBoxSizer* const dsp_audio_sizer = new wxBoxSizer(wxHORIZONTAL);
	dsp_audio_sizer->Add(dsp_engine_sizer, 1, wxEXPAND | wxALL, 5);
	dsp_audio_sizer->Add(volume_sizer, 0, wxEXPAND | wxALL, 5);

	wxBoxSizer* const main_sizer = new wxBoxSizer(wxVERTICAL);
	main_sizer->Add(dsp_audio_sizer, 0, wxALL | wxEXPAND);
	main_sizer->Add(backend_static_box_sizer, 0, wxALL | wxEXPAND, 5);

	SetSizerAndFit(main_sizer);
}
Example #22
0
CDVToolWriterFrame::CDVToolWriterFrame(const wxString& title) :
wxFrame(NULL, -1, title),
m_format(NULL),
m_recording(NULL),
m_your(NULL),
m_rpt1(NULL),
m_rpt2(NULL),
m_message(NULL)
{
	SetMenuBar(createMenuBar());

	wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);

	wxPanel* panel = new wxPanel(this);

	wxGridBagSizer* panelSizer = new wxGridBagSizer(BORDER_SIZE, BORDER_SIZE);

	wxStaticText* formatLabel = new wxStaticText(panel, -1, _("Format:"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	panelSizer->Add(formatLabel, wxGBPosition(0, 0), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_format = new wxChoice(panel, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1));
	m_format->Append(wxT(".dvtool"));
	m_format->Append(wxT(".ambe"));
	panelSizer->Add(m_format, wxGBPosition(0, 1), wxDefaultSpan, wxALL, BORDER_SIZE);
	m_format->SetSelection(0);

	wxImage* start = new wxImage(15, 15, startImage, startAlpha, true);
	wxImage* stop  = new wxImage(15, 15, stopImage, true);

	wxStaticText* micLabel = new wxStaticText(panel, -1, _("Microphone:"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	panelSizer->Add(micLabel, wxGBPosition(0, 2), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxBoxSizer* micSizer = new wxBoxSizer(wxHORIZONTAL);

	wxButton* startButton = new wxBitmapButton(panel, Button_Start, wxBitmap(*start), wxDefaultPosition, wxSize(MIC_WIDTH, -1), wxALIGN_RIGHT);
	micSizer->Add(startButton, wxALL, BORDER_SIZE);

	wxButton* stopButton = new wxBitmapButton(panel, Button_Stop, wxBitmap(*stop), wxDefaultPosition, wxSize(MIC_WIDTH, -1), wxALIGN_RIGHT);
	micSizer->Add(stopButton, wxALL, BORDER_SIZE);

	panelSizer->Add(micSizer, wxGBPosition(0, 3), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_recording = new wxStaticText(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	panelSizer->Add(m_recording, wxGBPosition(0, 5), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticText* yourLabel = new wxStaticText(panel, -1, _("Your:"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	panelSizer->Add(yourLabel, wxGBPosition(1, 0), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_your = new CCallsignTextCtrl(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1));
	m_your->SetMaxLength(LONG_CALLSIGN_LENGTH);
	panelSizer->Add(m_your, wxGBPosition(1, 1), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticText* rpt1Label = new wxStaticText(panel, -1, _("RPT1:"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	panelSizer->Add(rpt1Label, wxGBPosition(1, 2), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_rpt1 = new CCallsignTextCtrl(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1));
	m_rpt1->SetMaxLength(LONG_CALLSIGN_LENGTH);
	panelSizer->Add(m_rpt1, wxGBPosition(1, 3), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticText* rpt2Label = new wxStaticText(panel, -1, _("RPT2:"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	panelSizer->Add(rpt2Label, wxGBPosition(1, 4), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_rpt2 = new CCallsignTextCtrl(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1));
	m_rpt2->SetMaxLength(LONG_CALLSIGN_LENGTH);
	panelSizer->Add(m_rpt2, wxGBPosition(1, 5), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticText* messageLabel = new wxStaticText(panel, -1, _("Message:"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	panelSizer->Add(messageLabel, wxGBPosition(2, 0), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_message = new wxTextCtrl(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH * 2U + LABEL_WIDTH + BORDER_SIZE * 6U, -1), wxALIGN_LEFT);
	m_message->SetMaxLength(MESSAGE_LENGTH);
	panelSizer->Add(m_message, wxGBPosition(2, 1), wxGBSpan(1, 3), wxALL, BORDER_SIZE);

	panel->SetSizer(panelSizer);
	panelSizer->SetSizeHints(panel);

	mainSizer->Add(panel);

	SetSizer(mainSizer);
	mainSizer->SetSizeHints(this);
}
Example #23
0
PathUtilDlg::PathUtilDlg():
wxFrame(NULL, wxID_ANY, wxString(_T("Utils")), wxDefaultPosition,
         wxSize(800,600))
{
    m_host_thread_id = GetCurrentThreadId();
    // add menu
    wxMenuBar* menu_bar = new wxMenuBar();
    wxMenu* simple_menu = new wxMenu();
    simple_menu->Append(wxID_ABOUT, _T("About..."));
    simple_menu->Append(wxID_EXIT, _T("Exit..."));
    menu_bar->Append(simple_menu, _T("Application"));
    SetMenuBar(menu_bar);

    this->CreateStatusBar();
    m_path_page = NULL;
    m_clean_page = NULL;
    wxString text;
    text.Printf(wxT("This is text box %08x"), this);
    m_btnOK = new wxButton(this, wxID_ANY, _T("&OK"));
    m_btnCancel = new wxButton(this, wxID_ANY, _T("&Cancel"));
    m_btnExit = new wxButton(this, wxID_ANY, _T("&Exit"));

    m_book = new wxNotebook(this, wxID_ANY);

	m_path_page =  new PathPage(m_book);
	m_book->AddPage(m_path_page, m_path_page->GetName());
	m_clean_page = new CleanPage(m_book);
    m_book->AddPage(m_clean_page, _T("Clean"));
    m_copy_page = new CopyPage(m_book);
    m_book->AddPage(m_copy_page, _T("Copy"));
    m_verbose_page = new VerbosePage(m_book);
    m_book->AddPage(m_verbose_page, _T("Verbose"));
    m_config_page = new ConfigPage(m_book);
    m_book->AddPage(m_config_page, _T("Configuration"));
    m_find_page = new FindPage(m_book);
    m_book->AddPage(m_find_page, m_find_page->GetName());
	m_crc_page = new CrcPage(m_book);
	m_book->AddPage(m_crc_page, m_crc_page->GetName());
	//m_capture_page = new CapturePage(m_book);
	//m_book->AddPage(m_capture_page, wxT("CapturePage"));

	m_python_page = new PythonPage(m_book);
	m_book->AddPage(m_python_page, _T("Python"));

	m_rename_page = new RenamePage(m_book);
	m_book->AddPage(m_rename_page, _T("Rename"));
	m_book->SetSelection(9);
	
	m_base64_page = new Base64Page(m_book);
	m_book->AddPage(m_base64_page, _T("Base64"));

    AboutPage* m_about_page = new AboutPage(m_book);
    m_book->AddPage(m_about_page, _T("About"));

    wxGridBagSizer* sizer = new wxGridBagSizer();
    sizer->Add(m_book, wxGBPosition(0, 0), wxGBSpan(3, 3), wxALL | wxEXPAND );
    sizer->Add(m_btnOK, wxGBPosition(3, 0), wxDefaultSpan, wxALIGN_RIGHT);
    sizer->Add(m_btnCancel, wxGBPosition(3, 1), wxDefaultSpan, wxALIGN_CENTER);
    sizer->Add(m_btnExit, wxGBPosition(3, 2), wxDefaultSpan, wxALIGN_LEFT);
    sizer->AddGrowableRow(0);
	sizer->AddGrowableCol(0);
    sizer->AddGrowableCol(2);
//     sizer->Add(m_statusbar, wxGBPosition(4, 0), wxGBSpan(1, 4), wxEXPAND|wxHORIZONTAL);
    LoadConfiguration();
	SetSizer(sizer);
    sizer->SetSizeHints(this);
	//sizer->Fit(this);
    //SetAutoLayout(true);
	this->SetSizeHints(wxSize(800, 600));
	this->CenterOnParent(wxBOTH);
    m_btnOK->SetFocus();
    m_btnOK->SetDefault();

	bool reghotkey = RegisterHotKey(CapturePage::hotkey_id, wxMOD_CONTROL, '8');
	if (!reghotkey)
		wxLogError(_T("Fail to register hotkey"));

}
Example #24
0
void WiiConfigPane::InitializeGUI()
{
  m_aspect_ratio_strings.Add("4:3");
  m_aspect_ratio_strings.Add("16:9");

  m_system_language_strings.Add(_("Japanese"));
  m_system_language_strings.Add(_("English"));
  m_system_language_strings.Add(_("German"));
  m_system_language_strings.Add(_("French"));
  m_system_language_strings.Add(_("Spanish"));
  m_system_language_strings.Add(_("Italian"));
  m_system_language_strings.Add(_("Dutch"));
  m_system_language_strings.Add(_("Simplified Chinese"));
  m_system_language_strings.Add(_("Traditional Chinese"));
  m_system_language_strings.Add(_("Korean"));

  m_bt_sensor_bar_pos_strings.Add(_("Bottom"));
  m_bt_sensor_bar_pos_strings.Add(_("Top"));

  m_screensaver_checkbox = new wxCheckBox(this, wxID_ANY, _("Enable Screen Saver"));
  m_pal60_mode_checkbox = new wxCheckBox(this, wxID_ANY, _("Use PAL60 Mode (EuRGB60)"));
  m_aspect_ratio_choice =
      new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_aspect_ratio_strings);
  m_system_language_choice =
      new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_system_language_strings);
  m_sd_card_checkbox = new wxCheckBox(this, wxID_ANY, _("Insert SD Card"));
  m_connect_keyboard_checkbox = new wxCheckBox(this, wxID_ANY, _("Connect USB Keyboard"));
  m_bt_sensor_bar_pos =
      new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_bt_sensor_bar_pos_strings);
  m_bt_sensor_bar_sens = new DolphinSlider(this, wxID_ANY, 0, 0, 4);
  m_bt_speaker_volume = new DolphinSlider(this, wxID_ANY, 0, 0, 127);
  m_bt_wiimote_motor = new wxCheckBox(this, wxID_ANY, _("Wiimote Motor"));

  m_screensaver_checkbox->Bind(wxEVT_CHECKBOX, &WiiConfigPane::OnScreenSaverCheckBoxChanged, this);
  m_pal60_mode_checkbox->Bind(wxEVT_CHECKBOX, &WiiConfigPane::OnPAL60CheckBoxChanged, this);
  m_aspect_ratio_choice->Bind(wxEVT_CHOICE, &WiiConfigPane::OnAspectRatioChoiceChanged, this);
  m_system_language_choice->Bind(wxEVT_CHOICE, &WiiConfigPane::OnSystemLanguageChoiceChanged, this);
  m_sd_card_checkbox->Bind(wxEVT_CHECKBOX, &WiiConfigPane::OnSDCardCheckBoxChanged, this);
  m_connect_keyboard_checkbox->Bind(wxEVT_CHECKBOX,
                                    &WiiConfigPane::OnConnectKeyboardCheckBoxChanged, this);
  m_bt_sensor_bar_pos->Bind(wxEVT_CHOICE, &WiiConfigPane::OnSensorBarPosChanged, this);
  m_bt_sensor_bar_sens->Bind(wxEVT_SLIDER, &WiiConfigPane::OnSensorBarSensChanged, this);
  m_bt_speaker_volume->Bind(wxEVT_SLIDER, &WiiConfigPane::OnSpeakerVolumeChanged, this);
  m_bt_wiimote_motor->Bind(wxEVT_CHECKBOX, &WiiConfigPane::OnWiimoteMotorChanged, this);

  m_screensaver_checkbox->SetToolTip(_("Dims the screen after five minutes of inactivity."));
  m_pal60_mode_checkbox->SetToolTip(_("Sets the Wii display mode to 60Hz (480i) instead of 50Hz "
                                      "(576i) for PAL games.\nMay not work for all games."));
  m_system_language_choice->SetToolTip(_("Sets the Wii system language."));
  m_sd_card_checkbox->SetToolTip(_("Saved to /Wii/sd.raw (default size is 128mb)"));
  m_connect_keyboard_checkbox->SetToolTip(_("May cause slow down in Wii Menu and some games."));

  const int space5 = FromDIP(5);

  wxGridBagSizer* const misc_settings_grid_sizer = new wxGridBagSizer(space5, space5);
  misc_settings_grid_sizer->Add(m_screensaver_checkbox, wxGBPosition(0, 0), wxGBSpan(1, 2));
  misc_settings_grid_sizer->Add(m_pal60_mode_checkbox, wxGBPosition(1, 0), wxGBSpan(1, 2));
  misc_settings_grid_sizer->Add(new wxStaticText(this, wxID_ANY, _("Aspect Ratio:")),
                                wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
  misc_settings_grid_sizer->Add(m_aspect_ratio_choice, wxGBPosition(2, 1), wxDefaultSpan,
                                wxALIGN_CENTER_VERTICAL);
  misc_settings_grid_sizer->Add(new wxStaticText(this, wxID_ANY, _("System Language:")),
                                wxGBPosition(3, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
  misc_settings_grid_sizer->Add(m_system_language_choice, wxGBPosition(3, 1), wxDefaultSpan,
                                wxALIGN_CENTER_VERTICAL);

  auto* const bt_sensor_bar_pos_sizer = new wxBoxSizer(wxHORIZONTAL);
  bt_sensor_bar_pos_sizer->Add(new wxStaticText(this, wxID_ANY, _("Min")), 0,
                               wxALIGN_CENTER_VERTICAL);
  bt_sensor_bar_pos_sizer->Add(m_bt_sensor_bar_sens, 0, wxALIGN_CENTER_VERTICAL);
  bt_sensor_bar_pos_sizer->Add(new wxStaticText(this, wxID_ANY, _("Max")), 0,
                               wxALIGN_CENTER_VERTICAL);

  auto* const bt_speaker_volume_sizer = new wxBoxSizer(wxHORIZONTAL);
  bt_speaker_volume_sizer->Add(new wxStaticText(this, wxID_ANY, _("Min")), 0,
                               wxALIGN_CENTER_VERTICAL);
  bt_speaker_volume_sizer->Add(m_bt_speaker_volume, 0, wxALIGN_CENTER_VERTICAL);
  bt_speaker_volume_sizer->Add(new wxStaticText(this, wxID_ANY, _("Max")), 0,
                               wxALIGN_CENTER_VERTICAL);

  wxGridBagSizer* const bt_settings_grid_sizer = new wxGridBagSizer(space5, space5);
  bt_settings_grid_sizer->Add(new wxStaticText(this, wxID_ANY, _("Sensor Bar Position:")),
                              wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
  bt_settings_grid_sizer->Add(m_bt_sensor_bar_pos, wxGBPosition(0, 1), wxDefaultSpan,
                              wxALIGN_CENTER_VERTICAL);
  bt_settings_grid_sizer->Add(new wxStaticText(this, wxID_ANY, _("IR Sensitivity:")),
                              wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
  bt_settings_grid_sizer->Add(bt_sensor_bar_pos_sizer, wxGBPosition(1, 1), wxDefaultSpan,
                              wxALIGN_CENTER_VERTICAL);
  bt_settings_grid_sizer->Add(new wxStaticText(this, wxID_ANY, _("Speaker Volume:")),
                              wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
  bt_settings_grid_sizer->Add(bt_speaker_volume_sizer, wxGBPosition(2, 1), wxDefaultSpan,
                              wxALIGN_CENTER_VERTICAL);
  bt_settings_grid_sizer->Add(m_bt_wiimote_motor, wxGBPosition(3, 0), wxGBSpan(1, 2),
                              wxALIGN_CENTER_VERTICAL);

  wxStaticBoxSizer* const misc_settings_static_sizer =
      new wxStaticBoxSizer(wxVERTICAL, this, _("Misc Settings"));
  misc_settings_static_sizer->AddSpacer(space5);
  misc_settings_static_sizer->Add(misc_settings_grid_sizer, 0, wxLEFT | wxRIGHT, space5);
  misc_settings_static_sizer->AddSpacer(space5);

  wxStaticBoxSizer* const device_settings_sizer =
      new wxStaticBoxSizer(wxVERTICAL, this, _("Device Settings"));
  device_settings_sizer->AddSpacer(space5);
  device_settings_sizer->Add(m_sd_card_checkbox, 0, wxLEFT | wxRIGHT, space5);
  device_settings_sizer->AddSpacer(space5);
  device_settings_sizer->Add(m_connect_keyboard_checkbox, 0, wxLEFT | wxRIGHT, space5);
  device_settings_sizer->AddSpacer(space5);

  auto* const bt_settings_static_sizer =
      new wxStaticBoxSizer(wxVERTICAL, this, _("Wii Remote Settings"));
  bt_settings_static_sizer->AddSpacer(space5);
  bt_settings_static_sizer->Add(bt_settings_grid_sizer, 0, wxLEFT | wxRIGHT, space5);
  bt_settings_static_sizer->AddSpacer(space5);

  wxBoxSizer* const main_sizer = new wxBoxSizer(wxVERTICAL);
  main_sizer->AddSpacer(space5);
  main_sizer->Add(misc_settings_static_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
  main_sizer->AddSpacer(space5);
  main_sizer->Add(device_settings_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
  main_sizer->AddSpacer(space5);
  main_sizer->Add(bt_settings_static_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
  main_sizer->AddSpacer(space5);

  SetSizer(main_sizer);
}
Example #25
0
LoginDialog::LoginDialog (wxWindow *parent, wxString errorMsg, UserInfo info, bool canGoOffline)
	: wxDialog(parent, -1, _("Login"), wxDefaultPosition, wxSize(520, 140))
{
	SetAprilFonts(this);

	wxGridBagSizer *mainBox = new wxGridBagSizer();
	int offset = (errorMsg.empty() ? 0 : 1);
	const int cols = 3;
	const int padding = 4;
	
	// Error message label
	if (!errorMsg.empty())
	{
		wxStaticText *errorMsgLabel = new wxStaticText(this, -1, errorMsg);
		mainBox->Add(errorMsgLabel, wxGBPosition(0, 0), wxGBSpan(1, cols), 
					 wxTOP | wxLEFT | wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT, padding);
	}
	
	// Username text field
	wxStaticText *usernameLabel = new wxStaticText(this, -1, _("Username: "******"Password: "******"&Force update"));
	mainBox->Add(forceUpdateToggle, wxGBPosition(2 + offset, 0), wxGBSpan(1, 1), wxALL, padding);
	
	rememberUsernameCheck = new wxCheckBox(this, -1, _("&Remember username?"));
	rememberUsernameCheck->SetValue(info.rememberUsername);
	mainBox->Add(rememberUsernameCheck, wxGBPosition(2 + offset, 1), wxGBSpan(1, 1), 
		wxALL | wxALIGN_CENTER_VERTICAL, padding);
	
	rememberPasswordCheck = new wxCheckBox(this, -1, _("R&emember password?"));
	rememberPasswordCheck->SetValue(info.rememberPassword);
	mainBox->Add(rememberPasswordCheck, wxGBPosition(2 + offset, 2), wxGBSpan(1, 1),
		wxALL | wxALIGN_CENTER_VERTICAL, padding);
	
	wxBoxSizer *playOfflineSizer = new wxBoxSizer(wxHORIZONTAL);
	playOfflineButton = new wxButton(this, ID_PLAY_OFFLINE, _("Play &Offline"));
	playOfflineSizer->Add(playOfflineButton, 1, wxTOP | wxBOTTOM | wxEXPAND, 8);
	mainBox->Add(playOfflineSizer, wxGBPosition(3 + offset, 0), wxGBSpan(1, 1), 
		wxLEFT | wxRIGHT | wxEXPAND, padding);
	
	if(!canGoOffline)
		playOfflineButton->Enable(false);
	
	wxSizer *btnBox = CreateButtonSizer(wxOK | wxCANCEL);
	mainBox->Add(btnBox, wxGBPosition(3 + offset, 1), wxGBSpan(1, cols - 1), 
		wxRIGHT | wxTOP | wxBOTTOM | wxEXPAND, 8);
	
	usernameTextBox->SetFocus();
	
	SetSizer(mainBox);
	mainBox->SetSizeHints(this);
	(*usernameTextBox) << info.username;
	(*passwordTextBox) << info.password;
}
Example #26
0
/* AudioEntryPanel::AudioEntryPanel
 * AudioEntryPanel class constructor
 *******************************************************************/
AudioEntryPanel::AudioEntryPanel(wxWindow* parent) : EntryPanel(parent, "audio")
{
	// Init variables
	timer_seek = new wxTimer(this);
	sound_buffer = NULL;
	audio_type = AUTYPE_INVALID;
	num_tracks = 1;
	subsong = 0;
	song_length = 0;
	sound = new sf::Sound();
	music = new sf::Music();
	mod = new ModMusic();

#ifdef __WXMSW__
	wxRegKey key(wxRegKey::HKLM, "Software\\Microsoft\\Active Setup\\Installed Components\\{6BF52A52-394A-11d3-B153-00C04F79FAA6}");
	long value = 0;
	key.QueryValue("IsInstalled", &value);
	if (value == 0)
	{
		LOG_MESSAGE(1, "Windows Media Player not installed, mp3 playback disabled.");
		media_ctrl = NULL;
	}
	else
	{
		LOG_MESSAGE(3, "Windows Media Player installed, using wxMediaCtrl");
		media_ctrl = new wxMediaCtrl(this, -1);
	}
#else
	// Create wxMediaCtrl
	media_ctrl = new wxMediaCtrl(this, -1);
#endif

	// Setup sizer
	wxGridBagSizer* sizer_gb = new wxGridBagSizer(4, 4);
	sizer_main->AddStretchSpacer();
#ifndef __WXOSX__
	if (media_ctrl) sizer_main->Add(media_ctrl, 0);
#endif
	sizer_main->Add(sizer_gb, 0, wxALIGN_CENTER);
	sizer_main->AddStretchSpacer();

	// Add seekbar
	slider_seek = new wxSlider(this, -1, 0, 0, 100);
	sizer_gb->Add(slider_seek, wxGBPosition(0, 0), wxGBSpan(1, 9), wxEXPAND);

	// Add play controls
	btn_play = new wxBitmapButton(this, -1, Icons::getIcon(Icons::GENERAL, "play"));
	sizer_gb->Add(btn_play, wxGBPosition(1, 0));
	btn_pause = new wxBitmapButton(this, -1, Icons::getIcon(Icons::GENERAL, "pause"));
	sizer_gb->Add(btn_pause, wxGBPosition(1, 1));
	btn_stop = new wxBitmapButton(this, -1, Icons::getIcon(Icons::GENERAL, "stop"));
	sizer_gb->Add(btn_stop, wxGBPosition(1, 2));
	btn_prev = new wxBitmapButton(this, -1, Icons::getIcon(Icons::GENERAL, "prev"));
	sizer_gb->Add(btn_prev, wxGBPosition(1, 3));
	btn_next = new wxBitmapButton(this, -1, Icons::getIcon(Icons::GENERAL, "next"));
	sizer_gb->Add(btn_next, wxGBPosition(1, 4));

	// Add title
	txt_title = new wxStaticText(this, -1, wxEmptyString);
	sizer_gb->Add(txt_title, wxGBPosition(3, 0), wxGBSpan(3, 9));

	// Add info
	txt_info = new wxTextCtrl(this, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_BESTWRAP);
	sizer_gb->Add(txt_info, wxGBPosition(6, 0), wxGBSpan(9, 9), wxEXPAND|wxHORIZONTAL);

	// Add track number
	txt_track = new wxStaticText(this, -1, "1/1");
	sizer_gb->Add(txt_track, wxGBPosition(1, 5), wxDefaultSpan, wxALIGN_CENTER);

	// Separator
	sizer_gb->Add(new wxStaticLine(this, -1, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL), wxGBPosition(1, 6), wxDefaultSpan, wxEXPAND|wxLEFT|wxRIGHT, 8);

	// Add volume slider
	sizer_gb->Add(new wxStaticText(this, -1, "Volume:"), wxGBPosition(1, 7), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
	slider_volume = new wxSlider(this, -1, 0, 0, 100, wxDefaultPosition, wxSize(128, -1));
	slider_volume->SetValue(snd_volume);
	sizer_gb->Add(slider_volume, wxGBPosition(1, 8));

	// Set volume
	sound->setVolume(snd_volume);
	music->setVolume(snd_volume);
	theMIDIPlayer->setVolume(snd_volume);
	if (media_ctrl) media_ctrl->SetVolume(snd_volume*0.01);
	mod->setVolume(snd_volume);
	//theGMEPlayer->setVolume(snd_volume);
	//theOPLPlayer->setVolume(snd_volume);

	// Disable general entrypanel buttons
	if (media_ctrl) media_ctrl->Show(false);
	toolbar->Show(false);

	// Bind events
	btn_play->Bind(wxEVT_BUTTON, &AudioEntryPanel::onBtnPlay, this);
	btn_pause->Bind(wxEVT_BUTTON, &AudioEntryPanel::onBtnPause, this);
	btn_stop->Bind(wxEVT_BUTTON, &AudioEntryPanel::onBtnStop, this);
	btn_prev->Bind(wxEVT_BUTTON, &AudioEntryPanel::onBtnPrev, this);
	btn_next->Bind(wxEVT_BUTTON, &AudioEntryPanel::onBtnNext, this);
	slider_seek->Bind(wxEVT_SLIDER, &AudioEntryPanel::onSliderSeekChanged, this);
	slider_volume->Bind(wxEVT_SLIDER, &AudioEntryPanel::onSliderVolumeChanged, this);
	Bind(wxEVT_TIMER, &AudioEntryPanel::onTimer, this);

	Layout();
}
Example #27
0
DriftToolWin::DriftToolWin()
    : wxFrame(pFrame, wxID_ANY, _("Drift Align"), wxDefaultPosition, wxDefaultSize,
              wxCAPTION|wxCLOSE_BOX|wxMINIMIZE_BOX|wxSYSTEM_MENU|wxTAB_TRAVERSAL|wxFRAME_FLOAT_ON_PARENT|wxFRAME_NO_TASKBAR),
      m_need_end_dec_drift(false),
      m_slewing(false)
{
    SetBackgroundColour(wxColor(0xcccccc));

    SetSizeHints(wxDefaultSize, wxDefaultSize);

    // a vertical sizer holding everything
    wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL);

    // a horizontal box sizer for the bitmap and the instructions
    wxBoxSizer *instrSizer = new wxBoxSizer(wxHORIZONTAL);

#   include "icons/AzArrow.xpm"
    m_azArrowBmp = new wxBitmap(AzArrow);
#   include "icons/AltArrow.xpm"
    m_altArrowBmp = new wxBitmap(AltArrow);

    m_bmp = new wxStaticBitmap(this, wxID_ANY, *m_azArrowBmp, wxDefaultPosition, wxSize(80, 100));
    instrSizer->Add(m_bmp, 0, wxALIGN_CENTER_VERTICAL|wxFIXED_MINSIZE, 5);

    m_instructions = new wxStaticText(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(300,90), wxALIGN_LEFT|wxST_NO_AUTORESIZE);
#ifdef __WXOSX__
    m_instructions->SetFont(*wxSMALL_FONT);
#endif
    m_instructions->Wrap(-1);
    instrSizer->Add(m_instructions, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    topSizer->Add(instrSizer);

    // static box sizer holding the scope pointing controls
    wxStaticBoxSizer *sbSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Scope Pointing")), wxVERTICAL);

    // a grid box sizer for laying out scope pointing the controls
    wxGridBagSizer *gbSizer = new wxGridBagSizer(0, 0);
    gbSizer->SetFlexibleDirection(wxBOTH);
    gbSizer->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);

    wxStaticText *txt;

    txt = new wxStaticText(this, wxID_ANY, _("Meridian Offset (deg)"), wxDefaultPosition, wxDefaultSize, 0);
    txt->Wrap(-1);
    gbSizer->Add(txt, wxGBPosition(0, 1), wxGBSpan(1, 1), wxALL, 5);

    txt = new wxStaticText(this, wxID_ANY, _("Declination (deg)"), wxDefaultPosition, wxDefaultSize, 0);
    txt->Wrap(-1);
    gbSizer->Add(txt, wxGBPosition(0, 2), wxGBSpan(1, 1), wxALL, 5);

    txt = new wxStaticText(this, wxID_ANY, _("Current"), wxDefaultPosition, wxDefaultSize, 0);
    txt->Wrap(-1);
    gbSizer->Add(txt, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 5);

    m_raCurrent = new wxTextCtrl(this, wxID_ANY, _T("--"), wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
    gbSizer->Add(m_raCurrent, wxGBPosition(1, 1), wxGBSpan(1, 1), wxEXPAND | wxALL, 5);

    m_decCurrent = new wxTextCtrl(this, wxID_ANY, _T("--"), wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
    gbSizer->Add(m_decCurrent, wxGBPosition(1, 2), wxGBSpan(1, 1), wxEXPAND | wxALL, 5);

    txt = new wxStaticText(this, wxID_ANY, _("Slew To"), wxDefaultPosition, wxDefaultSize, 0);
    txt->Wrap(-1);
    gbSizer->Add(txt, wxGBPosition(2, 0), wxGBSpan(1, 1), wxALL, 5);

    m_raSlew = new wxSpinCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, -90, 90);
    gbSizer->Add(m_raSlew, wxGBPosition(2, 1), wxGBSpan(1, 1), wxEXPAND | wxALL, 5);

    m_decSlew = new wxSpinCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, -90, 90);
    gbSizer->Add(m_decSlew, wxGBPosition(2, 2), wxGBSpan(1, 1), wxEXPAND | wxALL, 5);

    m_slew = new wxButton(this, ID_SLEW, _("Slew"), wxDefaultPosition, wxDefaultSize, 0);
    m_slew->SetToolTip(_("Click to slew to given coordinates."));
    gbSizer->Add(m_slew, wxGBPosition(2, 3), wxGBSpan(1, 1), wxALL, 5);

    wxString label = _("Save");
    wxSize sz(GetTextExtent(label));
    sz.SetHeight(-1);
    sz.IncBy(16, 0);
    m_saveCoords = new wxButton(this, ID_SAVE, label, wxDefaultPosition, sz, 0);
    m_saveCoords->SetToolTip(_("Click to save these coordinates as the default location for this axis adjustment."));
    gbSizer->Add(m_saveCoords, wxGBPosition(2, 4), wxGBSpan(1, 1), wxTOP | wxBOTTOM | wxRIGHT, 5);

    // add grid bag sizer to static sizer
    sbSizer->Add(gbSizer, 1, wxALIGN_CENTER, 5);

    // add static sizer to top-level sizer
    topSizer->Add(sbSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    // add some padding below the static sizer
    topSizer->Add(0, 3, 0, wxEXPAND, 3);

    m_notesLabel = new wxStaticText(this, wxID_ANY, _("Altitude adjustment notes"), wxDefaultPosition, wxDefaultSize, 0);
    m_notesLabel->Wrap(-1);
    topSizer->Add(m_notesLabel, 0, wxEXPAND|wxTOP|wxLEFT, 8);

    m_notes = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(-1, 54), wxTE_MULTILINE);
    pFrame->RegisterTextCtrl(m_notes);
    topSizer->Add(m_notes, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
    m_notes->Bind(wxEVT_COMMAND_TEXT_UPDATED, &DriftToolWin::OnNotesText, this);

    // horizontal sizer for the buttons
    wxBoxSizer *hSizer = new wxBoxSizer(wxHORIZONTAL);

    // proportional pad on left of Drift button
    hSizer->Add(0, 0, 2, wxEXPAND, 5);

    m_drift = new wxButton(this, ID_DRIFT, _("Drift"), wxDefaultPosition, wxDefaultSize, 0);
    hSizer->Add(m_drift, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    // proportional pad on right of Drift button
    hSizer->Add(0, 0, 1, wxEXPAND, 5);

    m_adjust = new wxButton(this, ID_ADJUST, _("Adjust"), wxDefaultPosition, wxDefaultSize, 0);
    hSizer->Add(m_adjust, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    // proportional pad on right of Align button
    hSizer->Add(0, 0, 2, wxEXPAND, 5);

    m_phaseBtn = new wxButton(this, ID_PHASE, wxT("???"), wxDefaultPosition, wxDefaultSize, 0);
    hSizer->Add(m_phaseBtn, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);

    // add button sizer to top level sizer
    topSizer->Add(hSizer, 1, wxEXPAND|wxALL, 5);

    SetSizer(topSizer);

    m_statusBar = CreateStatusBar(1, wxST_SIZEGRIP, wxID_ANY);

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

    int xpos = pConfig->Global.GetInt("/DriftTool/pos.x", -1);
    int ypos = pConfig->Global.GetInt("/DriftTool/pos.y", -1);
    MyFrame::PlaceWindowOnScreen(this, xpos, ypos);

    // can mount slew?
    m_can_slew = pPointingSource && pPointingSource->CanSlew();

    // get site lat/long from scope
    double lat, lon;
    m_siteLatLong.Invalidate();
    if (pPointingSource && !pPointingSource->GetSiteLatLong(&lat, &lon))
    {
        m_siteLatLong.SetXY(lat, lon);
    }

    m_timer = NULL;
    if (m_can_slew || (pPointingSource && pPointingSource->CanReportPosition()))
    {
        enum { SCOPE_POS_POLL_MS = 1500 };
        m_timer = new wxTimer(this, ID_TIMER);
        m_timer->Start(SCOPE_POS_POLL_MS, false /* continuous */);
    }

    // make sure graph window is showing
    if (!pFrame->pGraphLog->IsShown())
    {
        wxCommandEvent evt;
        evt.SetInt(1); // "Checked"
        pFrame->OnGraph(evt);
    }

    // graph must be showing RA/Dec
    m_save_graph_mode = pFrame->pGraphLog->SetMode(GraphLogClientWindow::MODE_RADEC);

    // resize graph scale
    m_save_graph_length = pFrame->pGraphLog->GetLength();
    pFrame->pGraphLog->SetLength(pConfig->Global.GetInt("/DriftTool/GraphLength", GraphLogWindow::DefaultMaxLength));
    m_save_graph_height = pFrame->pGraphLog->GetHeight();
    pFrame->pGraphLog->SetHeight(pConfig->Global.GetInt("/DriftTool/GraphHeight", GraphLogWindow::DefaultMaxHeight));
    pFrame->pGraphLog->Refresh();

    // we do not want sticky lock position enabled
    m_save_lock_pos_is_sticky = pFrame->pGuider->LockPosIsSticky();
    pFrame->pGuider->SetLockPosIsSticky(false);
    pFrame->tools_menu->FindItem(EEGG_STICKY_LOCK)->Check(false);

    m_save_use_subframes = pCamera->UseSubframes;

    m_phase = PHASE_ADJUST_AZ;
    m_mode = MODE_IDLE;
    UpdatePhaseState();
    UpdateModeState();
}
Example #28
0
LightingPresets::LightingPresets(wxWindow* parent) : wxPanel(parent, wxID_ANY) {
	if (presets.size() == 0) {
		InitializePresets();
	}
	
	TCManager::RegisterTCActiveModChanged(this);
	ProfileProxy::GetProxy()->RegisterProxyFlagDataReady(this);
	
	wxStaticBox* lightingPresetsBox = new wxStaticBox(this, wxID_ANY, _("Lighting presets"));
	
	wxHyperlinkCtrl* presetDescsUrl =
		new wxHyperlinkCtrl(this, wxID_ANY, _T("Preset descriptions"),
							_T("http://www.hard-light.net/wiki/index.php/Sample_Lighting_Settings"));
	wxButton* customFlagsCopyButton =
		new wxButton(this, ID_COPY_PRESET_BUTTON, _T("Copy selected preset to custom flags"));
	wxRadioButton* radioButton1 = new wxRadioButton (this, ID_PRESETS_OFF, _T("Presets off"),
													 wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
	wxRadioButton* radioButton2 =
		new wxRadioButton (this, ID_PRESET_BASELINE,
						   DEFAULT_MOD_RECOMMENDED_LIGHTING_NAME);
	wxRadioButton* radioButton3 = new wxRadioButton (this, ID_PRESET_DABRAIN, _T("DaBrain's"));
	wxRadioButton* radioButton4 = new wxRadioButton (this, ID_PRESET_HERRA_TOHTORI, _T("Herra Tohtori's"));
	wxRadioButton* radioButton5 = new wxRadioButton (this, ID_PRESET_CKID, _T("CKid's"));
	wxRadioButton* radioButton6 = new wxRadioButton (this, ID_PRESET_COLECAMPBELL666, _T("ColeCampbell666's"));
	wxRadioButton* radioButton7 = new wxRadioButton (this, ID_PRESET_CASTOR, _T("Castor's"));
	wxRadioButton* radioButton8 = new wxRadioButton (this, ID_PRESET_SPIDEY, _T("Spidey's"));
	wxRadioButton* radioButton9 = new wxRadioButton (this, ID_PRESET_WOOLIE_WOOL, _T("Woolie Wool's"));

	this->Initialize();

	wxGridBagSizer* lightingInsideSizer = new wxGridBagSizer();
	lightingInsideSizer->Add(presetDescsUrl, wxGBPosition(0,0), wxGBSpan(1,1),
		wxALIGN_CENTER_HORIZONTAL|wxBOTTOM, RADIOBUTTON_SPACING);
	lightingInsideSizer->Add(customFlagsCopyButton, wxGBPosition(1,0), wxGBSpan(1,1),
		wxALIGN_CENTER_HORIZONTAL|wxBOTTOM, RADIOBUTTON_SPACING + 5);
	lightingInsideSizer->Add(radioButton1, wxGBPosition(2,0), wxGBSpan(1,1), wxBOTTOM, RADIOBUTTON_SPACING);
	lightingInsideSizer->Add(radioButton2, wxGBPosition(3,0), wxGBSpan(1,1), wxEXPAND|wxBOTTOM, RADIOBUTTON_SPACING);
	lightingInsideSizer->Add(radioButton3, wxGBPosition(4,0), wxGBSpan(1,1), wxBOTTOM, RADIOBUTTON_SPACING);
	lightingInsideSizer->Add(radioButton4, wxGBPosition(5,0), wxGBSpan(1,1), wxBOTTOM, RADIOBUTTON_SPACING);
	lightingInsideSizer->Add(radioButton5, wxGBPosition(6,0), wxGBSpan(1,1), wxBOTTOM, RADIOBUTTON_SPACING);
	lightingInsideSizer->Add(radioButton6, wxGBPosition(7,0), wxGBSpan(1,1), wxBOTTOM, RADIOBUTTON_SPACING);
	lightingInsideSizer->Add(radioButton7, wxGBPosition(8,0), wxGBSpan(1,1), wxBOTTOM, RADIOBUTTON_SPACING);
	lightingInsideSizer->Add(radioButton8, wxGBPosition(9,0), wxGBSpan(1,1), wxBOTTOM, RADIOBUTTON_SPACING);
	lightingInsideSizer->Add(radioButton9, wxGBPosition(10,0), wxGBSpan(1,1));

	wxStaticBoxSizer* lightingPresetsSizer = new wxStaticBoxSizer(lightingPresetsBox, wxHORIZONTAL);
	lightingPresetsSizer->Add(lightingInsideSizer, wxSizerFlags().Expand().Border(wxALL, 5));
	
	this->SetSizer(lightingPresetsSizer);
}
Example #29
0
/* TextureXPanel::TextureXPanel
 * TextureXPanel class constructor
 *******************************************************************/
TextureXPanel::TextureXPanel(wxWindow* parent, TextureXEditor* tx_editor) : wxPanel(parent, -1)
{
	// Init variables
	this->tx_entry = NULL;
	this->tx_editor = tx_editor;
	this->tex_current = NULL;
	this->modified = false;
	undo_manager = tx_editor->getUndoManager();

	// Setup sizer
	wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
	SetSizer(sizer);

	// Add textures list
	wxStaticBox* frame = new wxStaticBox(this, -1, "Textures");
	wxStaticBoxSizer* framesizer = new wxStaticBoxSizer(frame, wxVERTICAL);
	wxBoxSizer* hbox = new wxBoxSizer(wxHORIZONTAL);
	label_tx_format = new wxStaticText(this, -1, "Format:");
	hbox->Add(label_tx_format, 0, wxALIGN_BOTTOM|wxRIGHT, 4);
	btn_save = new wxBitmapButton(this, -1, Icons::getIcon(Icons::GENERAL, "save"));
	btn_save->SetToolTip("Save");
	hbox->AddStretchSpacer();
	hbox->Add(btn_save, 0, wxEXPAND);
	framesizer->Add(hbox, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);
	list_textures = new TextureXListView(this, &texturex);
	framesizer->Add(list_textures, 1, wxEXPAND|wxALL, 4);
	sizer->Add(framesizer, 0, wxEXPAND|wxALL, 4);

	// Add texture operations buttons
	wxGridBagSizer* gbsizer = new wxGridBagSizer(4, 4);
	framesizer->Add(gbsizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);
	btn_move_up = new wxBitmapButton(this, -1, Icons::getIcon(Icons::GENERAL, "up"));
	btn_move_up->SetToolTip("Move Up");
	btn_move_down = new wxBitmapButton(this, -1, Icons::getIcon(Icons::GENERAL, "down"));
	btn_move_down->SetToolTip("Move Down");
	btn_new_texture = new wxBitmapButton(this, -1, Icons::getIcon(Icons::GENERAL, "tex_new"));
	btn_new_texture->SetToolTip("New");
	btn_remove_texture = new wxBitmapButton(this, -1, Icons::getIcon(Icons::GENERAL, "tex_delete"));
	btn_remove_texture->SetToolTip("Remove");
	btn_new_from_patch = new wxBitmapButton(this, -1, Icons::getIcon(Icons::GENERAL, "tex_newpatch"));
	btn_new_from_patch->SetToolTip("New from Patch");
	btn_new_from_file = new wxBitmapButton(this, -1, Icons::getIcon(Icons::GENERAL, "tex_newfile"));
	btn_new_from_file->SetToolTip("New from File");
	gbsizer->Add(btn_new_texture, wxGBPosition(0, 0), wxDefaultSpan);
	gbsizer->Add(btn_new_from_patch, wxGBPosition(0, 1), wxDefaultSpan);
	gbsizer->Add(btn_new_from_file, wxGBPosition(0, 2), wxDefaultSpan);
	gbsizer->Add(btn_remove_texture, wxGBPosition(0, 3), wxDefaultSpan);
	gbsizer->Add(btn_move_up, wxGBPosition(0, 4), wxDefaultSpan);
	gbsizer->Add(btn_move_down, wxGBPosition(0, 5), wxDefaultSpan);

	// Bind events
	list_textures->Bind(wxEVT_LIST_ITEM_SELECTED, &TextureXPanel::onTextureListSelect, this);
	list_textures->Bind(wxEVT_LIST_ITEM_RIGHT_CLICK, &TextureXPanel::onTextureListRightClick, this);
	list_textures->Bind(wxEVT_KEY_DOWN, &TextureXPanel::onTextureListKeyDown, this);
	btn_new_texture->Bind(wxEVT_BUTTON, &TextureXPanel::onBtnNewTexture, this);
	btn_new_from_patch->Bind(wxEVT_BUTTON, &TextureXPanel::onBtnNewTextureFromPatch, this);
	btn_new_from_file->Bind(wxEVT_BUTTON, &TextureXPanel::onBtnNewTextureFromFile, this);
	btn_remove_texture->Bind(wxEVT_BUTTON, &TextureXPanel::onBtnRemoveTexture, this);
	btn_move_up->Bind(wxEVT_BUTTON, &TextureXPanel::onBtnMoveUp, this);
	btn_move_down->Bind(wxEVT_BUTTON, &TextureXPanel::onBtnMoveDown, this);
	btn_save->Bind(wxEVT_BUTTON, &TextureXPanel::onBtnSave, this);
	Bind(wxEVT_SHOW, &TextureXPanel::onShow, this);
}
CDummyRepeaterFrame::CDummyRepeaterFrame(const wxString& title, const wxPoint& position) :
wxFrame(NULL, -1, title, position),
m_your(NULL),
m_rpt1(NULL),
m_rpt2(NULL),
m_transmit(NULL),
m_status(NULL),
m_hrdYour(NULL),
m_hrdMy(NULL),
m_hrdRpt1(NULL),
m_hrdRpt2(NULL),
m_hrdFlags(NULL),
m_hrdMessage(NULL),
m_slowData(NULL),
m_status1(NULL),
m_status2(NULL),
m_status3(NULL),
m_status4(NULL),
m_status5(NULL),
m_heard(NULL),
m_timer(this),
m_timeout(0U)
{
	SetMenuBar(createMenuBar());

	wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);

	wxPanel* panel = new wxPanel(this);

	wxGridBagSizer* panelSizer = new wxGridBagSizer();

	wxStaticText* yourLabel = new wxStaticText(panel, -1, wxT("UR"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	panelSizer->Add(yourLabel, wxGBPosition(0, 0), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxString call;
	wxSortedArrayString list;

	::wxGetApp().getYourCalls(call, list);
	m_your = new wxComboBox(panel, Combo_Your, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1), 0, NULL, wxTE_PROCESS_ENTER);
	m_your->Append(CQCQCQ);
	m_your->Append(list);
	if (call.IsEmpty())
		m_your->SetSelection(0);
	else
		m_your->SetValue(call);
	panelSizer->Add(m_your, wxGBPosition(0, 1), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticText* rpt1Label = new wxStaticText(panel, -1, wxT("RPT1"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	panelSizer->Add(rpt1Label, wxGBPosition(0, 2), wxDefaultSpan, wxALL, BORDER_SIZE);

	::wxGetApp().getRpt1Calls(call, list);
	m_rpt1 = new wxComboBox(panel, Combo_Rpt1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1), 0, NULL, wxTE_PROCESS_ENTER);
	m_rpt1->Append(UNUSED);
	m_rpt1->Append(list);
	if (call.IsEmpty())
		m_rpt1->SetSelection(0);
	else
		m_rpt1->SetValue(call);
	panelSizer->Add(m_rpt1, wxGBPosition(0, 3), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticText* rpt2Label = new wxStaticText(panel, -1, wxT("RPT2"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	panelSizer->Add(rpt2Label, wxGBPosition(0, 4), wxDefaultSpan, wxALL, BORDER_SIZE);

	::wxGetApp().getRpt2Calls(call, list);
	m_rpt2 = new wxComboBox(panel, Combo_Rpt2, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1), 0, NULL, wxTE_PROCESS_ENTER);
	m_rpt2->Append(UNUSED);
	m_rpt2->Append(list);
	if (call.IsEmpty())
		m_rpt2->SetSelection(0);
	else
		m_rpt2->SetValue(call);
	panelSizer->Add(m_rpt2, wxGBPosition(0, 5), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_transmit = new wxToggleButton(panel, Button_Transmit, _("Transmit"), wxDefaultPosition, wxSize(CONTROL_WIDTH * 2, -1));
	panelSizer->Add(m_transmit, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL, BORDER_SIZE);

	m_status = new wxStaticText(panel, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
	panelSizer->Add(m_status, wxGBPosition(1, 3), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxButton* button = new wxButton(panel, Button_OneTouchReply, _("One-Touch Reply"), wxDefaultPosition, wxSize(CONTROL_WIDTH, -1));
	panelSizer->Add(button, wxGBPosition(1, 5), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticBoxSizer* info1Sizer = new wxStaticBoxSizer(new wxStaticBox(panel, -1, _("Current")), wxVERTICAL);

	wxGridBagSizer* info2Sizer = new wxGridBagSizer(BORDER_SIZE, BORDER_SIZE);

	wxStaticText* hrdYourLabel = new wxStaticText(panel, -1, _("Your:"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	info2Sizer->Add(hrdYourLabel, wxGBPosition(0, 0), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_hrdYour = new wxStaticText(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1));
	info2Sizer->Add(m_hrdYour, wxGBPosition(0, 1), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticText* hrdRpt1Label = new wxStaticText(panel, -1, _("RPT1:"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	info2Sizer->Add(hrdRpt1Label, wxGBPosition(0, 2), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_hrdRpt1 = new wxStaticText(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1));
	info2Sizer->Add(m_hrdRpt1, wxGBPosition(0, 3), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticText* hrdRpt2Label = new wxStaticText(panel, -1, _("RPT2:"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	info2Sizer->Add(hrdRpt2Label, wxGBPosition(0, 4), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_hrdRpt2 = new wxStaticText(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1));
	info2Sizer->Add(m_hrdRpt2, wxGBPosition(0, 5), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticText* hrdMyLabel = new wxStaticText(panel, -1, _("My:"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	info2Sizer->Add(hrdMyLabel, wxGBPosition(1, 0), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_hrdMy = new wxStaticText(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1));
	info2Sizer->Add(m_hrdMy, wxGBPosition(1, 1), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticText* hrdFlagsLabel = new wxStaticText(panel, -1, _("Flags:"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	info2Sizer->Add(hrdFlagsLabel, wxGBPosition(1, 2), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_hrdFlags = new wxStaticText(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(LABEL_WIDTH * 3U, -1));
	info2Sizer->Add(m_hrdFlags, wxGBPosition(1, 3), wxGBSpan(1, 3), wxALL, BORDER_SIZE);

	wxStaticText* hrdMessageLabel = new wxStaticText(panel, -1, _("Message:"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	info2Sizer->Add(hrdMessageLabel, wxGBPosition(2, 0), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_hrdMessage = new wxStaticText(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(LABEL_WIDTH * 3U, -1));
	info2Sizer->Add(m_hrdMessage, wxGBPosition(2, 1), wxGBSpan(1, 3), wxALL, BORDER_SIZE);

	info1Sizer->Add(info2Sizer);

	panelSizer->Add(info1Sizer, wxGBPosition(2, 0), wxGBSpan(5, 6), wxALL | wxEXPAND, BORDER_SIZE);

	wxStaticBoxSizer* slowData1Sizer = new wxStaticBoxSizer(new wxStaticBox(panel, -1, _("Status")), wxVERTICAL);

	wxGridBagSizer* slowData2Sizer = new wxGridBagSizer(BORDER_SIZE, BORDER_SIZE);

	wxStaticText* slowDataLabel = new wxStaticText(panel, -1, _("Message:"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	slowData2Sizer->Add(slowDataLabel, wxGBPosition(0, 0), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_slowData = new wxStaticText(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1));
	slowData2Sizer->Add(m_slowData, wxGBPosition(0, 1), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticText* status1Label = new wxStaticText(panel, -1, _("Status 1:"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	slowData2Sizer->Add(status1Label, wxGBPosition(0, 2), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_status1 = new wxStaticText(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1));
	slowData2Sizer->Add(m_status1, wxGBPosition(0, 3), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticText* status2Label = new wxStaticText(panel, -1, _("Status 2:"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	slowData2Sizer->Add(status2Label, wxGBPosition(0, 4), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_status2 = new wxStaticText(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1));
	slowData2Sizer->Add(m_status2, wxGBPosition(0, 5), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticText* status3Label = new wxStaticText(panel, -1, _("Status 3:"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	slowData2Sizer->Add(status3Label, wxGBPosition(1, 0), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_status3 = new wxStaticText(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1));
	slowData2Sizer->Add(m_status3, wxGBPosition(1, 1), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticText* status4Label = new wxStaticText(panel, -1, _("Status 4:"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	slowData2Sizer->Add(status4Label, wxGBPosition(1, 2), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_status4 = new wxStaticText(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1));
	slowData2Sizer->Add(m_status4, wxGBPosition(1, 3), wxDefaultSpan, wxALL, BORDER_SIZE);

	wxStaticText* status5Label = new wxStaticText(panel, -1, _("Status 5:"), wxDefaultPosition, wxSize(LABEL_WIDTH, -1), wxALIGN_RIGHT);
	slowData2Sizer->Add(status5Label, wxGBPosition(1, 4), wxDefaultSpan, wxALL, BORDER_SIZE);

	m_status5 = new wxStaticText(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1));
	slowData2Sizer->Add(m_status5, wxGBPosition(1, 5), wxDefaultSpan, wxALL, BORDER_SIZE);

	slowData1Sizer->Add(slowData2Sizer);

	panelSizer->Add(slowData1Sizer, wxGBPosition(7, 0), wxGBSpan(2, 6), wxALL | wxEXPAND, BORDER_SIZE);

	m_heard = new wxListCtrl(panel, -1, wxDefaultPosition, wxSize(HEARD_WIDTH, HEARD_HEIGHT), wxLC_REPORT | wxLC_SINGLE_SEL);
	m_heard->InsertColumn(0L, _("Date/Time"));
	m_heard->SetColumnWidth(0L, DATETIME_WIDTH);
	m_heard->InsertColumn(1L, _("Your"));
	m_heard->SetColumnWidth(1L, CALLSIGN_WIDTH);
	m_heard->InsertColumn(2L, _("My"));
	m_heard->SetColumnWidth(2L, MYCALLSIGN_WIDTH);
	m_heard->InsertColumn(3L, _("RPT1"));
	m_heard->SetColumnWidth(3L, CALLSIGN_WIDTH);
	m_heard->InsertColumn(4L, _("RPT2"));
	m_heard->SetColumnWidth(4L, CALLSIGN_WIDTH);
	m_heard->InsertColumn(5L, _("Message"));
	m_heard->SetColumnWidth(5L, MESSAGE_WIDTH);
	panelSizer->Add(m_heard, wxGBPosition(9, 0), wxGBSpan(11, 6), wxALL | wxEXPAND, BORDER_SIZE);

	panel->SetSizer(panelSizer);
	panelSizer->SetSizeHints(panel);

	mainSizer->Add(panel);

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

	::wxGetApp().getTimeout(m_timeout);
}