m_pageSize = (int)((maxValue-minValue)/10);
- MacPreControlCreate( parent, id, "", pos, size, style,
+ MacPreControlCreate( parent, id, wxEmptyString, pos, size, style,
validator, name, &bounds, title );
procID = kControlSliderProc + kControlSliderLiveFeedback;
m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, title, false,
value, minValue, maxValue, procID, (long) this);
- wxASSERT_MSG( (ControlHandle) m_macControl != NULL , "No valid mac control" ) ;
+ wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
::SetControlAction( (ControlHandle) m_macControl , wxMacLiveScrollbarActionUPP ) ;
if(style & wxSL_LABELS)
{
- m_macMinimumStatic = new wxStaticText( this, -1, "" );
- m_macMaximumStatic = new wxStaticText( this, -1, "" );
- m_macValueStatic = new wxStaticText( this, -1, "" );
+ m_macMinimumStatic = new wxStaticText( this, -1, wxEmptyString );
+ m_macMaximumStatic = new wxStaticText( this, -1, wxEmptyString );
+ m_macValueStatic = new wxStaticText( this, -1, wxEmptyString );
SetRange(minValue, maxValue);
SetValue(value);
}
void wxSlider::SetValue(int value)
{
wxString valuestring ;
- valuestring.Printf( "%d" , value ) ;
+ valuestring.Printf( wxT("%d") , value ) ;
if ( m_macValueStatic )
m_macValueStatic->SetLabel( valuestring ) ;
SetControl32BitValue( (ControlHandle) m_macControl , value ) ;
SetControl32BitMaximum( (ControlHandle) m_macControl, m_rangeMax);
if(m_macMinimumStatic) {
- value.Printf("%d", m_rangeMin);
+ value.Printf(wxT("%d"), m_rangeMin);
m_macMinimumStatic->SetLabel(value);
}
if(m_macMaximumStatic) {
- value.Printf("%d", m_rangeMax);
+ value.Printf(wxT("%d"), m_rangeMax);
m_macMaximumStatic->SetLabel(value);
}
SetValue(m_rangeMin);
ProcessCommand (event);
}
-void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
+void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart, bool mouseStillDown )
{
SInt16 value = ::GetControl32BitValue( (ControlHandle) m_macControl ) ;
SetValue( value ) ;
- wxScrollEvent event(wxEVT_SCROLL_THUMBTRACK, m_windowId);
+ wxEventType scrollEvent = wxEVT_NULL ;
+
+ if ( mouseStillDown )
+ scrollEvent = wxEVT_SCROLL_THUMBTRACK;
+ else
+ scrollEvent = wxEVT_SCROLL_THUMBRELEASE;
+
+ wxScrollEvent event(scrollEvent, m_windowId);
event.SetPosition(value);
event.SetEventObject( this );
GetEventHandler()->ProcessEvent(event);
int ht, wd;
// Get maximum text label width and height
- text.Printf("%d", m_rangeMin);
+ text.Printf(wxT("%d"), m_rangeMin);
GetTextExtent(text, &textwidth, &textheight);
- text.Printf("%d", m_rangeMax);
+ text.Printf(wxT("%d"), m_rangeMax);
GetTextExtent(text, &wd, &ht);
if(ht > textheight) {
textheight = ht;
int ht;
// Get maximum text label width and height
- text.Printf("%d", m_rangeMin);
+ text.Printf(wxT("%d"), m_rangeMin);
GetTextExtent(text, &minValWidth, &textheight);
- text.Printf("%d", m_rangeMax);
+ text.Printf(wxT("%d"), m_rangeMax);
GetTextExtent(text, &maxValWidth, &ht);
if(ht > textheight) {
textheight = ht;