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:
@@ -955,9 +955,9 @@ pascal SInt32 AGAProgressBarDefProc (SInt16 procID, ControlHandle theControl, Co
|
||||
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 ) ) ;
|
||||
}
|
||||
@@ -1052,7 +1052,7 @@ pascal SInt32 AGABevelButtonDefProc (SInt16 procID, ControlHandle theControl, Co
|
||||
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);
|
||||
@@ -1193,7 +1193,7 @@ pascal SInt32 AGAButtonDefProc (SInt16 procID, ControlHandle theControl, Control
|
||||
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);
|
||||
@@ -1429,7 +1429,7 @@ pascal SInt32 AGACheckBoxDefProc (SInt16 procID, ControlHandle theControl, Contr
|
||||
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 ;
|
||||
@@ -1625,7 +1625,7 @@ pascal SInt32 AGARadioButtonDefProc (SInt16 procID, ControlHandle theControl, Co
|
||||
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 ;
|
||||
|
@@ -955,9 +955,9 @@ pascal SInt32 AGAProgressBarDefProc (SInt16 procID, ControlHandle theControl, Co
|
||||
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 ) ) ;
|
||||
}
|
||||
@@ -1052,7 +1052,7 @@ pascal SInt32 AGABevelButtonDefProc (SInt16 procID, ControlHandle theControl, Co
|
||||
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);
|
||||
@@ -1193,7 +1193,7 @@ pascal SInt32 AGAButtonDefProc (SInt16 procID, ControlHandle theControl, Control
|
||||
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);
|
||||
@@ -1429,7 +1429,7 @@ pascal SInt32 AGACheckBoxDefProc (SInt16 procID, ControlHandle theControl, Contr
|
||||
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 ;
|
||||
@@ -1625,7 +1625,7 @@ pascal SInt32 AGARadioButtonDefProc (SInt16 procID, ControlHandle theControl, Co
|
||||
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 ;
|
||||
|
@@ -46,13 +46,13 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
|
||||
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)
|
||||
|
@@ -50,10 +50,10 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
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() ;
|
||||
|
||||
@@ -77,7 +77,7 @@ int wxChoice::DoAppend(const wxString& item)
|
||||
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 ;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ void wxChoice::Delete(int n)
|
||||
::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()
|
||||
@@ -106,7 +106,7 @@ void wxChoice::Clear()
|
||||
}
|
||||
m_strings.Empty() ;
|
||||
m_datas.Empty() ;
|
||||
SetControlMaximum( (ControlHandle) m_macControl , 0 ) ;
|
||||
SetControl32BitMaximum( (ControlHandle) m_macControl , 0 ) ;
|
||||
}
|
||||
|
||||
void wxChoice::FreeData()
|
||||
@@ -127,12 +127,12 @@ 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 ) ;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -61,13 +61,13 @@ void wxGauge::SetBezelFace(int w)
|
||||
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
|
||||
|
@@ -205,7 +205,7 @@ int wxNotebook::SetSelection(int nPage)
|
||||
return m_nSelection ;
|
||||
|
||||
ChangePage(m_nSelection, nPage);
|
||||
SetControlValue( (ControlHandle) m_macControl , m_nSelection + 1 ) ;
|
||||
SetControl32BitValue( (ControlHandle) m_macControl , m_nSelection + 1 ) ;
|
||||
|
||||
return m_nSelection;
|
||||
}
|
||||
@@ -328,7 +328,7 @@ bool wxNotebook::InsertPage(int nPage,
|
||||
*/
|
||||
void wxNotebook::MacSetupTabs()
|
||||
{
|
||||
SetControlMaximum( (ControlHandle) m_macControl , GetPageCount() ) ;
|
||||
SetControl32BitMaximum( (ControlHandle) m_macControl , GetPageCount() ) ;
|
||||
|
||||
wxNotebookPage *page;
|
||||
ControlTabInfoRec info;
|
||||
@@ -518,7 +518,7 @@ void wxNotebook::OnMouse( wxMouseEvent &event )
|
||||
{
|
||||
{
|
||||
wxNotebookEvent changing(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId,
|
||||
::GetControlValue(control) - 1, m_nSelection);
|
||||
::GetControl32BitValue(control) - 1, m_nSelection);
|
||||
changing.SetEventObject(this);
|
||||
ProcessEvent(changing);
|
||||
|
||||
@@ -529,7 +529,7 @@ void wxNotebook::OnMouse( wxMouseEvent &event )
|
||||
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);
|
||||
@@ -543,7 +543,7 @@ void wxNotebook::OnMouse( wxMouseEvent &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);
|
||||
|
@@ -69,10 +69,10 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
|
||||
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();
|
||||
@@ -88,7 +88,7 @@ void wxRadioButton::SetValue(bool val)
|
||||
|
||||
bool wxRadioButton::GetValue() const
|
||||
{
|
||||
return ::GetControlValue( (ControlHandle) m_macControl ) ;
|
||||
return ::GetControl32BitValue( (ControlHandle) m_macControl ) ;
|
||||
}
|
||||
|
||||
void wxRadioButton::Command (wxCommandEvent & event)
|
||||
|
@@ -61,12 +61,12 @@ wxScrollBar::~wxScrollBar()
|
||||
|
||||
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,
|
||||
@@ -78,9 +78,9 @@ void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageS
|
||||
|
||||
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 )
|
||||
{
|
||||
@@ -105,9 +105,9 @@ void wxScrollBar::MacHandleControlClick( WXWidget control , wxInt16 controlpart
|
||||
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;
|
||||
|
@@ -127,7 +127,7 @@ wxSlider::~wxSlider()
|
||||
|
||||
int wxSlider::GetValue() const
|
||||
{
|
||||
return GetControlValue( (ControlHandle) m_macControl) ;
|
||||
return GetControl32BitValue( (ControlHandle) m_macControl) ;
|
||||
}
|
||||
|
||||
void wxSlider::SetValue(int value)
|
||||
@@ -136,7 +136,7 @@ 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)
|
||||
@@ -146,8 +146,8 @@ 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);
|
||||
@@ -241,7 +241,7 @@ void wxSlider::Command (wxCommandEvent & event)
|
||||
|
||||
void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
|
||||
{
|
||||
SInt16 value = ::GetControlValue( (ControlHandle) m_macControl ) ;
|
||||
SInt16 value = ::GetControl32BitValue( (ControlHandle) m_macControl ) ;
|
||||
|
||||
SetValue( value ) ;
|
||||
|
||||
|
@@ -90,8 +90,8 @@ void wxSpinButton::SetRange(int minVal, int maxVal)
|
||||
{
|
||||
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 )
|
||||
@@ -134,7 +134,7 @@ 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)
|
||||
|
@@ -240,11 +240,11 @@ bool wxToolBar::Realize()
|
||||
}
|
||||
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 ) ;
|
||||
@@ -336,7 +336,7 @@ void wxToolBar::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
|
||||
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 ;
|
||||
@@ -533,7 +533,7 @@ void wxToolBar::DoToggleTool(wxToolBarToolBase *t, bool toggle)
|
||||
return ;
|
||||
|
||||
ControlHandle control = (ControlHandle) m_macToolHandles[ tool->m_index ] ;
|
||||
::SetControlValue( control , toggle ) ;
|
||||
::SetControl32BitValue( control , toggle ) ;
|
||||
}
|
||||
|
||||
bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos),
|
||||
|
@@ -37,6 +37,7 @@
|
||||
#include "wx/menuitem.h"
|
||||
#include "wx/spinctrl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/geometry.h"
|
||||
|
||||
#if wxUSE_CARET
|
||||
#include "wx/caret.h"
|
||||
@@ -1434,6 +1435,48 @@ bool wxWindowMac::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindowMa
|
||||
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) ||
|
||||
@@ -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_y = y ;
|
||||
event.SetEventObject( this ) ;
|
||||
|
||||
if ( wxBusyCursorCount == 0 )
|
||||
{
|
||||
m_cursor.MacInstall() ;
|
||||
}
|
||||
|
||||
if ( event.GetEventType() == wxEVT_LEFT_DOWN )
|
||||
{
|
||||
// set focus to this window
|
||||
|
@@ -46,13 +46,13 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
|
||||
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)
|
||||
|
@@ -50,10 +50,10 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
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() ;
|
||||
|
||||
@@ -77,7 +77,7 @@ int wxChoice::DoAppend(const wxString& item)
|
||||
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 ;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ void wxChoice::Delete(int n)
|
||||
::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()
|
||||
@@ -106,7 +106,7 @@ void wxChoice::Clear()
|
||||
}
|
||||
m_strings.Empty() ;
|
||||
m_datas.Empty() ;
|
||||
SetControlMaximum( (ControlHandle) m_macControl , 0 ) ;
|
||||
SetControl32BitMaximum( (ControlHandle) m_macControl , 0 ) ;
|
||||
}
|
||||
|
||||
void wxChoice::FreeData()
|
||||
@@ -127,12 +127,12 @@ 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 ) ;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -61,13 +61,13 @@ void wxGauge::SetBezelFace(int w)
|
||||
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
|
||||
|
@@ -205,7 +205,7 @@ int wxNotebook::SetSelection(int nPage)
|
||||
return m_nSelection ;
|
||||
|
||||
ChangePage(m_nSelection, nPage);
|
||||
SetControlValue( (ControlHandle) m_macControl , m_nSelection + 1 ) ;
|
||||
SetControl32BitValue( (ControlHandle) m_macControl , m_nSelection + 1 ) ;
|
||||
|
||||
return m_nSelection;
|
||||
}
|
||||
@@ -328,7 +328,7 @@ bool wxNotebook::InsertPage(int nPage,
|
||||
*/
|
||||
void wxNotebook::MacSetupTabs()
|
||||
{
|
||||
SetControlMaximum( (ControlHandle) m_macControl , GetPageCount() ) ;
|
||||
SetControl32BitMaximum( (ControlHandle) m_macControl , GetPageCount() ) ;
|
||||
|
||||
wxNotebookPage *page;
|
||||
ControlTabInfoRec info;
|
||||
@@ -518,7 +518,7 @@ void wxNotebook::OnMouse( wxMouseEvent &event )
|
||||
{
|
||||
{
|
||||
wxNotebookEvent changing(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId,
|
||||
::GetControlValue(control) - 1, m_nSelection);
|
||||
::GetControl32BitValue(control) - 1, m_nSelection);
|
||||
changing.SetEventObject(this);
|
||||
ProcessEvent(changing);
|
||||
|
||||
@@ -529,7 +529,7 @@ void wxNotebook::OnMouse( wxMouseEvent &event )
|
||||
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);
|
||||
@@ -543,7 +543,7 @@ void wxNotebook::OnMouse( wxMouseEvent &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);
|
||||
|
@@ -69,10 +69,10 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
|
||||
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();
|
||||
@@ -88,7 +88,7 @@ void wxRadioButton::SetValue(bool val)
|
||||
|
||||
bool wxRadioButton::GetValue() const
|
||||
{
|
||||
return ::GetControlValue( (ControlHandle) m_macControl ) ;
|
||||
return ::GetControl32BitValue( (ControlHandle) m_macControl ) ;
|
||||
}
|
||||
|
||||
void wxRadioButton::Command (wxCommandEvent & event)
|
||||
|
@@ -61,12 +61,12 @@ wxScrollBar::~wxScrollBar()
|
||||
|
||||
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,
|
||||
@@ -78,9 +78,9 @@ void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageS
|
||||
|
||||
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 )
|
||||
{
|
||||
@@ -105,9 +105,9 @@ void wxScrollBar::MacHandleControlClick( WXWidget control , wxInt16 controlpart
|
||||
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;
|
||||
|
@@ -127,7 +127,7 @@ wxSlider::~wxSlider()
|
||||
|
||||
int wxSlider::GetValue() const
|
||||
{
|
||||
return GetControlValue( (ControlHandle) m_macControl) ;
|
||||
return GetControl32BitValue( (ControlHandle) m_macControl) ;
|
||||
}
|
||||
|
||||
void wxSlider::SetValue(int value)
|
||||
@@ -136,7 +136,7 @@ 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)
|
||||
@@ -146,8 +146,8 @@ 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);
|
||||
@@ -241,7 +241,7 @@ void wxSlider::Command (wxCommandEvent & event)
|
||||
|
||||
void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
|
||||
{
|
||||
SInt16 value = ::GetControlValue( (ControlHandle) m_macControl ) ;
|
||||
SInt16 value = ::GetControl32BitValue( (ControlHandle) m_macControl ) ;
|
||||
|
||||
SetValue( value ) ;
|
||||
|
||||
|
@@ -90,8 +90,8 @@ void wxSpinButton::SetRange(int minVal, int maxVal)
|
||||
{
|
||||
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 )
|
||||
@@ -134,7 +134,7 @@ 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)
|
||||
|
@@ -240,11 +240,11 @@ bool wxToolBar::Realize()
|
||||
}
|
||||
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 ) ;
|
||||
@@ -336,7 +336,7 @@ void wxToolBar::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
|
||||
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 ;
|
||||
@@ -533,7 +533,7 @@ void wxToolBar::DoToggleTool(wxToolBarToolBase *t, bool toggle)
|
||||
return ;
|
||||
|
||||
ControlHandle control = (ControlHandle) m_macToolHandles[ tool->m_index ] ;
|
||||
::SetControlValue( control , toggle ) ;
|
||||
::SetControl32BitValue( control , toggle ) ;
|
||||
}
|
||||
|
||||
bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos),
|
||||
|
@@ -37,6 +37,7 @@
|
||||
#include "wx/menuitem.h"
|
||||
#include "wx/spinctrl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/geometry.h"
|
||||
|
||||
#if wxUSE_CARET
|
||||
#include "wx/caret.h"
|
||||
@@ -1434,6 +1435,48 @@ bool wxWindowMac::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindowMa
|
||||
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) ||
|
||||
@@ -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_y = y ;
|
||||
event.SetEventObject( this ) ;
|
||||
|
||||
if ( wxBusyCursorCount == 0 )
|
||||
{
|
||||
m_cursor.MacInstall() ;
|
||||
}
|
||||
|
||||
if ( event.GetEventType() == wxEVT_LEFT_DOWN )
|
||||
{
|
||||
// set focus to this window
|
||||
|
Reference in New Issue
Block a user