Exemple #1
0
void SliderTestCase::LinePageSize()
{
#if wxUSE_UIACTIONSIMULATOR
    wxUIActionSimulator sim;
    wxYield();
    m_slider->SetFocus();

    m_slider->SetPageSize(20);

    sim.Char(WXK_PAGEUP);

    wxYield();

    CPPUNIT_ASSERT_EQUAL(20, m_slider->GetPageSize());
    CPPUNIT_ASSERT_EQUAL(30, m_slider->GetValue());

    m_slider->SetLineSize(2);

    sim.Char(WXK_UP);

    wxYield();

    CPPUNIT_ASSERT_EQUAL(2, m_slider->GetLineSize());
    CPPUNIT_ASSERT_EQUAL(28, m_slider->GetValue());
#endif
}
	ArgsSpeedControl(wxWindow* parent) : ArgsTextControl(parent)
	{
		wxBoxSizer* row = new wxBoxSizer(wxHORIZONTAL);

		GetSizer()->Detach(text_control);
		row->Add(text_control, wxSizerFlags(1).Expand());
		speed_label = new wxStaticText(this, -1, "");
		row->AddSpacer(4);
		row->Add(speed_label, wxSizerFlags(4).Align(wxALIGN_CENTER_VERTICAL));
		GetSizer()->Add(row, wxSizerFlags(1).Expand());

		slider_control = new wxSlider(this, -1, 0, 0, 255);
		slider_control->SetLineSize(2);
		slider_control->SetPageSize(8);
		// These are the generalized Boom speeds
		slider_control->SetTick(8);
		slider_control->SetTick(16);
		slider_control->SetTick(32);
		slider_control->SetTick(64);
		slider_control->Bind(wxEVT_SLIDER, &ArgsSpeedControl::onSlide, this);
		GetSizer()->Add(slider_control, wxSizerFlags(1).Expand());
	}