• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ wxSlider类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中wxSlider的典型用法代码示例。如果您正苦于以下问题:C++ wxSlider类的具体用法?C++ wxSlider怎么用?C++ wxSlider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了wxSlider类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ArgsSpeedControl

	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());
	}
开发者ID:jonrimmer,项目名称:SLADE,代码行数:22,代码来源:ActionSpecialDialog.cpp


示例2: PaletteTintDialog

	PaletteTintDialog(wxWindow* parent, Palette8bit* pal)
		: wxDialog(parent, -1, "Tint", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
	{
		// Init variables
		this->palette = pal;

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

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

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

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

		// Add 'amount' slider
		hbox = new wxBoxSizer(wxHORIZONTAL);
		sizer->Add(hbox, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);

		slider_amount = new wxSlider(this, -1, 50, 0, 100);
		label_amount = new wxStaticText(this, -1, "100%");
		hbox->Add(new wxStaticText(this, -1, "Amount:"), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
		hbox->Add(slider_amount, 1, wxEXPAND|wxRIGHT, 4);
		hbox->Add(label_amount, 0, wxALIGN_CENTER_VERTICAL);

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

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

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

		// Init layout
		Layout();

		// Bind events
		cp_colour->Bind(wxEVT_COLOURPICKER_CHANGED, &PaletteTintDialog::onColourChanged, this);
		slider_amount->Bind(wxEVT_SLIDER, &PaletteTintDialog::onAmountChanged, this);
		pal_preview->Bind(wxEVT_LEFT_UP, &PaletteTintDialog::onPaletteLeftUp, this);

		// Setup dialog size
		SetInitialSize(wxSize(-1, -1));
		SetMinSize(GetSize());
		CenterOnParent();

		// Set values
		label_amount->SetLabel("50% ");
	}
开发者ID:Blue-Shadow,项目名称:SLADE,代码行数:63,代码来源:PaletteEntryPanel.cpp


示例3: PaletteColourTweakDialog

	PaletteColourTweakDialog(wxWindow* parent, Palette8bit* pal)
		: wxDialog(parent, -1, "Tweak Colours", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
	{
		// Init variables
		this->palette = pal;

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

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

		// Add 'hue shift' slider
		hbox = new wxBoxSizer(wxHORIZONTAL);
		sizer->Add(hbox, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);

		slider_hue = new wxSlider(this, -1, 0, 0, 500);
		label_hue = new wxStaticText(this, -1, "0.000");
		hbox->Add(new wxStaticText(this, -1, "Hue Shift:"), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
		hbox->Add(slider_hue, 1, wxEXPAND|wxRIGHT, 4);
		hbox->Add(label_hue, 0, wxALIGN_CENTER_VERTICAL);

		// Add 'Saturation' slider
		hbox = new wxBoxSizer(wxHORIZONTAL);
		sizer->Add(hbox, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);

		slider_sat = new wxSlider(this, -1, 100, 0, 200);
		label_sat = new wxStaticText(this, -1, "100%");
		hbox->Add(new wxStaticText(this, -1, "Saturation:"), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
		hbox->Add(slider_sat, 1, wxEXPAND|wxRIGHT, 4);
		hbox->Add(label_sat, 0, wxALIGN_CENTER_VERTICAL);

		// Add 'Luminosity' slider
		hbox = new wxBoxSizer(wxHORIZONTAL);
		sizer->Add(hbox, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4);

		slider_lum = new wxSlider(this, -1, 100, 0, 200);
		label_lum = new wxStaticText(this, -1, "100%");
		hbox->Add(new wxStaticText(this, -1, "Luminosity:"), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
		hbox->Add(slider_lum, 1, wxEXPAND|wxRIGHT, 4);
		hbox->Add(label_lum, 0, wxALIGN_CENTER_VERTICAL);

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

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

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

		// Init layout
		Layout();

		// Bind events
		slider_hue->Bind(wxEVT_SLIDER, &PaletteColourTweakDialog::onHueChanged, this);
		slider_sat->Bind(wxEVT_SLIDER, &PaletteColourTweakDialog::onSatChanged, this);
		slider_lum->Bind(wxEVT_SLIDER, &PaletteColourTweakDialog::onLumChanged, this);
		pal_preview->Bind(wxEVT_LEFT_UP, &PaletteColourTweakDialog::onPaletteLeftUp, this);

		// Setup dialog size
		SetInitialSize(wxSize(-1, -1));
		SetMinSize(GetSize());
		CenterOnParent();

		// Set values
		label_hue->SetLabel("0.000 ");
		label_sat->SetLabel("100% ");
		label_lum->SetLabel("100% ");
	}
开发者ID:Blue-Shadow,项目名称:SLADE,代码行数:80,代码来源:PaletteEntryPanel.cpp


示例4: stop

void MainWindow::stop() {
    pause();
    libvlc_media_player_stop(media_player);
    stop_button->Enable(false);
    setTimeline(0.0);
    timeline->Enable(false);
}
开发者ID:371816210,项目名称:vlc_vlc,代码行数:7,代码来源:wx_player.cpp


示例5: setTimeline

void MainWindow::setTimeline(float value) {
    if(value < 0.0) value = 0.0;
    if(value > 1.0) value = 1.0;
    Disconnect(myID_TIMELINE);
    timeline->SetValue((int) (value * TIMELINE_MAX));
    connectTimeline();
}
开发者ID:371816210,项目名称:vlc_vlc,代码行数:7,代码来源:wx_player.cpp


示例6: OnChoice

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);
}
开发者ID:jfiguinha,项目名称:Regards,代码行数:29,代码来源:taskbarbutton.cpp


示例7: GetFontFromDialog

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();
}
开发者ID:conradstorz,项目名称:silverjuke,代码行数:16,代码来源:viewsettings.cpp


示例8: play

void MainWindow::play() {
    libvlc_media_player_play(media_player);
    playpause_button->SetLabel(wxT("Pause"));
    playpause_button->Enable(true);
    stop_button->Enable(true);
    timeline->Enable(true);
}
开发者ID:371816210,项目名称:vlc_vlc,代码行数:7,代码来源:wx_player.cpp


示例9: LinePageSize

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
}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:26,代码来源:slidertest.cpp


示例10: OnFontDefault

void SjViewSettingsPage::OnFontDefault(wxCommandEvent&)
{
	// use default values
	long i = m_fontFaceChoice->FindString(SJ_DEF_FONT_FACE);
	if( i == -1 ) i = 0;
	m_fontFaceChoice->SetSelection(i);

	m_fontPtSlider->SetValue(SJ_DEF_FONT_SIZE);
	UpdateFontPtText();
	m_columnWidthSlider->SetValue(SJ_DEF_COLUMN_WIDTH / COLUMNWIDTH_DIVISOR);
	UpdateColumnWidthText();
	m_coverHeightSlider->SetValue(SJ_DEF_COVER_HEIGHT);
	UpdateCoverHeightText();

	m_useViewFontInDlgCheckBox->SetValue(false);

	g_mainFrame->SetFontNCoverBase(SJ_DEF_FONT_FACE, SJ_DEF_FONT_SIZE, SJ_DEF_COLUMN_WIDTH, SJ_DEF_COVER_HEIGHT);
}
开发者ID:conradstorz,项目名称:silverjuke,代码行数:18,代码来源:viewsettings.cpp


示例11: OnSetProgressValue

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());
}
开发者ID:jfiguinha,项目名称:Regards,代码行数:11,代码来源:taskbarbutton.cpp


