本文整理汇总了C++中wxScrollEvent类的典型用法代码示例。如果您正苦于以下问题:C++ wxScrollEvent类的具体用法?C++ wxScrollEvent怎么用?C++ wxScrollEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了wxScrollEvent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: OnViewSliderChanged
void GeneralPreferencePane::OnViewSliderChanged(wxScrollEvent& event) {
wxSlider* sender = static_cast<wxSlider*>(event.GetEventObject());
int value = sender->GetValue();
Preferences::PreferenceManager& prefs = Preferences::PreferenceManager::preferences();
switch (event.GetId()) {
case CommandIds::GeneralPreferencePane::BrightnessSliderId: {
prefs.setFloat(Preferences::RendererBrightness, value / 40.0f);
Controller::PreferenceChangeEvent preferenceChangeEvent(Preferences::RendererBrightness);
static_cast<TrenchBroomApp*>(wxTheApp)->UpdateAllViews(NULL, &preferenceChangeEvent);
break;
}
case CommandIds::GeneralPreferencePane::GridAlphaSliderId: {
int max = sender->GetMax();
float floatValue = static_cast<float>(value) / static_cast<float>(max);
prefs.setFloat(Preferences::GridAlpha, floatValue);
Controller::PreferenceChangeEvent preferenceChangeEvent(Preferences::GridAlpha);
static_cast<TrenchBroomApp*>(wxTheApp)->UpdateAllViews(NULL, &preferenceChangeEvent);
break;
}
default:
break;
}
static_cast<TrenchBroomApp*>(wxTheApp)->UpdateAllViews();
}
开发者ID:ProPuke,项目名称:TrenchBroom,代码行数:29,代码来源:GeneralPreferencePane.cpp
示例2: QtOnScrollBarEvent
// Handle event from scrollbars
void wxWindowQt::QtOnScrollBarEvent( wxScrollEvent& event )
{
wxEventType windowEventType = 0;
// Map the scroll bar event to the corresponding scroll window event:
wxEventType scrollBarEventType = event.GetEventType();
if ( scrollBarEventType == wxEVT_SCROLL_TOP )
windowEventType = wxEVT_SCROLLWIN_TOP;
else if ( scrollBarEventType == wxEVT_SCROLL_BOTTOM )
windowEventType = wxEVT_SCROLLWIN_BOTTOM;
else if ( scrollBarEventType == wxEVT_SCROLL_PAGEUP )
windowEventType = wxEVT_SCROLLWIN_PAGEUP;
else if ( scrollBarEventType == wxEVT_SCROLL_PAGEDOWN )
windowEventType = wxEVT_SCROLLWIN_PAGEDOWN;
else if ( scrollBarEventType == wxEVT_SCROLL_LINEUP )
windowEventType = wxEVT_SCROLLWIN_LINEUP;
else if ( scrollBarEventType == wxEVT_SCROLL_LINEDOWN )
windowEventType = wxEVT_SCROLLWIN_LINEDOWN;
else if ( scrollBarEventType == wxEVT_SCROLL_THUMBTRACK )
windowEventType = wxEVT_SCROLLWIN_THUMBTRACK;
else if ( scrollBarEventType == wxEVT_SCROLL_THUMBRELEASE )
windowEventType = wxEVT_SCROLLWIN_THUMBRELEASE;
if ( windowEventType != 0 )
{
wxScrollWinEvent e( windowEventType, event.GetPosition(), event.GetOrientation() );
ProcessWindowEvent( e );
}
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:31,代码来源:window.cpp
示例3: onVolChange
void TrackStatusHandler::onVolChange(wxScrollEvent& event) {
if (event.GetEventType() == wxEVT_SCROLL_CHANGED) {
if (m_pipeline != NULL) {
m_pipeline->setVolume(event.GetPosition());
}
}
}
开发者ID:krpors,项目名称:navi,代码行数:7,代码来源:main.cpp
示例4: OnScroll
/*----------------------------------------------------------------------
* Class: AmayaScrollBar
* Method: OnScroll
* Description:
-----------------------------------------------------------------------*/
void AmayaScrollBar::OnScroll( wxScrollEvent& event )
{
/* this flag is necessary because 2 events occure when up/down button
is pressed (it's an optimisation)
this hack works because OnLineDown is called before OnScroll,
but becareful the events orders could change in future wxWidgets
releases or can be platform specific
*/
if (m_IgnoreNextScrollEvent)
{
m_IgnoreNextScrollEvent = FALSE;
event.Skip();
return;
}
if (event.GetOrientation() == wxHORIZONTAL)
{
TTALOGDEBUG_3( TTA_LOG_DIALOG, _T("AmayaScrollBar::OnScroll [wxHORIZONTAL][frameid=%d][pos=%d][pagesize=%d]"), m_ParentFrameID, event.GetPosition(), GetPageSize() );
FrameHScrolledCallback( m_ParentFrameID,
event.GetPosition(),
GetPageSize() );
}
else if (event.GetOrientation() == wxVERTICAL)
{
TTALOGDEBUG_3( TTA_LOG_DIALOG, _T("AmayaScrollBar::OnScroll [wxVERTICAL][frameid=%d][pos=%d][pagesize=%d]"), m_ParentFrameID, event.GetPosition(), GetPageSize() );
FrameVScrolledCallback( m_ParentFrameID,
event.GetPosition() );
}
}
开发者ID:ArcScofield,项目名称:Amaya,代码行数:34,代码来源:AmayaScrollBar.cpp
示例5: OnMouseSliderChanged
void GeneralPreferencePane::OnMouseSliderChanged(wxScrollEvent& event) {
wxSlider* sender = static_cast<wxSlider*>(event.GetEventObject());
float value = sender->GetValue() / 100.0f;
Preferences::PreferenceManager& prefs = Preferences::PreferenceManager::preferences();
switch (event.GetId()) {
case CommandIds::GeneralPreferencePane::LookSpeedSliderId: {
prefs.setFloat(Preferences::CameraLookSpeed, value);
Controller::PreferenceChangeEvent preferenceChangeEvent(Preferences::CameraLookSpeed);
static_cast<TrenchBroomApp*>(wxTheApp)->UpdateAllViews(NULL, &preferenceChangeEvent);
break;
}
case CommandIds::GeneralPreferencePane::PanSpeedSliderId: {
prefs.setFloat(Preferences::CameraPanSpeed, value);
Controller::PreferenceChangeEvent preferenceChangeEvent(Preferences::CameraPanSpeed);
static_cast<TrenchBroomApp*>(wxTheApp)->UpdateAllViews(NULL, &preferenceChangeEvent);
break;
}
case CommandIds::GeneralPreferencePane::MoveSpeedSliderId: {
prefs.setFloat(Preferences::CameraMoveSpeed, value);
Controller::PreferenceChangeEvent preferenceChangeEvent(Preferences::CameraMoveSpeed);
static_cast<TrenchBroomApp*>(wxTheApp)->UpdateAllViews(NULL, &preferenceChangeEvent);
break;
}
default:
break;
}
}
开发者ID:ProPuke,项目名称:TrenchBroom,代码行数:32,代码来源:GeneralPreferencePane.cpp
示例6: OnScrollChange
void NumericSlider::OnScrollChange(wxScrollEvent &event)
{
wxCommandEvent evt(wxEVT_COMMAND_SPINCTRL_UPDATED);
evt.SetId(this->GetId());
evt.SetEventObject(this);
mSpinner->SetValue(event.GetInt() + mSpinner->GetMin());
evt.SetInt(event.GetInt() + mSpinner->GetMin());
wxPostEvent(this, evt);
}
开发者ID:Analias,项目名称:LimeSuite,代码行数:9,代码来源:numericSlider.cpp
示例7: OnScrollChanged
void bmImage::OnScrollChanged(wxScrollEvent& event) {
bmImageFrame* p = ((bmImageFrame*)GetParent());
if (event.GetOrientation() == wxHORIZONTAL) {
p->setScroll(cv::Vec2f(event.GetPosition(), p->getScroll()[1]));
}
else if (event.GetOrientation() == wxVERTICAL) {
p->setScroll(cv::Vec2f(p->getScroll()[1], event.GetPosition()));
}
}
开发者ID:GreekFellows,项目名称:bildmanipulering,代码行数:9,代码来源:bmImage.cpp
示例8: OnSlide
void TAdjuster::OnSlide(wxScrollEvent& event)
{
int value = event.GetInt();
TUniform* uniform = sliders[event.GetId()].first;
int component = sliders[event.GetId()].second;
uniform->SetSlider((float) value / MaxSliderValue, component);
uniform->UpdateSlider();
event.Skip();
}
开发者ID:astojilj,项目名称:astoj_oolongengine,代码行数:9,代码来源:Adjuster.cpp
示例9: OnScroll
void AttachableScrollBar::OnScroll(wxScrollEvent & event)
{
if( mpViewInfo == NULL )
{
event.Skip();
return;
}
SetViewInfoFromScrollBar();
event.Skip(); // This is so that the parent control can refresh whatever it needs to...
}
开发者ID:jozsefmezei,项目名称:audacity,代码行数:10,代码来源:AttachableScrollBar.cpp
示例10: OnScroll
void BrushThicknessPanel::OnScroll(wxScrollEvent& event) {
static const int lookup_table[10] = {1,2,3,5,8,13,23,35,50,80};
use_button->SetValue(true);
ASSERT(event.GetPosition() >= 1);
ASSERT(event.GetPosition() <= 10);
//printf("SELECT[%d] = %d\n", event.GetPosition()-1, lookup_table[event.GetPosition()-1]);
gui.ActivatePalette(GetParentPalette());
gui.SetBrushThickness(true, lookup_table[event.GetPosition()-1], 100);
}
开发者ID:edubart,项目名称:rme,代码行数:11,代码来源:palette_common.cpp
示例11: wxT
// -------------------------------------------------------------------------------- //
void guEq10Band::OnUpdateLabel( wxScrollEvent &event )
{
wxSlider * Band = ( wxSlider * ) event.GetEventObject();
if( Band )
{
long BandIndex;
Band->GetLabel().ToLong( &BandIndex );
m_Values[ BandIndex ]->SetLabel( wxString::Format( wxT( "%.1f" ), double( event.GetPosition() ) / 10.0 ) );
m_Values[ BandIndex ]->GetContainingSizer()->Layout();
}
}
开发者ID:Hreinnjons,项目名称:guayadeque,代码行数:13,代码来源:Equalizer.cpp
示例12: OnSlider
void ModelControl::OnSlider(wxScrollEvent &event)
{
if (!init || !model)
return;
int id = event.GetId();
if (id == ID_MODEL_ALPHA) {
model->alpha = event.GetInt() / 100.0f;
} else if (id == ID_MODEL_SCALE) {
att->scale = event.GetInt() / 100.0f;
txtsize->SetValue(wxString::Format(wxT("%.2f"), att->scale));
}
}
开发者ID:3dseals,项目名称:wowmodelviewer,代码行数:13,代码来源:modelcontrol.cpp
示例13: OnSliderUpdate
void EffectPanel::OnSliderUpdate( wxScrollEvent& event ) {
int val = event.GetSelection();
switch (event.GetId()) {
case DEPTH_SLIDER:
if (depthChange != 0) {
depthChange->undo();
delete depthChange;
depthChange = 0;
}
depthChange = new ChangeEffectDepth(effect->inst, effect->timeline, effect->type, val);
break;
}
SharedManagerBase::share();
}
开发者ID:sanyaade-g2g-repos,项目名称:nuzynth,代码行数:14,代码来源:EffectPanel.cpp
示例14: OnScroll
// Explicitly call default scroll behaviour
void wxMDIClientWindow::OnScroll(wxScrollEvent& event)
{
// Note: for client windows, the scroll position is not set in
// WM_HSCROLL, WM_VSCROLL, so we can't easily determine what
// scroll position we're at.
// This makes it hard to paint patterns or bitmaps in the background,
// and have the client area scrollable as well.
if ( event.GetOrientation() == wxHORIZONTAL )
m_scrollX = event.GetPosition(); // Always returns zero!
else
m_scrollY = event.GetPosition(); // Always returns zero!
event.Skip();
}
开发者ID:HackLinux,项目名称:chandler-1,代码行数:16,代码来源:mdi.cpp
示例15: OnNormvolSlider
void ExtraPanel::OnNormvolSlider( wxScrollEvent &event )
{
aout_instance_t *p_aout= (aout_instance_t *)vlc_object_find(p_intf,
VLC_OBJECT_AOUT, FIND_ANYWHERE);
if( p_aout != NULL )
{
var_SetFloat( p_aout, "norm-max-level", (float)event.GetPosition()/10 );
vlc_object_release( p_aout );
}
else
{
config_PutFloat( p_intf, "norm-max-level",
(float)event.GetPosition()/10 );
}
}
开发者ID:forthyen,项目名称:SDesk,代码行数:15,代码来源:extrapanel.cpp
示例16: onPosChange
void TrackStatusHandler::onPosChange(wxScrollEvent& event) {
// only allow scrolling if not a stream.
if (m_pipelineType == PIPELINE_STREAM) {
return;
}
// else, allow position seeking.
m_scrolling = true;
if (event.GetEventType() == wxEVT_SCROLL_CHANGED) {
if (m_pipeline != NULL) {
m_pipeline->seekSeconds(event.GetPosition());
m_scrolling = false;
}
}
}
开发者ID:krpors,项目名称:navi,代码行数:15,代码来源:main.cpp
示例17: double
//2d influence
void BrushToolDlg::OnBrush2dinflChange(wxScrollEvent &event)
{
int ival = event.GetPosition();
double val = double(ival)/100.0;
wxString str = wxString::Format("%.2f", val);
m_brush_2dinfl_text->SetValue(str);
}
开发者ID:jefferis,项目名称:fluorender,代码行数:8,代码来源:BrushToolDlg.cpp
示例18: OnSpeedChange
void MiscControlPage::OnSpeedChange(wxScrollEvent& event)
{
auto speedText = wxString::Format(wxT("%d"), event.GetInt());
m_speedIndicator->SetValue(speedText);
m_controller.WriteCommand(wxT("set speed ") + speedText);
m_controller.WriteCommand(wxT("set throttle on"));
}
开发者ID:openMSX,项目名称:wxcatapult,代码行数:7,代码来源:MiscControlPage.cpp
示例19: EvtSlidersChg
void Panel_Remaps::EvtSlidersChg( wxScrollEvent& event )
{
// Get the slider id
wxSlider *sender = (wxSlider*) event.GetEventObject();
if( sender == NULL )
return;
int val = sender->GetValue();
switch( sender->GetId())
{
case ID_HUE_CTRL :
paletteCtrl->Set_Hue( val );
break;
case ID_SAT_CTRL :
paletteCtrl->Set_Sat( val );
break;
case ID_LUM_CTRL :
paletteCtrl->Set_Luz( val );
break;
case ID_RED_CTRL :
paletteCtrl->Set_Red( val );
break;
case ID_GREEN_CTRL :
paletteCtrl->Set_Green( val );
break;
case ID_BLUE_CTRL :
paletteCtrl->Set_Blue( val );
break;
default:
return;
}
frameView->UpdateFrames();
}
开发者ID:OpenBOR,项目名称:obeditor,代码行数:35,代码来源:entity__panel_remaps.cpp
示例20: OnScroll
/////////////
// On scroll
void BaseGrid::OnScroll(wxScrollEvent &event) {
int newPos = event.GetPosition();
if (yPos != newPos) {
yPos = newPos;
Refresh(false);
}
}
开发者ID:BackupTheBerlios,项目名称:aegisub-svn,代码行数:9,代码来源:base_grid.cpp
注:本文中的wxScrollEvent类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论