GetForeColor( &oldForeColor ) ;
{
- int theValue = GetControlValue(theControl) ;
- int theMinimum = GetControlMinimum(theControl) ;
- int theMaximum = GetControlMaximum(theControl) ;
+ int theValue = GetControl32BitValue(theControl) ;
+ int theMinimum = GetControl32BitMinimum(theControl) ;
+ int theMaximum = GetControl32BitMaximum(theControl) ;
AGADrawRectProgress( &(**theControl).contrlRect , kAGAStateEnabled , (( double )( theValue - theMinimum )) / ( theMaximum-theMinimum ) ) ;
}
AGASetFontStyle( &info->fontStyle ) ;
Boolean mRadioBehavior = false ;
- int mValue = GetControlValue( theControl ) ;
+ int mValue = GetControl32BitValue( theControl ) ;
long theValue = (mRadioBehavior ? mValue : 0);
Boolean inPushed = (**theControl).contrlHilite ;
Boolean down = inPushed || (theValue != 0);
Boolean mRadioBehavior = false ;
Rect frame, tempRect;
- int mValue = GetControlValue( theControl ) ;
+ int mValue = GetControl32BitValue( theControl ) ;
long theValue = (mRadioBehavior ? mValue : 0);
Boolean inPushed = (**theControl).contrlHilite ;
Boolean down = inPushed || (theValue != 0);
Rect frame = (**theControl).contrlRect ;
Boolean hasColor = true;
Boolean disabled = (*theControl)->contrlHilite == 255 ;
- int mValue = GetControlValue( theControl ) ;
+ int mValue = GetControl32BitValue( theControl ) ;
Boolean inPushed = (**theControl).contrlHilite ;
int mEnabled = 1 ;
int triState_Off = 3 ;
Rect frame = (**theControl).contrlRect ;
Boolean hasColor = true;
Boolean disabled = (*theControl)->contrlHilite == 255 ;
- int mValue = GetControlValue( theControl ) ;
+ int mValue = GetControl32BitValue( theControl ) ;
Boolean inPushed = (**theControl).contrlHilite ;
int mEnabled = 1 ;
int triState_Off = 3 ;
GetForeColor( &oldForeColor ) ;
{
- int theValue = GetControlValue(theControl) ;
- int theMinimum = GetControlMinimum(theControl) ;
- int theMaximum = GetControlMaximum(theControl) ;
+ int theValue = GetControl32BitValue(theControl) ;
+ int theMinimum = GetControl32BitMinimum(theControl) ;
+ int theMaximum = GetControl32BitMaximum(theControl) ;
AGADrawRectProgress( &(**theControl).contrlRect , kAGAStateEnabled , (( double )( theValue - theMinimum )) / ( theMaximum-theMinimum ) ) ;
}
AGASetFontStyle( &info->fontStyle ) ;
Boolean mRadioBehavior = false ;
- int mValue = GetControlValue( theControl ) ;
+ int mValue = GetControl32BitValue( theControl ) ;
long theValue = (mRadioBehavior ? mValue : 0);
Boolean inPushed = (**theControl).contrlHilite ;
Boolean down = inPushed || (theValue != 0);
Boolean mRadioBehavior = false ;
Rect frame, tempRect;
- int mValue = GetControlValue( theControl ) ;
+ int mValue = GetControl32BitValue( theControl ) ;
long theValue = (mRadioBehavior ? mValue : 0);
Boolean inPushed = (**theControl).contrlHilite ;
Boolean down = inPushed || (theValue != 0);
Rect frame = (**theControl).contrlRect ;
Boolean hasColor = true;
Boolean disabled = (*theControl)->contrlHilite == 255 ;
- int mValue = GetControlValue( theControl ) ;
+ int mValue = GetControl32BitValue( theControl ) ;
Boolean inPushed = (**theControl).contrlHilite ;
int mEnabled = 1 ;
int triState_Off = 3 ;
Rect frame = (**theControl).contrlRect ;
Boolean hasColor = true;
Boolean disabled = (*theControl)->contrlHilite == 255 ;
- int mValue = GetControlValue( theControl ) ;
+ int mValue = GetControl32BitValue( theControl ) ;
Boolean inPushed = (**theControl).contrlHilite ;
int mEnabled = 1 ;
int triState_Off = 3 ;
void wxCheckBox::SetValue(bool val)
{
- ::SetControlValue( (ControlHandle) m_macControl , val ) ;
+ ::SetControl32BitValue( (ControlHandle) m_macControl , val ) ;
MacRedrawControl() ;
}
bool wxCheckBox::GetValue() const
{
- return ::GetControlValue( (ControlHandle) m_macControl ) ;
+ return ::GetControl32BitValue( (ControlHandle) m_macControl ) ;
}
void wxCheckBox::Command (wxCommandEvent & event)
m_macPopUpMenuHandle = NewUniqueMenu() ;
SetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlPopupButtonMenuHandleTag , sizeof( MenuHandle ) , (char*) &m_macPopUpMenuHandle) ;
- SetControlMinimum( (ControlHandle) m_macControl , 0 ) ;
- SetControlMaximum( (ControlHandle) m_macControl , 0) ;
+ SetControl32BitMinimum( (ControlHandle) m_macControl , 0 ) ;
+ SetControl32BitMaximum( (ControlHandle) m_macControl , 0) ;
if ( n > 0 )
- SetControlValue( (ControlHandle) m_macControl , 1 ) ;
+ SetControl32BitValue( (ControlHandle) m_macControl , 1 ) ;
MacPostControlCreate() ;
m_datas.Add( NULL ) ;
int index = m_strings.GetCount() - 1 ;
DoSetItemClientData( index , NULL ) ;
- SetControlMaximum( (ControlHandle) m_macControl , GetCount()) ;
+ SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ;
return index ;
}
::DeleteMenuItem( MAC_WXHMENU(m_macPopUpMenuHandle) , n + 1) ;
m_strings.Remove( n ) ;
m_datas.RemoveAt( n ) ;
- SetControlMaximum( (ControlHandle) m_macControl , GetCount()) ;
+ SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ;
}
void wxChoice::Clear()
}
m_strings.Empty() ;
m_datas.Empty() ;
- SetControlMaximum( (ControlHandle) m_macControl , 0 ) ;
+ SetControl32BitMaximum( (ControlHandle) m_macControl , 0 ) ;
}
void wxChoice::FreeData()
int wxChoice::GetSelection() const
{
- return GetControlValue( (ControlHandle) m_macControl ) -1 ;
+ return GetControl32BitValue( (ControlHandle) m_macControl ) -1 ;
}
void wxChoice::SetSelection(int n)
{
- SetControlValue( (ControlHandle) m_macControl , n + 1 ) ;
+ SetControl32BitValue( (ControlHandle) m_macControl , n + 1 ) ;
}
// ----------------------------------------------------------------------------
void wxGauge::SetRange(int r)
{
m_rangeMax = r;
- ::SetControlMaximum( (ControlHandle) m_macControl , m_rangeMax ) ;
+ ::SetControl32BitMaximum( (ControlHandle) m_macControl , m_rangeMax ) ;
}
void wxGauge::SetValue(int pos)
{
m_gaugePos = pos;
- ::SetControlValue( (ControlHandle) m_macControl , m_gaugePos ) ;
+ ::SetControl32BitValue( (ControlHandle) m_macControl , m_gaugePos ) ;
}
int wxGauge::GetShadowWidth() const
return m_nSelection ;
ChangePage(m_nSelection, nPage);
- SetControlValue( (ControlHandle) m_macControl , m_nSelection + 1 ) ;
+ SetControl32BitValue( (ControlHandle) m_macControl , m_nSelection + 1 ) ;
return m_nSelection;
}
*/
void wxNotebook::MacSetupTabs()
{
- SetControlMaximum( (ControlHandle) m_macControl , GetPageCount() ) ;
+ SetControl32BitMaximum( (ControlHandle) m_macControl , GetPageCount() ) ;
wxNotebookPage *page;
ControlTabInfoRec info;
{
{
wxNotebookEvent changing(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId,
- ::GetControlValue(control) - 1, m_nSelection);
+ ::GetControl32BitValue(control) - 1, m_nSelection);
changing.SetEventObject(this);
ProcessEvent(changing);
wxTheApp->s_lastMouseDown = 0 ;
wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_windowId,
- ::GetControlValue(control) - 1, m_nSelection);
+ ::GetControl32BitValue(control) - 1, m_nSelection);
event.SetEventObject(this);
ProcessEvent(event);
void wxNotebook::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
{
#if 0
- wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_windowId , ::GetControlValue((ControlHandle)m_macControl) - 1, m_nSelection);
+ wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_windowId , ::GetControl32BitValue((ControlHandle)m_macControl) - 1, m_nSelection);
event.SetEventObject(this);
ProcessEvent(event);
void wxRadioButton::SetValue(bool val)
{
wxRadioButton *cycle;
- if ( GetControlValue( (ControlHandle) m_macControl ) == val )
+ if ( GetControl32BitValue( (ControlHandle) m_macControl ) == val )
return ;
- ::SetControlValue( (ControlHandle) m_macControl , val ) ;
+ ::SetControl32BitValue( (ControlHandle) m_macControl , val ) ;
if (val)
{
cycle=this->NextInCycle();
bool wxRadioButton::GetValue() const
{
- return ::GetControlValue( (ControlHandle) m_macControl ) ;
+ return ::GetControl32BitValue( (ControlHandle) m_macControl ) ;
}
void wxRadioButton::Command (wxCommandEvent & event)
void wxScrollBar::SetThumbPosition(int viewStart)
{
- ::SetControlValue( (ControlHandle) m_macControl , viewStart ) ;
+ ::SetControl32BitValue( (ControlHandle) m_macControl , viewStart ) ;
}
int wxScrollBar::GetThumbPosition() const
{
- return ::GetControlValue( (ControlHandle) m_macControl ) ;
+ return ::GetControl32BitValue( (ControlHandle) m_macControl ) ;
}
void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageSize,
int range1 = wxMax((m_objectSize - m_viewSize), 0) ;
- SetControlMaximum( (ControlHandle) m_macControl , range1 ) ;
- SetControlMinimum( (ControlHandle) m_macControl , 0 ) ;
- SetControlValue( (ControlHandle) m_macControl , position ) ;
+ SetControl32BitMaximum( (ControlHandle) m_macControl , range1 ) ;
+ SetControl32BitMinimum( (ControlHandle) m_macControl , 0 ) ;
+ SetControl32BitValue( (ControlHandle) m_macControl , position ) ;
if ( UMAGetAppearanceVersion() >= 0x0110 )
{
if ( (ControlHandle) m_macControl == NULL )
return ;
- int position = GetControlValue( (ControlHandle) m_macControl) ;
- int minPos = GetControlMinimum( (ControlHandle) m_macControl) ;
- int maxPos = GetControlMaximum( (ControlHandle) m_macControl) ;
+ int position = GetControl32BitValue( (ControlHandle) m_macControl) ;
+ int minPos = GetControl32BitMinimum( (ControlHandle) m_macControl) ;
+ int maxPos = GetControl32BitMaximum( (ControlHandle) m_macControl) ;
wxEventType scrollEvent = wxEVT_NULL;
int nScrollInc;
int wxSlider::GetValue() const
{
- return GetControlValue( (ControlHandle) m_macControl) ;
+ return GetControl32BitValue( (ControlHandle) m_macControl) ;
}
void wxSlider::SetValue(int value)
valuestring.Printf( "%d" , value ) ;
if ( m_macValueStatic )
m_macValueStatic->SetLabel( valuestring ) ;
- SetControlValue( (ControlHandle) m_macControl , value ) ;
+ SetControl32BitValue( (ControlHandle) m_macControl , value ) ;
}
void wxSlider::SetRange(int minValue, int maxValue)
m_rangeMin = minValue;
m_rangeMax = maxValue;
- SetControlMinimum( (ControlHandle) m_macControl, m_rangeMin);
- SetControlMaximum( (ControlHandle) m_macControl, m_rangeMax);
+ SetControl32BitMinimum( (ControlHandle) m_macControl, m_rangeMin);
+ SetControl32BitMaximum( (ControlHandle) m_macControl, m_rangeMax);
if(m_macMinimumStatic) {
value.Printf("%d", m_rangeMin);
void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
{
- SInt16 value = ::GetControlValue( (ControlHandle) m_macControl ) ;
+ SInt16 value = ::GetControl32BitValue( (ControlHandle) m_macControl ) ;
SetValue( value ) ;
{
m_min = minVal;
m_max = maxVal;
- SetControlMaximum( (ControlHandle) m_macControl , maxVal ) ;
- SetControlMinimum((ControlHandle) m_macControl , minVal ) ;
+ SetControl32BitMaximum( (ControlHandle) m_macControl , maxVal ) ;
+ SetControl32BitMinimum((ControlHandle) m_macControl , minVal ) ;
}
void wxSpinButton::MacHandleValueChanged( int inc )
{
m_value = oldValue ;
}
- SetControlValue( (ControlHandle) m_macControl , m_value ) ;
+ SetControl32BitValue( (ControlHandle) m_macControl , m_value ) ;
/* always send a thumbtrack event */
if (scrollEvent != wxEVT_SCROLL_THUMBTRACK)
}
if ( tool->CanBeToggled() && tool->IsToggled() )
{
- ::SetControlValue( m_macToolHandle , 1 ) ;
+ ::SetControl32BitValue( m_macToolHandle , 1 ) ;
}
else
{
- ::SetControlValue( m_macToolHandle , 0 ) ;
+ ::SetControl32BitValue( m_macToolHandle , 0 ) ;
}
/*
::SetControlFontStyle( m_macToolHandle , &controlstyle ) ;
wxToolBarTool *tool = (wxToolBarTool *)m_tools.Nth( index )->Data();
if ( tool->CanBeToggled() )
{
- tool->Toggle( GetControlValue( (ControlHandle) control ) ) ;
+ tool->Toggle( GetControl32BitValue( (ControlHandle) control ) ) ;
}
OnLeftClick( tool->GetId() , tool -> IsToggled() ) ;
break ;
return ;
ControlHandle control = (ControlHandle) m_macToolHandles[ tool->m_index ] ;
- ::SetControlValue( control , toggle ) ;
+ ::SetControl32BitValue( control , toggle ) ;
}
bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos),
#include "wx/menuitem.h"
#include "wx/spinctrl.h"
#include "wx/log.h"
+#include "wx/geometry.h"
#if wxUSE_CARET
#include "wx/caret.h"
extern int wxBusyCursorCount ;
static wxWindow *gs_lastWhich = NULL;
+bool wxWindowMac::MacSetupCursor( const wxPoint& pt)
+{
+ // first trigger a set cursor event
+
+ wxPoint clientorigin = GetClientAreaOrigin() ;
+ wxSize clientsize = GetClientSize() ;
+ wxCursor cursor ;
+ if ( wxRect2DInt( clientorigin.x , clientorigin.y , clientsize.x , clientsize.y ).Contains( wxPoint2DInt( pt ) ) )
+ {
+ wxSetCursorEvent event( pt.x , pt.y );
+
+ bool processedEvtSetCursor = GetEventHandler()->ProcessEvent(event);
+ if ( processedEvtSetCursor && event.HasCursor() )
+ {
+ cursor = event.GetCursor() ;
+ }
+ else
+ {
+
+ // the test for processedEvtSetCursor is here to prevent using m_cursor
+ // if the user code caught EVT_SET_CURSOR() and returned nothing from
+ // it - this is a way to say that our cursor shouldn't be used for this
+ // point
+ if ( !processedEvtSetCursor && m_cursor.Ok() )
+ {
+ cursor = m_cursor ;
+ }
+ if ( wxIsBusy() )
+ {
+ }
+ else
+ {
+ if ( !GetParent() )
+ cursor = *wxSTANDARD_CURSOR ;
+ }
+ }
+ if ( cursor.Ok() )
+ cursor.MacInstall() ;
+ }
+ return cursor.Ok() ;
+}
+
bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event)
{
if ((event.m_x < m_x) || (event.m_y < m_y) ||
}
}
- event.m_x = x ;
- event.m_y = y ;
- event.SetEventObject( this ) ;
+ wxWindow* cursorTarget = this ;
+ wxPoint cursorPoint( x , y ) ;
- if ( wxBusyCursorCount == 0 )
+ while( cursorTarget && !cursorTarget->MacSetupCursor( cursorPoint ) )
{
- m_cursor.MacInstall() ;
+ cursorTarget = cursorTarget->GetParent() ;
+ if ( cursorTarget )
+ cursorPoint += cursorTarget->GetPosition() ;
}
+ event.m_x = x ;
+ event.m_y = y ;
+ event.SetEventObject( this ) ;
if ( event.GetEventType() == wxEVT_LEFT_DOWN )
{
void wxCheckBox::SetValue(bool val)
{
- ::SetControlValue( (ControlHandle) m_macControl , val ) ;
+ ::SetControl32BitValue( (ControlHandle) m_macControl , val ) ;
MacRedrawControl() ;
}
bool wxCheckBox::GetValue() const
{
- return ::GetControlValue( (ControlHandle) m_macControl ) ;
+ return ::GetControl32BitValue( (ControlHandle) m_macControl ) ;
}
void wxCheckBox::Command (wxCommandEvent & event)
m_macPopUpMenuHandle = NewUniqueMenu() ;
SetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlPopupButtonMenuHandleTag , sizeof( MenuHandle ) , (char*) &m_macPopUpMenuHandle) ;
- SetControlMinimum( (ControlHandle) m_macControl , 0 ) ;
- SetControlMaximum( (ControlHandle) m_macControl , 0) ;
+ SetControl32BitMinimum( (ControlHandle) m_macControl , 0 ) ;
+ SetControl32BitMaximum( (ControlHandle) m_macControl , 0) ;
if ( n > 0 )
- SetControlValue( (ControlHandle) m_macControl , 1 ) ;
+ SetControl32BitValue( (ControlHandle) m_macControl , 1 ) ;
MacPostControlCreate() ;
m_datas.Add( NULL ) ;
int index = m_strings.GetCount() - 1 ;
DoSetItemClientData( index , NULL ) ;
- SetControlMaximum( (ControlHandle) m_macControl , GetCount()) ;
+ SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ;
return index ;
}
::DeleteMenuItem( MAC_WXHMENU(m_macPopUpMenuHandle) , n + 1) ;
m_strings.Remove( n ) ;
m_datas.RemoveAt( n ) ;
- SetControlMaximum( (ControlHandle) m_macControl , GetCount()) ;
+ SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ;
}
void wxChoice::Clear()
}
m_strings.Empty() ;
m_datas.Empty() ;
- SetControlMaximum( (ControlHandle) m_macControl , 0 ) ;
+ SetControl32BitMaximum( (ControlHandle) m_macControl , 0 ) ;
}
void wxChoice::FreeData()
int wxChoice::GetSelection() const
{
- return GetControlValue( (ControlHandle) m_macControl ) -1 ;
+ return GetControl32BitValue( (ControlHandle) m_macControl ) -1 ;
}
void wxChoice::SetSelection(int n)
{
- SetControlValue( (ControlHandle) m_macControl , n + 1 ) ;
+ SetControl32BitValue( (ControlHandle) m_macControl , n + 1 ) ;
}
// ----------------------------------------------------------------------------
void wxGauge::SetRange(int r)
{
m_rangeMax = r;
- ::SetControlMaximum( (ControlHandle) m_macControl , m_rangeMax ) ;
+ ::SetControl32BitMaximum( (ControlHandle) m_macControl , m_rangeMax ) ;
}
void wxGauge::SetValue(int pos)
{
m_gaugePos = pos;
- ::SetControlValue( (ControlHandle) m_macControl , m_gaugePos ) ;
+ ::SetControl32BitValue( (ControlHandle) m_macControl , m_gaugePos ) ;
}
int wxGauge::GetShadowWidth() const
return m_nSelection ;
ChangePage(m_nSelection, nPage);
- SetControlValue( (ControlHandle) m_macControl , m_nSelection + 1 ) ;
+ SetControl32BitValue( (ControlHandle) m_macControl , m_nSelection + 1 ) ;
return m_nSelection;
}
*/
void wxNotebook::MacSetupTabs()
{
- SetControlMaximum( (ControlHandle) m_macControl , GetPageCount() ) ;
+ SetControl32BitMaximum( (ControlHandle) m_macControl , GetPageCount() ) ;
wxNotebookPage *page;
ControlTabInfoRec info;
{
{
wxNotebookEvent changing(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId,
- ::GetControlValue(control) - 1, m_nSelection);
+ ::GetControl32BitValue(control) - 1, m_nSelection);
changing.SetEventObject(this);
ProcessEvent(changing);
wxTheApp->s_lastMouseDown = 0 ;
wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_windowId,
- ::GetControlValue(control) - 1, m_nSelection);
+ ::GetControl32BitValue(control) - 1, m_nSelection);
event.SetEventObject(this);
ProcessEvent(event);
void wxNotebook::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
{
#if 0
- wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_windowId , ::GetControlValue((ControlHandle)m_macControl) - 1, m_nSelection);
+ wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_windowId , ::GetControl32BitValue((ControlHandle)m_macControl) - 1, m_nSelection);
event.SetEventObject(this);
ProcessEvent(event);
void wxRadioButton::SetValue(bool val)
{
wxRadioButton *cycle;
- if ( GetControlValue( (ControlHandle) m_macControl ) == val )
+ if ( GetControl32BitValue( (ControlHandle) m_macControl ) == val )
return ;
- ::SetControlValue( (ControlHandle) m_macControl , val ) ;
+ ::SetControl32BitValue( (ControlHandle) m_macControl , val ) ;
if (val)
{
cycle=this->NextInCycle();
bool wxRadioButton::GetValue() const
{
- return ::GetControlValue( (ControlHandle) m_macControl ) ;
+ return ::GetControl32BitValue( (ControlHandle) m_macControl ) ;
}
void wxRadioButton::Command (wxCommandEvent & event)
void wxScrollBar::SetThumbPosition(int viewStart)
{
- ::SetControlValue( (ControlHandle) m_macControl , viewStart ) ;
+ ::SetControl32BitValue( (ControlHandle) m_macControl , viewStart ) ;
}
int wxScrollBar::GetThumbPosition() const
{
- return ::GetControlValue( (ControlHandle) m_macControl ) ;
+ return ::GetControl32BitValue( (ControlHandle) m_macControl ) ;
}
void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageSize,
int range1 = wxMax((m_objectSize - m_viewSize), 0) ;
- SetControlMaximum( (ControlHandle) m_macControl , range1 ) ;
- SetControlMinimum( (ControlHandle) m_macControl , 0 ) ;
- SetControlValue( (ControlHandle) m_macControl , position ) ;
+ SetControl32BitMaximum( (ControlHandle) m_macControl , range1 ) ;
+ SetControl32BitMinimum( (ControlHandle) m_macControl , 0 ) ;
+ SetControl32BitValue( (ControlHandle) m_macControl , position ) ;
if ( UMAGetAppearanceVersion() >= 0x0110 )
{
if ( (ControlHandle) m_macControl == NULL )
return ;
- int position = GetControlValue( (ControlHandle) m_macControl) ;
- int minPos = GetControlMinimum( (ControlHandle) m_macControl) ;
- int maxPos = GetControlMaximum( (ControlHandle) m_macControl) ;
+ int position = GetControl32BitValue( (ControlHandle) m_macControl) ;
+ int minPos = GetControl32BitMinimum( (ControlHandle) m_macControl) ;
+ int maxPos = GetControl32BitMaximum( (ControlHandle) m_macControl) ;
wxEventType scrollEvent = wxEVT_NULL;
int nScrollInc;
int wxSlider::GetValue() const
{
- return GetControlValue( (ControlHandle) m_macControl) ;
+ return GetControl32BitValue( (ControlHandle) m_macControl) ;
}
void wxSlider::SetValue(int value)
valuestring.Printf( "%d" , value ) ;
if ( m_macValueStatic )
m_macValueStatic->SetLabel( valuestring ) ;
- SetControlValue( (ControlHandle) m_macControl , value ) ;
+ SetControl32BitValue( (ControlHandle) m_macControl , value ) ;
}
void wxSlider::SetRange(int minValue, int maxValue)
m_rangeMin = minValue;
m_rangeMax = maxValue;
- SetControlMinimum( (ControlHandle) m_macControl, m_rangeMin);
- SetControlMaximum( (ControlHandle) m_macControl, m_rangeMax);
+ SetControl32BitMinimum( (ControlHandle) m_macControl, m_rangeMin);
+ SetControl32BitMaximum( (ControlHandle) m_macControl, m_rangeMax);
if(m_macMinimumStatic) {
value.Printf("%d", m_rangeMin);
void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
{
- SInt16 value = ::GetControlValue( (ControlHandle) m_macControl ) ;
+ SInt16 value = ::GetControl32BitValue( (ControlHandle) m_macControl ) ;
SetValue( value ) ;
{
m_min = minVal;
m_max = maxVal;
- SetControlMaximum( (ControlHandle) m_macControl , maxVal ) ;
- SetControlMinimum((ControlHandle) m_macControl , minVal ) ;
+ SetControl32BitMaximum( (ControlHandle) m_macControl , maxVal ) ;
+ SetControl32BitMinimum((ControlHandle) m_macControl , minVal ) ;
}
void wxSpinButton::MacHandleValueChanged( int inc )
{
m_value = oldValue ;
}
- SetControlValue( (ControlHandle) m_macControl , m_value ) ;
+ SetControl32BitValue( (ControlHandle) m_macControl , m_value ) ;
/* always send a thumbtrack event */
if (scrollEvent != wxEVT_SCROLL_THUMBTRACK)
}
if ( tool->CanBeToggled() && tool->IsToggled() )
{
- ::SetControlValue( m_macToolHandle , 1 ) ;
+ ::SetControl32BitValue( m_macToolHandle , 1 ) ;
}
else
{
- ::SetControlValue( m_macToolHandle , 0 ) ;
+ ::SetControl32BitValue( m_macToolHandle , 0 ) ;
}
/*
::SetControlFontStyle( m_macToolHandle , &controlstyle ) ;
wxToolBarTool *tool = (wxToolBarTool *)m_tools.Nth( index )->Data();
if ( tool->CanBeToggled() )
{
- tool->Toggle( GetControlValue( (ControlHandle) control ) ) ;
+ tool->Toggle( GetControl32BitValue( (ControlHandle) control ) ) ;
}
OnLeftClick( tool->GetId() , tool -> IsToggled() ) ;
break ;
return ;
ControlHandle control = (ControlHandle) m_macToolHandles[ tool->m_index ] ;
- ::SetControlValue( control , toggle ) ;
+ ::SetControl32BitValue( control , toggle ) ;
}
bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos),
#include "wx/menuitem.h"
#include "wx/spinctrl.h"
#include "wx/log.h"
+#include "wx/geometry.h"
#if wxUSE_CARET
#include "wx/caret.h"
extern int wxBusyCursorCount ;
static wxWindow *gs_lastWhich = NULL;
+bool wxWindowMac::MacSetupCursor( const wxPoint& pt)
+{
+ // first trigger a set cursor event
+
+ wxPoint clientorigin = GetClientAreaOrigin() ;
+ wxSize clientsize = GetClientSize() ;
+ wxCursor cursor ;
+ if ( wxRect2DInt( clientorigin.x , clientorigin.y , clientsize.x , clientsize.y ).Contains( wxPoint2DInt( pt ) ) )
+ {
+ wxSetCursorEvent event( pt.x , pt.y );
+
+ bool processedEvtSetCursor = GetEventHandler()->ProcessEvent(event);
+ if ( processedEvtSetCursor && event.HasCursor() )
+ {
+ cursor = event.GetCursor() ;
+ }
+ else
+ {
+
+ // the test for processedEvtSetCursor is here to prevent using m_cursor
+ // if the user code caught EVT_SET_CURSOR() and returned nothing from
+ // it - this is a way to say that our cursor shouldn't be used for this
+ // point
+ if ( !processedEvtSetCursor && m_cursor.Ok() )
+ {
+ cursor = m_cursor ;
+ }
+ if ( wxIsBusy() )
+ {
+ }
+ else
+ {
+ if ( !GetParent() )
+ cursor = *wxSTANDARD_CURSOR ;
+ }
+ }
+ if ( cursor.Ok() )
+ cursor.MacInstall() ;
+ }
+ return cursor.Ok() ;
+}
+
bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event)
{
if ((event.m_x < m_x) || (event.m_y < m_y) ||
}
}
- event.m_x = x ;
- event.m_y = y ;
- event.SetEventObject( this ) ;
+ wxWindow* cursorTarget = this ;
+ wxPoint cursorPoint( x , y ) ;
- if ( wxBusyCursorCount == 0 )
+ while( cursorTarget && !cursorTarget->MacSetupCursor( cursorPoint ) )
{
- m_cursor.MacInstall() ;
+ cursorTarget = cursorTarget->GetParent() ;
+ if ( cursorTarget )
+ cursorPoint += cursorTarget->GetPosition() ;
}
+ event.m_x = x ;
+ event.m_y = y ;
+ event.SetEventObject( this ) ;
if ( event.GetEventType() == wxEVT_LEFT_DOWN )
{