- m_staticValue = 0;
- m_staticMin = 0;
- m_staticMax = 0;
- m_pageSize = 1;
- m_lineSize = 1;
- m_rangeMax = 0;
- m_rangeMin = 0;
- m_tickFreq = 0;
-}
-
-bool wxSlider::Create(wxWindow *parent, wxWindowID id,
- int value, int minValue, int maxValue,
- const wxPoint& pos,
- const wxSize& size, long style,
-#if wxUSE_VALIDATORS
-# if defined(__VISAGECPP__)
- const wxValidator* validator,
-# else
- const wxValidator& validator,
-# endif
-#endif
- const wxString& name)
-{
- SetName(name);
-#if wxUSE_VALIDATORS
- SetValidator(validator);
-#endif
-
- if (parent) parent->AddChild(this);
-
- m_lineSize = 1;
- m_windowStyle = style;
- m_tickFreq = 0;
-
- if ( id == -1 )
- m_windowId = (int)NewControlId();
- else
- m_windowId = id;
-
- m_rangeMax = maxValue;
- m_rangeMin = minValue;
-
- m_pageSize = (int)((maxValue-minValue)/10);
-
- // TODO create slider
-
- return FALSE;
-}
-
-bool wxSlider::OS2OnScroll(int WXUNUSED(orientation), WXWORD wParam,
- WXWORD pos, WXHWND control)
-{
- int position = 0; // Dummy - not used in this mode
-
- int nScrollInc;
- wxEventType scrollEvent = wxEVT_NULL;
-// TODO:
-/*
- switch ( wParam )
- {
- case SB_TOP:
- nScrollInc = m_rangeMax - position;
- scrollEvent = wxEVT_SCROLL_TOP;
- break;
-
- case SB_BOTTOM:
- nScrollInc = - position;
- scrollEvent = wxEVT_SCROLL_BOTTOM;
- break;
-
- case SB_LINEUP:
- nScrollInc = - GetLineSize();
- scrollEvent = wxEVT_SCROLL_LINEUP;
- break;
-
- case SB_LINEDOWN:
- nScrollInc = GetLineSize();
- scrollEvent = wxEVT_SCROLL_LINEDOWN;
- break;
-
- case SB_PAGEUP:
- nScrollInc = -GetPageSize();
- scrollEvent = wxEVT_SCROLL_PAGEUP;
- break;
-
- case SB_PAGEDOWN:
- nScrollInc = GetPageSize();
- scrollEvent = wxEVT_SCROLL_PAGEDOWN;
- break;
-
- case SB_THUMBTRACK:
- case SB_THUMBPOSITION:
-#ifdef __WIN32__
- nScrollInc = (signed short)pos - position;
-#else // Win16
- nScrollInc = pos - position;
-#endif // Win32/16
- scrollEvent = wxEVT_SCROLL_THUMBTRACK;
- break;
-
- default:
- nScrollInc = 0;
- }
-
- if ( nScrollInc == 0 )
- {
- // no event...
- return FALSE;
- }
-
- int newPos = (int)::SendMessage((HWND) control, TBM_GETPOS, 0, 0);
- if ( (newPos < GetMin()) || (newPos > GetMax()) )
- {
- // out of range - but we did process it
- return TRUE;
- }
-*/
- int newPos = 0; //temporary
- SetValue(newPos);
-
- wxScrollEvent event(scrollEvent, m_windowId);
- event.SetPosition(newPos);
- event.SetEventObject( this );
- GetEventHandler()->ProcessEvent(event);
-
- wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, GetId() );
- cevent.SetEventObject( this );
-
- return GetEventHandler()->ProcessEvent( cevent );
-}