all controls use 32 bit values now

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16479 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2002-08-13 08:50:41 +00:00
parent 0f4930939e
commit 467e3168b3
22 changed files with 198 additions and 104 deletions

View File

@@ -955,9 +955,9 @@ pascal SInt32 AGAProgressBarDefProc (SInt16 procID, ControlHandle theControl, Co
GetForeColor( &oldForeColor ) ; GetForeColor( &oldForeColor ) ;
{ {
int theValue = GetControlValue(theControl) ; int theValue = GetControl32BitValue(theControl) ;
int theMinimum = GetControlMinimum(theControl) ; int theMinimum = GetControl32BitMinimum(theControl) ;
int theMaximum = GetControlMaximum(theControl) ; int theMaximum = GetControl32BitMaximum(theControl) ;
AGADrawRectProgress( &(**theControl).contrlRect , kAGAStateEnabled , (( double )( theValue - theMinimum )) / ( theMaximum-theMinimum ) ) ; AGADrawRectProgress( &(**theControl).contrlRect , kAGAStateEnabled , (( double )( theValue - theMinimum )) / ( theMaximum-theMinimum ) ) ;
} }
@@ -1052,7 +1052,7 @@ pascal SInt32 AGABevelButtonDefProc (SInt16 procID, ControlHandle theControl, Co
AGASetFontStyle( &info->fontStyle ) ; AGASetFontStyle( &info->fontStyle ) ;
Boolean mRadioBehavior = false ; Boolean mRadioBehavior = false ;
int mValue = GetControlValue( theControl ) ; int mValue = GetControl32BitValue( theControl ) ;
long theValue = (mRadioBehavior ? mValue : 0); long theValue = (mRadioBehavior ? mValue : 0);
Boolean inPushed = (**theControl).contrlHilite ; Boolean inPushed = (**theControl).contrlHilite ;
Boolean down = inPushed || (theValue != 0); Boolean down = inPushed || (theValue != 0);
@@ -1193,7 +1193,7 @@ pascal SInt32 AGAButtonDefProc (SInt16 procID, ControlHandle theControl, Control
Boolean mRadioBehavior = false ; Boolean mRadioBehavior = false ;
Rect frame, tempRect; Rect frame, tempRect;
int mValue = GetControlValue( theControl ) ; int mValue = GetControl32BitValue( theControl ) ;
long theValue = (mRadioBehavior ? mValue : 0); long theValue = (mRadioBehavior ? mValue : 0);
Boolean inPushed = (**theControl).contrlHilite ; Boolean inPushed = (**theControl).contrlHilite ;
Boolean down = inPushed || (theValue != 0); Boolean down = inPushed || (theValue != 0);
@@ -1429,7 +1429,7 @@ pascal SInt32 AGACheckBoxDefProc (SInt16 procID, ControlHandle theControl, Contr
Rect frame = (**theControl).contrlRect ; Rect frame = (**theControl).contrlRect ;
Boolean hasColor = true; Boolean hasColor = true;
Boolean disabled = (*theControl)->contrlHilite == 255 ; Boolean disabled = (*theControl)->contrlHilite == 255 ;
int mValue = GetControlValue( theControl ) ; int mValue = GetControl32BitValue( theControl ) ;
Boolean inPushed = (**theControl).contrlHilite ; Boolean inPushed = (**theControl).contrlHilite ;
int mEnabled = 1 ; int mEnabled = 1 ;
int triState_Off = 3 ; int triState_Off = 3 ;
@@ -1625,7 +1625,7 @@ pascal SInt32 AGARadioButtonDefProc (SInt16 procID, ControlHandle theControl, Co
Rect frame = (**theControl).contrlRect ; Rect frame = (**theControl).contrlRect ;
Boolean hasColor = true; Boolean hasColor = true;
Boolean disabled = (*theControl)->contrlHilite == 255 ; Boolean disabled = (*theControl)->contrlHilite == 255 ;
int mValue = GetControlValue( theControl ) ; int mValue = GetControl32BitValue( theControl ) ;
Boolean inPushed = (**theControl).contrlHilite ; Boolean inPushed = (**theControl).contrlHilite ;
int mEnabled = 1 ; int mEnabled = 1 ;
int triState_Off = 3 ; int triState_Off = 3 ;

View File

@@ -955,9 +955,9 @@ pascal SInt32 AGAProgressBarDefProc (SInt16 procID, ControlHandle theControl, Co
GetForeColor( &oldForeColor ) ; GetForeColor( &oldForeColor ) ;
{ {
int theValue = GetControlValue(theControl) ; int theValue = GetControl32BitValue(theControl) ;
int theMinimum = GetControlMinimum(theControl) ; int theMinimum = GetControl32BitMinimum(theControl) ;
int theMaximum = GetControlMaximum(theControl) ; int theMaximum = GetControl32BitMaximum(theControl) ;
AGADrawRectProgress( &(**theControl).contrlRect , kAGAStateEnabled , (( double )( theValue - theMinimum )) / ( theMaximum-theMinimum ) ) ; AGADrawRectProgress( &(**theControl).contrlRect , kAGAStateEnabled , (( double )( theValue - theMinimum )) / ( theMaximum-theMinimum ) ) ;
} }
@@ -1052,7 +1052,7 @@ pascal SInt32 AGABevelButtonDefProc (SInt16 procID, ControlHandle theControl, Co
AGASetFontStyle( &info->fontStyle ) ; AGASetFontStyle( &info->fontStyle ) ;
Boolean mRadioBehavior = false ; Boolean mRadioBehavior = false ;
int mValue = GetControlValue( theControl ) ; int mValue = GetControl32BitValue( theControl ) ;
long theValue = (mRadioBehavior ? mValue : 0); long theValue = (mRadioBehavior ? mValue : 0);
Boolean inPushed = (**theControl).contrlHilite ; Boolean inPushed = (**theControl).contrlHilite ;
Boolean down = inPushed || (theValue != 0); Boolean down = inPushed || (theValue != 0);
@@ -1193,7 +1193,7 @@ pascal SInt32 AGAButtonDefProc (SInt16 procID, ControlHandle theControl, Control
Boolean mRadioBehavior = false ; Boolean mRadioBehavior = false ;
Rect frame, tempRect; Rect frame, tempRect;
int mValue = GetControlValue( theControl ) ; int mValue = GetControl32BitValue( theControl ) ;
long theValue = (mRadioBehavior ? mValue : 0); long theValue = (mRadioBehavior ? mValue : 0);
Boolean inPushed = (**theControl).contrlHilite ; Boolean inPushed = (**theControl).contrlHilite ;
Boolean down = inPushed || (theValue != 0); Boolean down = inPushed || (theValue != 0);
@@ -1429,7 +1429,7 @@ pascal SInt32 AGACheckBoxDefProc (SInt16 procID, ControlHandle theControl, Contr
Rect frame = (**theControl).contrlRect ; Rect frame = (**theControl).contrlRect ;
Boolean hasColor = true; Boolean hasColor = true;
Boolean disabled = (*theControl)->contrlHilite == 255 ; Boolean disabled = (*theControl)->contrlHilite == 255 ;
int mValue = GetControlValue( theControl ) ; int mValue = GetControl32BitValue( theControl ) ;
Boolean inPushed = (**theControl).contrlHilite ; Boolean inPushed = (**theControl).contrlHilite ;
int mEnabled = 1 ; int mEnabled = 1 ;
int triState_Off = 3 ; int triState_Off = 3 ;
@@ -1625,7 +1625,7 @@ pascal SInt32 AGARadioButtonDefProc (SInt16 procID, ControlHandle theControl, Co
Rect frame = (**theControl).contrlRect ; Rect frame = (**theControl).contrlRect ;
Boolean hasColor = true; Boolean hasColor = true;
Boolean disabled = (*theControl)->contrlHilite == 255 ; Boolean disabled = (*theControl)->contrlHilite == 255 ;
int mValue = GetControlValue( theControl ) ; int mValue = GetControl32BitValue( theControl ) ;
Boolean inPushed = (**theControl).contrlHilite ; Boolean inPushed = (**theControl).contrlHilite ;
int mEnabled = 1 ; int mEnabled = 1 ;
int triState_Off = 3 ; int triState_Off = 3 ;

View File

@@ -46,13 +46,13 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
void wxCheckBox::SetValue(bool val) void wxCheckBox::SetValue(bool val)
{ {
::SetControlValue( (ControlHandle) m_macControl , val ) ; ::SetControl32BitValue( (ControlHandle) m_macControl , val ) ;
MacRedrawControl() ; MacRedrawControl() ;
} }
bool wxCheckBox::GetValue() const bool wxCheckBox::GetValue() const
{ {
return ::GetControlValue( (ControlHandle) m_macControl ) ; return ::GetControl32BitValue( (ControlHandle) m_macControl ) ;
} }
void wxCheckBox::Command (wxCommandEvent & event) void wxCheckBox::Command (wxCommandEvent & event)

View File

@@ -50,10 +50,10 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
m_macPopUpMenuHandle = NewUniqueMenu() ; m_macPopUpMenuHandle = NewUniqueMenu() ;
SetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlPopupButtonMenuHandleTag , sizeof( MenuHandle ) , (char*) &m_macPopUpMenuHandle) ; SetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlPopupButtonMenuHandleTag , sizeof( MenuHandle ) , (char*) &m_macPopUpMenuHandle) ;
SetControlMinimum( (ControlHandle) m_macControl , 0 ) ; SetControl32BitMinimum( (ControlHandle) m_macControl , 0 ) ;
SetControlMaximum( (ControlHandle) m_macControl , 0) ; SetControl32BitMaximum( (ControlHandle) m_macControl , 0) ;
if ( n > 0 ) if ( n > 0 )
SetControlValue( (ControlHandle) m_macControl , 1 ) ; SetControl32BitValue( (ControlHandle) m_macControl , 1 ) ;
MacPostControlCreate() ; MacPostControlCreate() ;
@@ -77,7 +77,7 @@ int wxChoice::DoAppend(const wxString& item)
m_datas.Add( NULL ) ; m_datas.Add( NULL ) ;
int index = m_strings.GetCount() - 1 ; int index = m_strings.GetCount() - 1 ;
DoSetItemClientData( index , NULL ) ; DoSetItemClientData( index , NULL ) ;
SetControlMaximum( (ControlHandle) m_macControl , GetCount()) ; SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ;
return index ; return index ;
} }
@@ -93,7 +93,7 @@ void wxChoice::Delete(int n)
::DeleteMenuItem( MAC_WXHMENU(m_macPopUpMenuHandle) , n + 1) ; ::DeleteMenuItem( MAC_WXHMENU(m_macPopUpMenuHandle) , n + 1) ;
m_strings.Remove( n ) ; m_strings.Remove( n ) ;
m_datas.RemoveAt( n ) ; m_datas.RemoveAt( n ) ;
SetControlMaximum( (ControlHandle) m_macControl , GetCount()) ; SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ;
} }
void wxChoice::Clear() void wxChoice::Clear()
@@ -106,7 +106,7 @@ void wxChoice::Clear()
} }
m_strings.Empty() ; m_strings.Empty() ;
m_datas.Empty() ; m_datas.Empty() ;
SetControlMaximum( (ControlHandle) m_macControl , 0 ) ; SetControl32BitMaximum( (ControlHandle) m_macControl , 0 ) ;
} }
void wxChoice::FreeData() void wxChoice::FreeData()
@@ -127,12 +127,12 @@ void wxChoice::FreeData()
int wxChoice::GetSelection() const int wxChoice::GetSelection() const
{ {
return GetControlValue( (ControlHandle) m_macControl ) -1 ; return GetControl32BitValue( (ControlHandle) m_macControl ) -1 ;
} }
void wxChoice::SetSelection(int n) void wxChoice::SetSelection(int n)
{ {
SetControlValue( (ControlHandle) m_macControl , n + 1 ) ; SetControl32BitValue( (ControlHandle) m_macControl , n + 1 ) ;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -61,13 +61,13 @@ void wxGauge::SetBezelFace(int w)
void wxGauge::SetRange(int r) void wxGauge::SetRange(int r)
{ {
m_rangeMax = r; m_rangeMax = r;
::SetControlMaximum( (ControlHandle) m_macControl , m_rangeMax ) ; ::SetControl32BitMaximum( (ControlHandle) m_macControl , m_rangeMax ) ;
} }
void wxGauge::SetValue(int pos) void wxGauge::SetValue(int pos)
{ {
m_gaugePos = pos; m_gaugePos = pos;
::SetControlValue( (ControlHandle) m_macControl , m_gaugePos ) ; ::SetControl32BitValue( (ControlHandle) m_macControl , m_gaugePos ) ;
} }
int wxGauge::GetShadowWidth() const int wxGauge::GetShadowWidth() const

View File

@@ -205,7 +205,7 @@ int wxNotebook::SetSelection(int nPage)
return m_nSelection ; return m_nSelection ;
ChangePage(m_nSelection, nPage); ChangePage(m_nSelection, nPage);
SetControlValue( (ControlHandle) m_macControl , m_nSelection + 1 ) ; SetControl32BitValue( (ControlHandle) m_macControl , m_nSelection + 1 ) ;
return m_nSelection; return m_nSelection;
} }
@@ -328,7 +328,7 @@ bool wxNotebook::InsertPage(int nPage,
*/ */
void wxNotebook::MacSetupTabs() void wxNotebook::MacSetupTabs()
{ {
SetControlMaximum( (ControlHandle) m_macControl , GetPageCount() ) ; SetControl32BitMaximum( (ControlHandle) m_macControl , GetPageCount() ) ;
wxNotebookPage *page; wxNotebookPage *page;
ControlTabInfoRec info; ControlTabInfoRec info;
@@ -518,7 +518,7 @@ void wxNotebook::OnMouse( wxMouseEvent &event )
{ {
{ {
wxNotebookEvent changing(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId, wxNotebookEvent changing(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId,
::GetControlValue(control) - 1, m_nSelection); ::GetControl32BitValue(control) - 1, m_nSelection);
changing.SetEventObject(this); changing.SetEventObject(this);
ProcessEvent(changing); ProcessEvent(changing);
@@ -529,7 +529,7 @@ void wxNotebook::OnMouse( wxMouseEvent &event )
wxTheApp->s_lastMouseDown = 0 ; wxTheApp->s_lastMouseDown = 0 ;
wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_windowId, wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_windowId,
::GetControlValue(control) - 1, m_nSelection); ::GetControl32BitValue(control) - 1, m_nSelection);
event.SetEventObject(this); event.SetEventObject(this);
ProcessEvent(event); ProcessEvent(event);
@@ -543,7 +543,7 @@ void wxNotebook::OnMouse( wxMouseEvent &event )
void wxNotebook::MacHandleControlClick( WXWidget control , wxInt16 controlpart ) void wxNotebook::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
{ {
#if 0 #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); event.SetEventObject(this);
ProcessEvent(event); ProcessEvent(event);

View File

@@ -69,10 +69,10 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
void wxRadioButton::SetValue(bool val) void wxRadioButton::SetValue(bool val)
{ {
wxRadioButton *cycle; wxRadioButton *cycle;
if ( GetControlValue( (ControlHandle) m_macControl ) == val ) if ( GetControl32BitValue( (ControlHandle) m_macControl ) == val )
return ; return ;
::SetControlValue( (ControlHandle) m_macControl , val ) ; ::SetControl32BitValue( (ControlHandle) m_macControl , val ) ;
if (val) if (val)
{ {
cycle=this->NextInCycle(); cycle=this->NextInCycle();
@@ -88,7 +88,7 @@ void wxRadioButton::SetValue(bool val)
bool wxRadioButton::GetValue() const bool wxRadioButton::GetValue() const
{ {
return ::GetControlValue( (ControlHandle) m_macControl ) ; return ::GetControl32BitValue( (ControlHandle) m_macControl ) ;
} }
void wxRadioButton::Command (wxCommandEvent & event) void wxRadioButton::Command (wxCommandEvent & event)

View File

@@ -61,12 +61,12 @@ wxScrollBar::~wxScrollBar()
void wxScrollBar::SetThumbPosition(int viewStart) void wxScrollBar::SetThumbPosition(int viewStart)
{ {
::SetControlValue( (ControlHandle) m_macControl , viewStart ) ; ::SetControl32BitValue( (ControlHandle) m_macControl , viewStart ) ;
} }
int wxScrollBar::GetThumbPosition() const 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, void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageSize,
@@ -78,9 +78,9 @@ void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageS
int range1 = wxMax((m_objectSize - m_viewSize), 0) ; int range1 = wxMax((m_objectSize - m_viewSize), 0) ;
SetControlMaximum( (ControlHandle) m_macControl , range1 ) ; SetControl32BitMaximum( (ControlHandle) m_macControl , range1 ) ;
SetControlMinimum( (ControlHandle) m_macControl , 0 ) ; SetControl32BitMinimum( (ControlHandle) m_macControl , 0 ) ;
SetControlValue( (ControlHandle) m_macControl , position ) ; SetControl32BitValue( (ControlHandle) m_macControl , position ) ;
if ( UMAGetAppearanceVersion() >= 0x0110 ) if ( UMAGetAppearanceVersion() >= 0x0110 )
{ {
@@ -105,9 +105,9 @@ void wxScrollBar::MacHandleControlClick( WXWidget control , wxInt16 controlpart
if ( (ControlHandle) m_macControl == NULL ) if ( (ControlHandle) m_macControl == NULL )
return ; return ;
int position = GetControlValue( (ControlHandle) m_macControl) ; int position = GetControl32BitValue( (ControlHandle) m_macControl) ;
int minPos = GetControlMinimum( (ControlHandle) m_macControl) ; int minPos = GetControl32BitMinimum( (ControlHandle) m_macControl) ;
int maxPos = GetControlMaximum( (ControlHandle) m_macControl) ; int maxPos = GetControl32BitMaximum( (ControlHandle) m_macControl) ;
wxEventType scrollEvent = wxEVT_NULL; wxEventType scrollEvent = wxEVT_NULL;
int nScrollInc; int nScrollInc;

View File

@@ -127,7 +127,7 @@ wxSlider::~wxSlider()
int wxSlider::GetValue() const int wxSlider::GetValue() const
{ {
return GetControlValue( (ControlHandle) m_macControl) ; return GetControl32BitValue( (ControlHandle) m_macControl) ;
} }
void wxSlider::SetValue(int value) void wxSlider::SetValue(int value)
@@ -136,7 +136,7 @@ void wxSlider::SetValue(int value)
valuestring.Printf( "%d" , value ) ; valuestring.Printf( "%d" , value ) ;
if ( m_macValueStatic ) if ( m_macValueStatic )
m_macValueStatic->SetLabel( valuestring ) ; m_macValueStatic->SetLabel( valuestring ) ;
SetControlValue( (ControlHandle) m_macControl , value ) ; SetControl32BitValue( (ControlHandle) m_macControl , value ) ;
} }
void wxSlider::SetRange(int minValue, int maxValue) void wxSlider::SetRange(int minValue, int maxValue)
@@ -146,8 +146,8 @@ void wxSlider::SetRange(int minValue, int maxValue)
m_rangeMin = minValue; m_rangeMin = minValue;
m_rangeMax = maxValue; m_rangeMax = maxValue;
SetControlMinimum( (ControlHandle) m_macControl, m_rangeMin); SetControl32BitMinimum( (ControlHandle) m_macControl, m_rangeMin);
SetControlMaximum( (ControlHandle) m_macControl, m_rangeMax); SetControl32BitMaximum( (ControlHandle) m_macControl, m_rangeMax);
if(m_macMinimumStatic) { if(m_macMinimumStatic) {
value.Printf("%d", m_rangeMin); value.Printf("%d", m_rangeMin);
@@ -241,7 +241,7 @@ void wxSlider::Command (wxCommandEvent & event)
void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart ) void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
{ {
SInt16 value = ::GetControlValue( (ControlHandle) m_macControl ) ; SInt16 value = ::GetControl32BitValue( (ControlHandle) m_macControl ) ;
SetValue( value ) ; SetValue( value ) ;

View File

@@ -90,8 +90,8 @@ void wxSpinButton::SetRange(int minVal, int maxVal)
{ {
m_min = minVal; m_min = minVal;
m_max = maxVal; m_max = maxVal;
SetControlMaximum( (ControlHandle) m_macControl , maxVal ) ; SetControl32BitMaximum( (ControlHandle) m_macControl , maxVal ) ;
SetControlMinimum((ControlHandle) m_macControl , minVal ) ; SetControl32BitMinimum((ControlHandle) m_macControl , minVal ) ;
} }
void wxSpinButton::MacHandleValueChanged( int inc ) void wxSpinButton::MacHandleValueChanged( int inc )
@@ -134,7 +134,7 @@ void wxSpinButton::MacHandleValueChanged( int inc )
{ {
m_value = oldValue ; m_value = oldValue ;
} }
SetControlValue( (ControlHandle) m_macControl , m_value ) ; SetControl32BitValue( (ControlHandle) m_macControl , m_value ) ;
/* always send a thumbtrack event */ /* always send a thumbtrack event */
if (scrollEvent != wxEVT_SCROLL_THUMBTRACK) if (scrollEvent != wxEVT_SCROLL_THUMBTRACK)

View File

@@ -240,11 +240,11 @@ bool wxToolBar::Realize()
} }
if ( tool->CanBeToggled() && tool->IsToggled() ) if ( tool->CanBeToggled() && tool->IsToggled() )
{ {
::SetControlValue( m_macToolHandle , 1 ) ; ::SetControl32BitValue( m_macToolHandle , 1 ) ;
} }
else else
{ {
::SetControlValue( m_macToolHandle , 0 ) ; ::SetControl32BitValue( m_macToolHandle , 0 ) ;
} }
/* /*
::SetControlFontStyle( m_macToolHandle , &controlstyle ) ; ::SetControlFontStyle( m_macToolHandle , &controlstyle ) ;
@@ -336,7 +336,7 @@ void wxToolBar::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
wxToolBarTool *tool = (wxToolBarTool *)m_tools.Nth( index )->Data(); wxToolBarTool *tool = (wxToolBarTool *)m_tools.Nth( index )->Data();
if ( tool->CanBeToggled() ) if ( tool->CanBeToggled() )
{ {
tool->Toggle( GetControlValue( (ControlHandle) control ) ) ; tool->Toggle( GetControl32BitValue( (ControlHandle) control ) ) ;
} }
OnLeftClick( tool->GetId() , tool -> IsToggled() ) ; OnLeftClick( tool->GetId() , tool -> IsToggled() ) ;
break ; break ;
@@ -533,7 +533,7 @@ void wxToolBar::DoToggleTool(wxToolBarToolBase *t, bool toggle)
return ; return ;
ControlHandle control = (ControlHandle) m_macToolHandles[ tool->m_index ] ; ControlHandle control = (ControlHandle) m_macToolHandles[ tool->m_index ] ;
::SetControlValue( control , toggle ) ; ::SetControl32BitValue( control , toggle ) ;
} }
bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos),

View File

@@ -37,6 +37,7 @@
#include "wx/menuitem.h" #include "wx/menuitem.h"
#include "wx/spinctrl.h" #include "wx/spinctrl.h"
#include "wx/log.h" #include "wx/log.h"
#include "wx/geometry.h"
#if wxUSE_CARET #if wxUSE_CARET
#include "wx/caret.h" #include "wx/caret.h"
@@ -1434,6 +1435,48 @@ bool wxWindowMac::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindowMa
extern int wxBusyCursorCount ; extern int wxBusyCursorCount ;
static wxWindow *gs_lastWhich = NULL; 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) bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event)
{ {
if ((event.m_x < m_x) || (event.m_y < m_y) || if ((event.m_x < m_x) || (event.m_y < m_y) ||
@@ -1462,15 +1505,19 @@ bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event)
} }
} }
wxWindow* cursorTarget = this ;
wxPoint cursorPoint( x , y ) ;
while( cursorTarget && !cursorTarget->MacSetupCursor( cursorPoint ) )
{
cursorTarget = cursorTarget->GetParent() ;
if ( cursorTarget )
cursorPoint += cursorTarget->GetPosition() ;
}
event.m_x = x ; event.m_x = x ;
event.m_y = y ; event.m_y = y ;
event.SetEventObject( this ) ; event.SetEventObject( this ) ;
if ( wxBusyCursorCount == 0 )
{
m_cursor.MacInstall() ;
}
if ( event.GetEventType() == wxEVT_LEFT_DOWN ) if ( event.GetEventType() == wxEVT_LEFT_DOWN )
{ {
// set focus to this window // set focus to this window

View File

@@ -46,13 +46,13 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
void wxCheckBox::SetValue(bool val) void wxCheckBox::SetValue(bool val)
{ {
::SetControlValue( (ControlHandle) m_macControl , val ) ; ::SetControl32BitValue( (ControlHandle) m_macControl , val ) ;
MacRedrawControl() ; MacRedrawControl() ;
} }
bool wxCheckBox::GetValue() const bool wxCheckBox::GetValue() const
{ {
return ::GetControlValue( (ControlHandle) m_macControl ) ; return ::GetControl32BitValue( (ControlHandle) m_macControl ) ;
} }
void wxCheckBox::Command (wxCommandEvent & event) void wxCheckBox::Command (wxCommandEvent & event)

View File

@@ -50,10 +50,10 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
m_macPopUpMenuHandle = NewUniqueMenu() ; m_macPopUpMenuHandle = NewUniqueMenu() ;
SetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlPopupButtonMenuHandleTag , sizeof( MenuHandle ) , (char*) &m_macPopUpMenuHandle) ; SetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlPopupButtonMenuHandleTag , sizeof( MenuHandle ) , (char*) &m_macPopUpMenuHandle) ;
SetControlMinimum( (ControlHandle) m_macControl , 0 ) ; SetControl32BitMinimum( (ControlHandle) m_macControl , 0 ) ;
SetControlMaximum( (ControlHandle) m_macControl , 0) ; SetControl32BitMaximum( (ControlHandle) m_macControl , 0) ;
if ( n > 0 ) if ( n > 0 )
SetControlValue( (ControlHandle) m_macControl , 1 ) ; SetControl32BitValue( (ControlHandle) m_macControl , 1 ) ;
MacPostControlCreate() ; MacPostControlCreate() ;
@@ -77,7 +77,7 @@ int wxChoice::DoAppend(const wxString& item)
m_datas.Add( NULL ) ; m_datas.Add( NULL ) ;
int index = m_strings.GetCount() - 1 ; int index = m_strings.GetCount() - 1 ;
DoSetItemClientData( index , NULL ) ; DoSetItemClientData( index , NULL ) ;
SetControlMaximum( (ControlHandle) m_macControl , GetCount()) ; SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ;
return index ; return index ;
} }
@@ -93,7 +93,7 @@ void wxChoice::Delete(int n)
::DeleteMenuItem( MAC_WXHMENU(m_macPopUpMenuHandle) , n + 1) ; ::DeleteMenuItem( MAC_WXHMENU(m_macPopUpMenuHandle) , n + 1) ;
m_strings.Remove( n ) ; m_strings.Remove( n ) ;
m_datas.RemoveAt( n ) ; m_datas.RemoveAt( n ) ;
SetControlMaximum( (ControlHandle) m_macControl , GetCount()) ; SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ;
} }
void wxChoice::Clear() void wxChoice::Clear()
@@ -106,7 +106,7 @@ void wxChoice::Clear()
} }
m_strings.Empty() ; m_strings.Empty() ;
m_datas.Empty() ; m_datas.Empty() ;
SetControlMaximum( (ControlHandle) m_macControl , 0 ) ; SetControl32BitMaximum( (ControlHandle) m_macControl , 0 ) ;
} }
void wxChoice::FreeData() void wxChoice::FreeData()
@@ -127,12 +127,12 @@ void wxChoice::FreeData()
int wxChoice::GetSelection() const int wxChoice::GetSelection() const
{ {
return GetControlValue( (ControlHandle) m_macControl ) -1 ; return GetControl32BitValue( (ControlHandle) m_macControl ) -1 ;
} }
void wxChoice::SetSelection(int n) void wxChoice::SetSelection(int n)
{ {
SetControlValue( (ControlHandle) m_macControl , n + 1 ) ; SetControl32BitValue( (ControlHandle) m_macControl , n + 1 ) ;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -61,13 +61,13 @@ void wxGauge::SetBezelFace(int w)
void wxGauge::SetRange(int r) void wxGauge::SetRange(int r)
{ {
m_rangeMax = r; m_rangeMax = r;
::SetControlMaximum( (ControlHandle) m_macControl , m_rangeMax ) ; ::SetControl32BitMaximum( (ControlHandle) m_macControl , m_rangeMax ) ;
} }
void wxGauge::SetValue(int pos) void wxGauge::SetValue(int pos)
{ {
m_gaugePos = pos; m_gaugePos = pos;
::SetControlValue( (ControlHandle) m_macControl , m_gaugePos ) ; ::SetControl32BitValue( (ControlHandle) m_macControl , m_gaugePos ) ;
} }
int wxGauge::GetShadowWidth() const int wxGauge::GetShadowWidth() const

View File

@@ -205,7 +205,7 @@ int wxNotebook::SetSelection(int nPage)
return m_nSelection ; return m_nSelection ;
ChangePage(m_nSelection, nPage); ChangePage(m_nSelection, nPage);
SetControlValue( (ControlHandle) m_macControl , m_nSelection + 1 ) ; SetControl32BitValue( (ControlHandle) m_macControl , m_nSelection + 1 ) ;
return m_nSelection; return m_nSelection;
} }
@@ -328,7 +328,7 @@ bool wxNotebook::InsertPage(int nPage,
*/ */
void wxNotebook::MacSetupTabs() void wxNotebook::MacSetupTabs()
{ {
SetControlMaximum( (ControlHandle) m_macControl , GetPageCount() ) ; SetControl32BitMaximum( (ControlHandle) m_macControl , GetPageCount() ) ;
wxNotebookPage *page; wxNotebookPage *page;
ControlTabInfoRec info; ControlTabInfoRec info;
@@ -518,7 +518,7 @@ void wxNotebook::OnMouse( wxMouseEvent &event )
{ {
{ {
wxNotebookEvent changing(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId, wxNotebookEvent changing(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId,
::GetControlValue(control) - 1, m_nSelection); ::GetControl32BitValue(control) - 1, m_nSelection);
changing.SetEventObject(this); changing.SetEventObject(this);
ProcessEvent(changing); ProcessEvent(changing);
@@ -529,7 +529,7 @@ void wxNotebook::OnMouse( wxMouseEvent &event )
wxTheApp->s_lastMouseDown = 0 ; wxTheApp->s_lastMouseDown = 0 ;
wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_windowId, wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_windowId,
::GetControlValue(control) - 1, m_nSelection); ::GetControl32BitValue(control) - 1, m_nSelection);
event.SetEventObject(this); event.SetEventObject(this);
ProcessEvent(event); ProcessEvent(event);
@@ -543,7 +543,7 @@ void wxNotebook::OnMouse( wxMouseEvent &event )
void wxNotebook::MacHandleControlClick( WXWidget control , wxInt16 controlpart ) void wxNotebook::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
{ {
#if 0 #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); event.SetEventObject(this);
ProcessEvent(event); ProcessEvent(event);

View File

@@ -69,10 +69,10 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
void wxRadioButton::SetValue(bool val) void wxRadioButton::SetValue(bool val)
{ {
wxRadioButton *cycle; wxRadioButton *cycle;
if ( GetControlValue( (ControlHandle) m_macControl ) == val ) if ( GetControl32BitValue( (ControlHandle) m_macControl ) == val )
return ; return ;
::SetControlValue( (ControlHandle) m_macControl , val ) ; ::SetControl32BitValue( (ControlHandle) m_macControl , val ) ;
if (val) if (val)
{ {
cycle=this->NextInCycle(); cycle=this->NextInCycle();
@@ -88,7 +88,7 @@ void wxRadioButton::SetValue(bool val)
bool wxRadioButton::GetValue() const bool wxRadioButton::GetValue() const
{ {
return ::GetControlValue( (ControlHandle) m_macControl ) ; return ::GetControl32BitValue( (ControlHandle) m_macControl ) ;
} }
void wxRadioButton::Command (wxCommandEvent & event) void wxRadioButton::Command (wxCommandEvent & event)

View File

@@ -61,12 +61,12 @@ wxScrollBar::~wxScrollBar()
void wxScrollBar::SetThumbPosition(int viewStart) void wxScrollBar::SetThumbPosition(int viewStart)
{ {
::SetControlValue( (ControlHandle) m_macControl , viewStart ) ; ::SetControl32BitValue( (ControlHandle) m_macControl , viewStart ) ;
} }
int wxScrollBar::GetThumbPosition() const 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, void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageSize,
@@ -78,9 +78,9 @@ void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageS
int range1 = wxMax((m_objectSize - m_viewSize), 0) ; int range1 = wxMax((m_objectSize - m_viewSize), 0) ;
SetControlMaximum( (ControlHandle) m_macControl , range1 ) ; SetControl32BitMaximum( (ControlHandle) m_macControl , range1 ) ;
SetControlMinimum( (ControlHandle) m_macControl , 0 ) ; SetControl32BitMinimum( (ControlHandle) m_macControl , 0 ) ;
SetControlValue( (ControlHandle) m_macControl , position ) ; SetControl32BitValue( (ControlHandle) m_macControl , position ) ;
if ( UMAGetAppearanceVersion() >= 0x0110 ) if ( UMAGetAppearanceVersion() >= 0x0110 )
{ {
@@ -105,9 +105,9 @@ void wxScrollBar::MacHandleControlClick( WXWidget control , wxInt16 controlpart
if ( (ControlHandle) m_macControl == NULL ) if ( (ControlHandle) m_macControl == NULL )
return ; return ;
int position = GetControlValue( (ControlHandle) m_macControl) ; int position = GetControl32BitValue( (ControlHandle) m_macControl) ;
int minPos = GetControlMinimum( (ControlHandle) m_macControl) ; int minPos = GetControl32BitMinimum( (ControlHandle) m_macControl) ;
int maxPos = GetControlMaximum( (ControlHandle) m_macControl) ; int maxPos = GetControl32BitMaximum( (ControlHandle) m_macControl) ;
wxEventType scrollEvent = wxEVT_NULL; wxEventType scrollEvent = wxEVT_NULL;
int nScrollInc; int nScrollInc;

View File

@@ -127,7 +127,7 @@ wxSlider::~wxSlider()
int wxSlider::GetValue() const int wxSlider::GetValue() const
{ {
return GetControlValue( (ControlHandle) m_macControl) ; return GetControl32BitValue( (ControlHandle) m_macControl) ;
} }
void wxSlider::SetValue(int value) void wxSlider::SetValue(int value)
@@ -136,7 +136,7 @@ void wxSlider::SetValue(int value)
valuestring.Printf( "%d" , value ) ; valuestring.Printf( "%d" , value ) ;
if ( m_macValueStatic ) if ( m_macValueStatic )
m_macValueStatic->SetLabel( valuestring ) ; m_macValueStatic->SetLabel( valuestring ) ;
SetControlValue( (ControlHandle) m_macControl , value ) ; SetControl32BitValue( (ControlHandle) m_macControl , value ) ;
} }
void wxSlider::SetRange(int minValue, int maxValue) void wxSlider::SetRange(int minValue, int maxValue)
@@ -146,8 +146,8 @@ void wxSlider::SetRange(int minValue, int maxValue)
m_rangeMin = minValue; m_rangeMin = minValue;
m_rangeMax = maxValue; m_rangeMax = maxValue;
SetControlMinimum( (ControlHandle) m_macControl, m_rangeMin); SetControl32BitMinimum( (ControlHandle) m_macControl, m_rangeMin);
SetControlMaximum( (ControlHandle) m_macControl, m_rangeMax); SetControl32BitMaximum( (ControlHandle) m_macControl, m_rangeMax);
if(m_macMinimumStatic) { if(m_macMinimumStatic) {
value.Printf("%d", m_rangeMin); value.Printf("%d", m_rangeMin);
@@ -241,7 +241,7 @@ void wxSlider::Command (wxCommandEvent & event)
void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart ) void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
{ {
SInt16 value = ::GetControlValue( (ControlHandle) m_macControl ) ; SInt16 value = ::GetControl32BitValue( (ControlHandle) m_macControl ) ;
SetValue( value ) ; SetValue( value ) ;

View File

@@ -90,8 +90,8 @@ void wxSpinButton::SetRange(int minVal, int maxVal)
{ {
m_min = minVal; m_min = minVal;
m_max = maxVal; m_max = maxVal;
SetControlMaximum( (ControlHandle) m_macControl , maxVal ) ; SetControl32BitMaximum( (ControlHandle) m_macControl , maxVal ) ;
SetControlMinimum((ControlHandle) m_macControl , minVal ) ; SetControl32BitMinimum((ControlHandle) m_macControl , minVal ) ;
} }
void wxSpinButton::MacHandleValueChanged( int inc ) void wxSpinButton::MacHandleValueChanged( int inc )
@@ -134,7 +134,7 @@ void wxSpinButton::MacHandleValueChanged( int inc )
{ {
m_value = oldValue ; m_value = oldValue ;
} }
SetControlValue( (ControlHandle) m_macControl , m_value ) ; SetControl32BitValue( (ControlHandle) m_macControl , m_value ) ;
/* always send a thumbtrack event */ /* always send a thumbtrack event */
if (scrollEvent != wxEVT_SCROLL_THUMBTRACK) if (scrollEvent != wxEVT_SCROLL_THUMBTRACK)

View File

@@ -240,11 +240,11 @@ bool wxToolBar::Realize()
} }
if ( tool->CanBeToggled() && tool->IsToggled() ) if ( tool->CanBeToggled() && tool->IsToggled() )
{ {
::SetControlValue( m_macToolHandle , 1 ) ; ::SetControl32BitValue( m_macToolHandle , 1 ) ;
} }
else else
{ {
::SetControlValue( m_macToolHandle , 0 ) ; ::SetControl32BitValue( m_macToolHandle , 0 ) ;
} }
/* /*
::SetControlFontStyle( m_macToolHandle , &controlstyle ) ; ::SetControlFontStyle( m_macToolHandle , &controlstyle ) ;
@@ -336,7 +336,7 @@ void wxToolBar::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
wxToolBarTool *tool = (wxToolBarTool *)m_tools.Nth( index )->Data(); wxToolBarTool *tool = (wxToolBarTool *)m_tools.Nth( index )->Data();
if ( tool->CanBeToggled() ) if ( tool->CanBeToggled() )
{ {
tool->Toggle( GetControlValue( (ControlHandle) control ) ) ; tool->Toggle( GetControl32BitValue( (ControlHandle) control ) ) ;
} }
OnLeftClick( tool->GetId() , tool -> IsToggled() ) ; OnLeftClick( tool->GetId() , tool -> IsToggled() ) ;
break ; break ;
@@ -533,7 +533,7 @@ void wxToolBar::DoToggleTool(wxToolBarToolBase *t, bool toggle)
return ; return ;
ControlHandle control = (ControlHandle) m_macToolHandles[ tool->m_index ] ; ControlHandle control = (ControlHandle) m_macToolHandles[ tool->m_index ] ;
::SetControlValue( control , toggle ) ; ::SetControl32BitValue( control , toggle ) ;
} }
bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos),

View File

@@ -37,6 +37,7 @@
#include "wx/menuitem.h" #include "wx/menuitem.h"
#include "wx/spinctrl.h" #include "wx/spinctrl.h"
#include "wx/log.h" #include "wx/log.h"
#include "wx/geometry.h"
#if wxUSE_CARET #if wxUSE_CARET
#include "wx/caret.h" #include "wx/caret.h"
@@ -1434,6 +1435,48 @@ bool wxWindowMac::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindowMa
extern int wxBusyCursorCount ; extern int wxBusyCursorCount ;
static wxWindow *gs_lastWhich = NULL; 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) bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event)
{ {
if ((event.m_x < m_x) || (event.m_y < m_y) || if ((event.m_x < m_x) || (event.m_y < m_y) ||
@@ -1462,15 +1505,19 @@ bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event)
} }
} }
wxWindow* cursorTarget = this ;
wxPoint cursorPoint( x , y ) ;
while( cursorTarget && !cursorTarget->MacSetupCursor( cursorPoint ) )
{
cursorTarget = cursorTarget->GetParent() ;
if ( cursorTarget )
cursorPoint += cursorTarget->GetPosition() ;
}
event.m_x = x ; event.m_x = x ;
event.m_y = y ; event.m_y = y ;
event.SetEventObject( this ) ; event.SetEventObject( this ) ;
if ( wxBusyCursorCount == 0 )
{
m_cursor.MacInstall() ;
}
if ( event.GetEventType() == wxEVT_LEFT_DOWN ) if ( event.GetEventType() == wxEVT_LEFT_DOWN )
{ {
// set focus to this window // set focus to this window