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 }
void SliderTestCase::Value() { m_slider->SetValue(30); CPPUNIT_ASSERT_EQUAL(30, m_slider->GetValue()); //When setting a value larger that max or smaller than min //max and min are set m_slider->SetValue(-1); CPPUNIT_ASSERT_EQUAL(0, m_slider->GetValue()); m_slider->SetValue(110); CPPUNIT_ASSERT_EQUAL(100, m_slider->GetValue()); }
void MyFrame::OnChoice(wxCommandEvent& event) { int sel = event.GetSelection(); wxTaskBarButtonState state; switch(sel) { case 0: state = wxTASKBAR_BUTTON_NO_PROGRESS; break; case 1: state = wxTASKBAR_BUTTON_INDETERMINATE; break; case 2: state = wxTASKBAR_BUTTON_NORMAL; break; case 3: state = wxTASKBAR_BUTTON_ERROR; break; case 4: state = wxTASKBAR_BUTTON_PAUSED; break; default: state = wxTASKBAR_BUTTON_NO_PROGRESS; break; } MSWGetTaskBarButton()->SetProgressValue(m_slider->GetValue()); MSWGetTaskBarButton()->SetProgressState(state); }
void SjViewSettingsPage::GetFontFromDialog(wxString& fontFace, long& fontSize, long& columnWidth, long& coverHeight) { long i = m_fontFaceChoice->GetSelection(); if( i >= 0 ) { fontFace = m_fontFaceChoice->GetString(i); } else { fontFace = g_mainFrame->GetBaseFontFace(); } fontSize = m_fontPtSlider->GetValue(); columnWidth = m_columnWidthSlider->GetValue() * COLUMNWIDTH_DIVISOR; coverHeight = m_coverHeightSlider->GetValue(); }
void MyFrame::OnSetProgressValue(wxScrollEvent& WXUNUSED(event)) { static bool s_hasRangeSet = false; if ( !s_hasRangeSet ) { MSWGetTaskBarButton()->SetProgressRange(100); s_hasRangeSet = true; } MSWGetTaskBarButton()->SetProgressValue(m_slider->GetValue()); }
void SliderTestCase::Range() { CPPUNIT_ASSERT_EQUAL(0, m_slider->GetMin()); CPPUNIT_ASSERT_EQUAL(100, m_slider->GetMax()); // Changing range shouldn't change the value. m_slider->SetValue(17); m_slider->SetRange(0, 200); CPPUNIT_ASSERT_EQUAL(17, m_slider->GetValue()); //Test negative ranges m_slider->SetRange(-50, 0); CPPUNIT_ASSERT_EQUAL(-50, m_slider->GetMin()); CPPUNIT_ASSERT_EQUAL(0, m_slider->GetMax()); }
float getLum() { return (float)slider_lum->GetValue()*0.01f; }
float getSat() { return (float)slider_sat->GetValue()*0.01f; }
float getHue() { return (float)slider_hue->GetValue()*0.002f; }
float getAmount() { return (float)slider_amount->GetValue()*0.01f; }
void SjViewSettingsPage::UpdateColumnWidthText() { long v = m_columnWidthSlider->GetValue() * COLUMNWIDTH_DIVISOR; m_columnWidthText->SetLabel(wxString::Format(wxT("%i"), (int)v)); }
void MainWindow::OnVolumeChanged(wxCommandEvent& event) { libvlc_audio_set_volume(media_player, volume_slider->GetValue()); }
void onSlide(wxCommandEvent& event) { syncControls(slider_control->GetValue()); }
void SjViewSettingsPage::UpdateCoverHeightText() { long v = m_coverHeightSlider->GetValue(); m_coverHeightText->SetLabel(wxString::Format(wxT("%i%%"), (int)v)); }
void onSatChanged(wxCommandEvent& e) { redraw(); label_sat->SetLabel(S_FMT("%d%%", slider_sat->GetValue())); }
void onLumChanged(wxCommandEvent& e) { redraw(); label_lum->SetLabel(S_FMT("%d%%", slider_lum->GetValue())); }
void SjViewSettingsPage::UpdateFontPtText(bool addSpaces) { long v = m_fontPtSlider->GetValue(); m_fontPtText->SetLabel(wxString::Format(wxT("%i Pt%s"), (int)v, addSpaces? wxT(" ") : wxT(""))); }