示例12: syncControls

	void syncControls(int value)
	{
		ArgsTextControl::setArgValue(value);

		if (value < 0)
		{
			slider_control->SetValue(0);
			speed_label->SetLabel("");
		}
		else
		{
			slider_control->SetValue(value);
			speed_label->SetLabel(S_FMT(
				"%s (%.1f units per tic, %.1f units per sec)",
				arg_t::speedLabel(value), value / 8.0,
				// A tic is 28ms, slightly less than 1/35 of a second
				value / 8.0 * 1000.0 / 28.0
			));
		}
	}
开发者ID:jonrimmer,项目名称:SLADE,代码行数:20,代码来源:ActionSpecialDialog.cpp


示例13: Thumb

void SliderTestCase::Thumb()
{
#if wxUSE_UIACTIONSIMULATOR && !defined(__WXGTK__)
    EventCounter track(m_slider, wxEVT_SCROLL_THUMBTRACK);
    EventCounter release(m_slider, wxEVT_SCROLL_THUMBRELEASE);
    EventCounter changed(m_slider, wxEVT_SCROLL_CHANGED);

    wxUIActionSimulator sim;

    m_slider->SetValue(0);

    sim.MouseDragDrop(m_slider->ClientToScreen(wxPoint(10, 10)),m_slider->ClientToScreen(wxPoint(50, 10)));
    wxYield();

    CPPUNIT_ASSERT(track.GetCount() != 0);
    CPPUNIT_ASSERT_EQUAL(1, release.GetCount());
#ifdef __WXMSW__
    CPPUNIT_ASSERT_EQUAL(1, changed.GetCount());
#endif
#endif
}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:21,代码来源:slidertest.cpp


示例14: Range

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());
}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:16,代码来源:slidertest.cpp


示例15: PageUpDown

void SliderTestCase::PageUpDown()
{
#if wxUSE_UIACTIONSIMULATOR
    EventCounter pageup(m_slider, wxEVT_SCROLL_PAGEUP);
    EventCounter pagedown(m_slider, wxEVT_SCROLL_PAGEDOWN);

    wxUIActionSimulator sim;

    m_slider->SetFocus();

    sim.Char(WXK_PAGEUP);
    sim.Char(WXK_PAGEDOWN);

    wxYield();

    CPPUNIT_ASSERT_EQUAL(1, pageup.GetCount());
    CPPUNIT_ASSERT_EQUAL(1, pagedown.GetCount());
#endif
}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:19,代码来源:slidertest.cpp


示例16: Value

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());
}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:16,代码来源:slidertest.cpp


示例17: OnVolumeChanged

void MainWindow::OnVolumeChanged(wxCommandEvent& event) {
    libvlc_audio_set_volume(media_player, volume_slider->GetValue());
}
开发者ID:371816210,项目名称:vlc_vlc,代码行数:3,代码来源:wx_player.cpp


示例18: onSlide

	void onSlide(wxCommandEvent& event)
	{
		syncControls(slider_control->GetValue());
	}
开发者ID:jonrimmer,项目名称:SLADE,代码行数:4,代码来源:ActionSpecialDialog.cpp


示例19: getSat

	float getSat()
	{
		return (float)slider_sat->GetValue()*0.01f;
	}
开发者ID:Blue-Shadow,项目名称:SLADE,代码行数:4,代码来源:PaletteEntryPanel.cpp


示例20: getAmount

	float getAmount()
	{
		return (float)slider_amount->GetValue()*0.01f;
	}
开发者ID:Blue-Shadow,项目名称:SLADE,代码行数:4,代码来源:PaletteEntryPanel.cpp



注:本文中的wxSlider类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ wxSocketEvent类代码示例发布时间:2022-05-31
下一篇:
C++ wxSizeEvent类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap