universal os x fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@46434 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -435,6 +435,7 @@ UInt32 wxIdToMacCommand( int wxId )
|
|||||||
wxMenu* wxFindMenuFromMacCommand( const HICommand &command , wxMenuItem* &item )
|
wxMenu* wxFindMenuFromMacCommand( const HICommand &command , wxMenuItem* &item )
|
||||||
{
|
{
|
||||||
wxMenu* itemMenu = NULL ;
|
wxMenu* itemMenu = NULL ;
|
||||||
|
#ifndef __WXUNIVERSAL__
|
||||||
int id = 0 ;
|
int id = 0 ;
|
||||||
|
|
||||||
// for 'standard' commands which don't have a wx-menu
|
// for 'standard' commands which don't have a wx-menu
|
||||||
@@ -477,7 +478,7 @@ wxMenu* wxFindMenuFromMacCommand( const HICommand &command , wxMenuItem* &item )
|
|||||||
item = (wxMenuItem*) refCon ;
|
item = (wxMenuItem*) refCon ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return itemMenu ;
|
return itemMenu ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -513,6 +514,7 @@ wxMacAppMenuEventHandler( EventHandlerCallRef handler , EventRef event , void *d
|
|||||||
{
|
{
|
||||||
wxMacCarbonEvent cEvent( event ) ;
|
wxMacCarbonEvent cEvent( event ) ;
|
||||||
MenuRef menuRef = cEvent.GetParameter<MenuRef>(kEventParamDirectObject) ;
|
MenuRef menuRef = cEvent.GetParameter<MenuRef>(kEventParamDirectObject) ;
|
||||||
|
#ifndef __WXUNIVERSAL__
|
||||||
wxMenu* menu = wxFindMenuFromMacMenu( menuRef ) ;
|
wxMenu* menu = wxFindMenuFromMacMenu( menuRef ) ;
|
||||||
|
|
||||||
if ( menu )
|
if ( menu )
|
||||||
@@ -558,7 +560,7 @@ wxMacAppMenuEventHandler( EventHandlerCallRef handler , EventRef event , void *d
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return eventNotHandledErr;
|
return eventNotHandledErr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1104,9 +1106,10 @@ void wxApp::OnIdle(wxIdleEvent& event)
|
|||||||
// either events to the threads other than main or events posted with
|
// either events to the threads other than main or events posted with
|
||||||
// wxPostEvent() functions
|
// wxPostEvent() functions
|
||||||
wxMacProcessNotifierAndPendingEvents();
|
wxMacProcessNotifierAndPendingEvents();
|
||||||
|
#ifndef __WXUNIVERSAL__
|
||||||
if (!wxMenuBar::MacGetInstalledMenuBar() && wxMenuBar::MacGetCommonMenuBar())
|
if (!wxMenuBar::MacGetInstalledMenuBar() && wxMenuBar::MacGetCommonMenuBar())
|
||||||
wxMenuBar::MacGetCommonMenuBar()->MacInstallMenuBar();
|
wxMenuBar::MacGetCommonMenuBar()->MacInstallMenuBar();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxApp::WakeUpIdle()
|
void wxApp::WakeUpIdle()
|
||||||
|
@@ -387,7 +387,7 @@ pascal OSErr wxMacWindowDragTrackingHandler(
|
|||||||
wxMacGlobalToLocal( theWindow, &localMouse );
|
wxMacGlobalToLocal( theWindow, &localMouse );
|
||||||
|
|
||||||
{
|
{
|
||||||
wxWindow *win = NULL;
|
wxWindowMac *win = NULL;
|
||||||
ControlPartCode controlPart;
|
ControlPartCode controlPart;
|
||||||
ControlRef control = wxMacFindControlUnderMouse(
|
ControlRef control = wxMacFindControlUnderMouse(
|
||||||
toplevel, localMouse, theWindow, &controlPart );
|
toplevel, localMouse, theWindow, &controlPart );
|
||||||
@@ -422,7 +422,7 @@ pascal OSErr wxMacWindowDragTrackingHandler(
|
|||||||
if ( win )
|
if ( win )
|
||||||
{
|
{
|
||||||
// this window is entered
|
// this window is entered
|
||||||
trackingGlobals->m_currentTargetWindow = win;
|
trackingGlobals->m_currentTargetWindow = (wxWindow*)win;
|
||||||
trackingGlobals->m_currentTarget = win->GetDropTarget();
|
trackingGlobals->m_currentTarget = win->GetDropTarget();
|
||||||
{
|
{
|
||||||
if ( trackingGlobals->m_currentTarget )
|
if ( trackingGlobals->m_currentTarget )
|
||||||
|
@@ -499,7 +499,8 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
currentMouseWindow = wxFindControlFromMacControl( control ) ;
|
currentMouseWindow = (wxWindow*) wxFindControlFromMacControl( control ) ;
|
||||||
|
#ifndef __WXUNIVERSAL__
|
||||||
if ( currentMouseWindow == NULL && cEvent.GetKind() == kEventMouseMoved )
|
if ( currentMouseWindow == NULL && cEvent.GetKind() == kEventMouseMoved )
|
||||||
{
|
{
|
||||||
#if wxUSE_TOOLBAR
|
#if wxUSE_TOOLBAR
|
||||||
@@ -507,11 +508,12 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
|
|||||||
// instead of its children (wxToolBarTools)
|
// instead of its children (wxToolBarTools)
|
||||||
ControlRef parent ;
|
ControlRef parent ;
|
||||||
GetSuperControl(control, &parent );
|
GetSuperControl(control, &parent );
|
||||||
wxWindow *wxParent = wxFindControlFromMacControl( parent ) ;
|
wxWindow *wxParent = (wxWindow*) wxFindControlFromMacControl( parent ) ;
|
||||||
if ( wxParent && wxParent->IsKindOf( CLASSINFO( wxToolBar ) ) )
|
if ( wxParent && wxParent->IsKindOf( CLASSINFO( wxToolBar ) ) )
|
||||||
currentMouseWindow = wxParent ;
|
currentMouseWindow = wxParent ;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// disabled windows must not get any input messages
|
// disabled windows must not get any input messages
|
||||||
@@ -733,6 +735,7 @@ static pascal OSStatus wxMacTopLevelWindowEventHandler( EventHandlerCallRef hand
|
|||||||
wxRect r( newRect.left , newRect.top , newRect.right - newRect.left , newRect.bottom - newRect.top ) ;
|
wxRect r( newRect.left , newRect.top , newRect.right - newRect.left , newRect.bottom - newRect.top ) ;
|
||||||
if ( attributes & kWindowBoundsChangeSizeChanged )
|
if ( attributes & kWindowBoundsChangeSizeChanged )
|
||||||
{
|
{
|
||||||
|
#ifndef __WXUNIVERSAL__
|
||||||
// according to the other ports we handle this within the OS level
|
// according to the other ports we handle this within the OS level
|
||||||
// resize event, not within a wxSizeEvent
|
// resize event, not within a wxSizeEvent
|
||||||
wxFrame *frame = wxDynamicCast( toplevelWindow , wxFrame ) ;
|
wxFrame *frame = wxDynamicCast( toplevelWindow , wxFrame ) ;
|
||||||
@@ -740,7 +743,7 @@ static pascal OSStatus wxMacTopLevelWindowEventHandler( EventHandlerCallRef hand
|
|||||||
{
|
{
|
||||||
frame->PositionBars();
|
frame->PositionBars();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
wxSizeEvent event( r.GetSize() , toplevelWindow->GetId() ) ;
|
wxSizeEvent event( r.GetSize() , toplevelWindow->GetId() ) ;
|
||||||
event.SetEventObject( toplevelWindow ) ;
|
event.SetEventObject( toplevelWindow ) ;
|
||||||
|
|
||||||
|
@@ -121,12 +121,12 @@ END_EVENT_TABLE()
|
|||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
void wxMacNativeToWindow( const wxWindow* window , RgnHandle handle )
|
void wxMacNativeToWindow( const wxWindowMac* window , RgnHandle handle )
|
||||||
{
|
{
|
||||||
OffsetRgn( handle , window->MacGetLeftBorderSize() , window->MacGetTopBorderSize() ) ;
|
OffsetRgn( handle , window->MacGetLeftBorderSize() , window->MacGetTopBorderSize() ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMacNativeToWindow( const wxWindow* window , Rect *rect )
|
void wxMacNativeToWindow( const wxWindowMac* window , Rect *rect )
|
||||||
{
|
{
|
||||||
OffsetRect( rect , window->MacGetLeftBorderSize() , window->MacGetTopBorderSize() ) ;
|
OffsetRect( rect , window->MacGetLeftBorderSize() , window->MacGetTopBorderSize() ) ;
|
||||||
}
|
}
|
||||||
@@ -135,12 +135,12 @@ void wxMacNativeToWindow( const wxWindow* window , Rect *rect )
|
|||||||
// directed towards native control
|
// directed towards native control
|
||||||
//
|
//
|
||||||
|
|
||||||
void wxMacWindowToNative( const wxWindow* window , RgnHandle handle )
|
void wxMacWindowToNative( const wxWindowMac* window , RgnHandle handle )
|
||||||
{
|
{
|
||||||
OffsetRgn( handle , -window->MacGetLeftBorderSize() , -window->MacGetTopBorderSize() );
|
OffsetRgn( handle , -window->MacGetLeftBorderSize() , -window->MacGetTopBorderSize() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMacWindowToNative( const wxWindow* window , Rect *rect )
|
void wxMacWindowToNative( const wxWindowMac* window , Rect *rect )
|
||||||
{
|
{
|
||||||
OffsetRect( rect , -window->MacGetLeftBorderSize() , -window->MacGetTopBorderSize() ) ;
|
OffsetRect( rect , -window->MacGetLeftBorderSize() , -window->MacGetTopBorderSize() ) ;
|
||||||
}
|
}
|
||||||
@@ -266,7 +266,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl
|
|||||||
wxMacCGContextStateSaver sg( cgContext ) ;
|
wxMacCGContextStateSaver sg( cgContext ) ;
|
||||||
float alpha = 1.0 ;
|
float alpha = 1.0 ;
|
||||||
{
|
{
|
||||||
wxWindow* iter = thisWindow ;
|
wxWindowMac* iter = thisWindow ;
|
||||||
while ( iter )
|
while ( iter )
|
||||||
{
|
{
|
||||||
alpha *= (float) iter->GetTransparent()/255.0 ;
|
alpha *= (float) iter->GetTransparent()/255.0 ;
|
||||||
@@ -357,7 +357,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// panel wants to track the window which was the last to have focus in it
|
// panel wants to track the window which was the last to have focus in it
|
||||||
wxChildFocusEvent eventFocus(thisWindow);
|
wxChildFocusEvent eventFocus((wxWindow*)thisWindow);
|
||||||
thisWindow->GetEventHandler()->ProcessEvent(eventFocus);
|
thisWindow->GetEventHandler()->ProcessEvent(eventFocus);
|
||||||
|
|
||||||
#if wxUSE_CARET
|
#if wxUSE_CARET
|
||||||
@@ -571,7 +571,7 @@ pascal OSStatus wxMacUnicodeTextEventHandler( EventHandlerCallRef handler , Even
|
|||||||
I don't have time to look into that right now.
|
I don't have time to look into that right now.
|
||||||
-- CL
|
-- CL
|
||||||
*/
|
*/
|
||||||
if ( wxTheApp->MacSendCharEvent(
|
if ( wxTheApp->MacSendCharEvent((wxWindow*)
|
||||||
focus , message , 0 , when , 0 , 0 , uniChars[pos] ) )
|
focus , message , 0 , when , 0 , 0 , uniChars[pos] ) )
|
||||||
{
|
{
|
||||||
result = noErr ;
|
result = noErr ;
|
||||||
@@ -604,7 +604,7 @@ pascal OSStatus wxMacUnicodeTextEventHandler( EventHandlerCallRef handler , Even
|
|||||||
WXEVENTHANDLERCALLREF formerHandler = wxTheApp->MacGetCurrentEventHandlerCallRef() ;
|
WXEVENTHANDLERCALLREF formerHandler = wxTheApp->MacGetCurrentEventHandlerCallRef() ;
|
||||||
wxTheApp->MacSetCurrentEvent( event , handler ) ;
|
wxTheApp->MacSetCurrentEvent( event , handler ) ;
|
||||||
|
|
||||||
if ( wxTheApp->MacSendCharEvent(
|
if ( wxTheApp->MacSendCharEvent((wxWindow*)
|
||||||
focus , message , modifiers , when , point.h , point.v , uniChars[pos] ) )
|
focus , message , modifiers , when , point.h , point.v , uniChars[pos] ) )
|
||||||
{
|
{
|
||||||
result = noErr ;
|
result = noErr ;
|
||||||
@@ -647,6 +647,7 @@ static pascal OSStatus wxMacWindowCommandEventHandler( EventHandlerCallRef handl
|
|||||||
{
|
{
|
||||||
case kEventProcessCommand :
|
case kEventProcessCommand :
|
||||||
{
|
{
|
||||||
|
// HiliteMenu(0);
|
||||||
if (item->IsCheckable())
|
if (item->IsCheckable())
|
||||||
item->Check( !item->IsChecked() ) ;
|
item->Check( !item->IsChecked() ) ;
|
||||||
|
|
||||||
@@ -896,7 +897,7 @@ pascal void wxMacLiveScrollbarActionProc( ControlRef control , ControlPartCode p
|
|||||||
{
|
{
|
||||||
if ( partCode != 0)
|
if ( partCode != 0)
|
||||||
{
|
{
|
||||||
wxWindow* wx = wxFindControlFromMacControl( control ) ;
|
wxWindowMac* wx = wxFindControlFromMacControl( control ) ;
|
||||||
if ( wx )
|
if ( wx )
|
||||||
wx->MacHandleControlClick( (WXWidget) control , partCode , true /* stillDown */ ) ;
|
wx->MacHandleControlClick( (WXWidget) control , partCode , true /* stillDown */ ) ;
|
||||||
}
|
}
|
||||||
@@ -907,18 +908,18 @@ wxMAC_DEFINE_PROC_GETTER( ControlActionUPP , wxMacLiveScrollbarActionProc ) ;
|
|||||||
// implementation
|
// implementation
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
WX_DECLARE_HASH_MAP(ControlRef, wxWindow*, wxPointerHash, wxPointerEqual, MacControlMap);
|
WX_DECLARE_HASH_MAP(ControlRef, wxWindowMac*, wxPointerHash, wxPointerEqual, MacControlMap);
|
||||||
|
|
||||||
static MacControlMap wxWinMacControlList;
|
static MacControlMap wxWinMacControlList;
|
||||||
|
|
||||||
wxWindow *wxFindControlFromMacControl(ControlRef inControl )
|
wxWindowMac *wxFindControlFromMacControl(ControlRef inControl )
|
||||||
{
|
{
|
||||||
MacControlMap::iterator node = wxWinMacControlList.find(inControl);
|
MacControlMap::iterator node = wxWinMacControlList.find(inControl);
|
||||||
|
|
||||||
return (node == wxWinMacControlList.end()) ? NULL : node->second;
|
return (node == wxWinMacControlList.end()) ? NULL : node->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxAssociateControlWithMacControl(ControlRef inControl, wxWindow *control)
|
void wxAssociateControlWithMacControl(ControlRef inControl, wxWindowMac *control)
|
||||||
{
|
{
|
||||||
// adding NULL ControlRef is (first) surely a result of an error and
|
// adding NULL ControlRef is (first) surely a result of an error and
|
||||||
// (secondly) breaks native event processing
|
// (secondly) breaks native event processing
|
||||||
@@ -927,7 +928,7 @@ void wxAssociateControlWithMacControl(ControlRef inControl, wxWindow *control)
|
|||||||
wxWinMacControlList[inControl] = control;
|
wxWinMacControlList[inControl] = control;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRemoveMacControlAssociation(wxWindow *control)
|
void wxRemoveMacControlAssociation(wxWindowMac *control)
|
||||||
{
|
{
|
||||||
// iterate over all the elements in the class
|
// iterate over all the elements in the class
|
||||||
// is the iterator stable ? as we might have two associations pointing to the same wxWindow
|
// is the iterator stable ? as we might have two associations pointing to the same wxWindow
|
||||||
@@ -1027,7 +1028,7 @@ wxWindowMac::~wxWindowMac()
|
|||||||
// wxRemoveMacControlAssociation( this ) ;
|
// wxRemoveMacControlAssociation( this ) ;
|
||||||
// If we delete an item, we should initialize the parent panel,
|
// If we delete an item, we should initialize the parent panel,
|
||||||
// because it could now be invalid.
|
// because it could now be invalid.
|
||||||
wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
|
wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent((wxWindow*)this), wxTopLevelWindow);
|
||||||
if ( tlw )
|
if ( tlw )
|
||||||
{
|
{
|
||||||
if ( tlw->GetDefaultItem() == (wxButton*) this)
|
if ( tlw->GetDefaultItem() == (wxButton*) this)
|
||||||
@@ -1047,12 +1048,14 @@ wxWindowMac::~wxWindowMac()
|
|||||||
if ( g_MacLastWindow == this )
|
if ( g_MacLastWindow == this )
|
||||||
g_MacLastWindow = NULL ;
|
g_MacLastWindow = NULL ;
|
||||||
|
|
||||||
wxFrame* frame = wxDynamicCast( wxGetTopLevelParent( this ) , wxFrame ) ;
|
#ifndef __WXUNIVERSAL__
|
||||||
|
wxFrame* frame = wxDynamicCast( wxGetTopLevelParent( (wxWindow*)this ) , wxFrame ) ;
|
||||||
if ( frame )
|
if ( frame )
|
||||||
{
|
{
|
||||||
if ( frame->GetLastFocus() == this )
|
if ( frame->GetLastFocus() == this )
|
||||||
frame->SetLastFocus( NULL ) ;
|
frame->SetLastFocus( NULL ) ;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// delete our drop target if we've got one
|
// delete our drop target if we've got one
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
@@ -1123,7 +1126,7 @@ bool wxWindowMac::Create(wxWindowMac *parent,
|
|||||||
| kControlWantsActivate
|
| kControlWantsActivate
|
||||||
| kControlWantsIdle ;
|
| kControlWantsIdle ;
|
||||||
|
|
||||||
m_peer = new wxMacControl(this) ;
|
m_peer = new wxMacControl((wxWindow*)this) ;
|
||||||
OSStatus err =::CreateUserPaneControl( MAC_WXHWND(GetParent()->MacGetTopLevelWindowRef()) , &bounds, features , m_peer->GetControlRefAddr() );
|
OSStatus err =::CreateUserPaneControl( MAC_WXHWND(GetParent()->MacGetTopLevelWindowRef()) , &bounds, features , m_peer->GetControlRefAddr() );
|
||||||
verify_noerr( err );
|
verify_noerr( err );
|
||||||
|
|
||||||
@@ -1139,7 +1142,7 @@ bool wxWindowMac::Create(wxWindowMac *parent,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxWindowCreateEvent event(this);
|
wxWindowCreateEvent event((wxWindow*)this);
|
||||||
GetEventHandler()->AddPendingEvent(event);
|
GetEventHandler()->AddPendingEvent(event);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -1370,7 +1373,7 @@ void wxWindowMac::SetFocus()
|
|||||||
|
|
||||||
void wxWindowMac::DoCaptureMouse()
|
void wxWindowMac::DoCaptureMouse()
|
||||||
{
|
{
|
||||||
wxApp::s_captureWindow = this ;
|
wxApp::s_captureWindow = (wxWindow*)this ;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWindow * wxWindowBase::GetCapture()
|
wxWindow * wxWindowBase::GetCapture()
|
||||||
@@ -1798,7 +1801,8 @@ bool wxWindowMac::SetCursor(const wxCursor& cursor)
|
|||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS
|
||||||
bool wxWindowMac::DoPopupMenu(wxMenu *menu, int x, int y)
|
bool wxWindowMac::DoPopupMenu(wxMenu *menu, int x, int y)
|
||||||
{
|
{
|
||||||
menu->SetInvokingWindow(this);
|
#ifndef __WXUNIVERSAL__
|
||||||
|
menu->SetInvokingWindow((wxWindow*)this);
|
||||||
menu->UpdateUI();
|
menu->UpdateUI();
|
||||||
|
|
||||||
if ( x == wxDefaultCoord && y == wxDefaultCoord )
|
if ( x == wxDefaultCoord && y == wxDefaultCoord )
|
||||||
@@ -1835,6 +1839,10 @@ bool wxWindowMac::DoPopupMenu(wxMenu *menu, int x, int y)
|
|||||||
menu->SetInvokingWindow( NULL );
|
menu->SetInvokingWindow( NULL );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
#else
|
||||||
|
// actually this shouldn't be called, because universal is having its own implementation
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1849,7 +1857,7 @@ void wxWindowMac::DoSetToolTip(wxToolTip *tooltip)
|
|||||||
wxWindowBase::DoSetToolTip(tooltip);
|
wxWindowBase::DoSetToolTip(tooltip);
|
||||||
|
|
||||||
if ( m_tooltip )
|
if ( m_tooltip )
|
||||||
m_tooltip->SetWindow(this);
|
m_tooltip->SetWindow((wxWindow*)this);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -2261,7 +2269,7 @@ bool wxWindowMac::MacIsReallyShown()
|
|||||||
return m_peer->IsVisible();
|
return m_peer->IsVisible();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxWindow* win = this ;
|
wxWindowMac* win = this ;
|
||||||
while ( win->IsShown() )
|
while ( win->IsShown() )
|
||||||
{
|
{
|
||||||
if ( win->IsTopLevel() )
|
if ( win->IsTopLevel() )
|
||||||
@@ -2294,14 +2302,14 @@ void wxWindowMac::MacFlashInvalidAreas()
|
|||||||
|
|
||||||
int wxWindowMac::GetCharHeight() const
|
int wxWindowMac::GetCharHeight() const
|
||||||
{
|
{
|
||||||
wxClientDC dc( (wxWindowMac*)this ) ;
|
wxClientDC dc( (wxWindow*)this ) ;
|
||||||
|
|
||||||
return dc.GetCharHeight() ;
|
return dc.GetCharHeight() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxWindowMac::GetCharWidth() const
|
int wxWindowMac::GetCharWidth() const
|
||||||
{
|
{
|
||||||
wxClientDC dc( (wxWindowMac*)this ) ;
|
wxClientDC dc( (wxWindow*)this ) ;
|
||||||
|
|
||||||
return dc.GetCharWidth() ;
|
return dc.GetCharWidth() ;
|
||||||
}
|
}
|
||||||
@@ -2313,7 +2321,7 @@ void wxWindowMac::GetTextExtent(const wxString& string, int *x, int *y,
|
|||||||
if ( !fontToUse )
|
if ( !fontToUse )
|
||||||
fontToUse = &m_font;
|
fontToUse = &m_font;
|
||||||
|
|
||||||
wxClientDC dc( (wxWindowMac*) this ) ;
|
wxClientDC dc( (wxWindow*)this ) ;
|
||||||
long lx,ly,ld,le ;
|
long lx,ly,ld,le ;
|
||||||
dc.GetTextExtent( string , &lx , &ly , &ld, &le, (wxFont *)fontToUse ) ;
|
dc.GetTextExtent( string , &lx , &ly , &ld, &le, (wxFont *)fontToUse ) ;
|
||||||
if ( externalLeading )
|
if ( externalLeading )
|
||||||
@@ -2384,7 +2392,7 @@ bool wxWindowMac::IsFrozen() const
|
|||||||
return m_frozenness != 0;
|
return m_frozenness != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWindowMac *wxGetActiveWindow()
|
wxWindow *wxGetActiveWindow()
|
||||||
{
|
{
|
||||||
// actually this is a windows-only concept
|
// actually this is a windows-only concept
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -2736,11 +2744,11 @@ void wxWindowMac::MacOnScroll( wxScrollEvent &event )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the window with the focus
|
// Get the window with the focus
|
||||||
wxWindowMac *wxWindowBase::DoFindFocus()
|
wxWindow *wxWindowBase::DoFindFocus()
|
||||||
{
|
{
|
||||||
ControlRef control ;
|
ControlRef control ;
|
||||||
GetKeyboardFocus( GetUserFocusWindow() , &control ) ;
|
GetKeyboardFocus( GetUserFocusWindow() , &control ) ;
|
||||||
return wxFindControlFromMacControl( control ) ;
|
return (wxWindow*)wxFindControlFromMacControl( control ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMac::OnSetFocus( wxFocusEvent& event )
|
void wxWindowMac::OnSetFocus( wxFocusEvent& event )
|
||||||
@@ -2957,12 +2965,12 @@ void wxWindowMac::MacUpdateClippedRects() const
|
|||||||
|
|
||||||
int x , y ;
|
int x , y ;
|
||||||
wxSize size ;
|
wxSize size ;
|
||||||
const wxWindow* child = this ;
|
const wxWindowMac* child = this ;
|
||||||
const wxWindow* parent = NULL ;
|
const wxWindowMac* parent = NULL ;
|
||||||
|
|
||||||
while ( !child->IsTopLevel() && ( parent = child->GetParent() ) != NULL )
|
while ( !child->IsTopLevel() && ( parent = child->GetParent() ) != NULL )
|
||||||
{
|
{
|
||||||
if ( parent->MacIsChildOfClientArea(child) )
|
if ( parent->MacIsChildOfClientArea((wxWindow*)child) )
|
||||||
{
|
{
|
||||||
size = parent->GetClientSize() ;
|
size = parent->GetClientSize() ;
|
||||||
wxPoint origin = parent->GetClientAreaOrigin() ;
|
wxPoint origin = parent->GetClientAreaOrigin() ;
|
||||||
@@ -3039,7 +3047,7 @@ bool wxWindowMac::MacDoRedraw( WXHRGN updatergnr , long time )
|
|||||||
// for all the others only their client area, otherwise they
|
// for all the others only their client area, otherwise they
|
||||||
// might be drawing with full alpha and eg put blue into
|
// might be drawing with full alpha and eg put blue into
|
||||||
// the grow-box area of a scrolled window (scroll sample)
|
// the grow-box area of a scrolled window (scroll sample)
|
||||||
wxDC* dc = new wxWindowDC(this);
|
wxDC* dc = new wxWindowDC((wxWindow*)this);
|
||||||
if ( IsTopLevel() )
|
if ( IsTopLevel() )
|
||||||
dc->SetClippingRegion(wxRegion(updatergn));
|
dc->SetClippingRegion(wxRegion(updatergn));
|
||||||
else
|
else
|
||||||
@@ -3161,10 +3169,10 @@ void wxWindowMac::MacCreateScrollBars( long style )
|
|||||||
wxSize hSize(width - adjust, scrlsize) ;
|
wxSize hSize(width - adjust, scrlsize) ;
|
||||||
|
|
||||||
if ( style & wxVSCROLL )
|
if ( style & wxVSCROLL )
|
||||||
m_vScrollBar = new wxScrollBar(this, wxID_ANY, vPoint, vSize , wxVERTICAL);
|
m_vScrollBar = new wxScrollBar((wxWindow*)this, wxID_ANY, vPoint, vSize , wxVERTICAL);
|
||||||
|
|
||||||
if ( style & wxHSCROLL )
|
if ( style & wxHSCROLL )
|
||||||
m_hScrollBar = new wxScrollBar(this, wxID_ANY, hPoint, hSize , wxHORIZONTAL);
|
m_hScrollBar = new wxScrollBar((wxWindow*)this, wxID_ANY, hPoint, hSize , wxHORIZONTAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// because the create does not take into account the client area origin
|
// because the create does not take into account the client area origin
|
||||||
@@ -3335,12 +3343,12 @@ long wxWindowMac::MacRemoveBordersFromStyle( long style )
|
|||||||
|
|
||||||
// Find the wxWindowMac at the current mouse position, returning the mouse
|
// Find the wxWindowMac at the current mouse position, returning the mouse
|
||||||
// position.
|
// position.
|
||||||
wxWindowMac * wxFindWindowAtPointer( wxPoint& pt )
|
wxWindow * wxFindWindowAtPointer( wxPoint& pt )
|
||||||
{
|
{
|
||||||
pt = wxGetMousePosition();
|
pt = wxGetMousePosition();
|
||||||
wxWindowMac* found = wxFindWindowAtPoint(pt);
|
wxWindowMac* found = wxFindWindowAtPoint(pt);
|
||||||
|
|
||||||
return found;
|
return (wxWindow*) found;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the current mouse position.
|
// Get the current mouse position.
|
||||||
@@ -3390,7 +3398,7 @@ void wxWindowMac::MacHandleControlClick( WXWidget control , wxInt16 controlpart
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Rect wxMacGetBoundsForControl( wxWindow* window , const wxPoint& pos , const wxSize &size , bool adjustForOrigin )
|
Rect wxMacGetBoundsForControl( wxWindowMac* window , const wxPoint& pos , const wxSize &size , bool adjustForOrigin )
|
||||||
{
|
{
|
||||||
int x, y, w, h ;
|
int x, y, w, h ;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user