// associate mac windows with wx counterparts
wxTopLevelWindowMac* wxFindWinFromMacWindow( WXWindow inWindow ) ;
-void wxAssociateWinWithMacWindow(WXWindow inWindow, wxTopLevelWindowMac *win) ;
void wxRemoveMacWindowAssociation(wxTopLevelWindowMac *win) ;
::GetWindowAttributes( frontWindow , &frontWindowAttributes ) ;
short windowPart = ::FindWindow(ev->where, &window);
- wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ;
+ wxTopLevelWindowMac* win = wxFindWinFromMacWindow( (WXWindow) window ) ;
if ( wxPendingDelete.Member(win) )
return ;
break ;
default:
{
- wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ;
+ wxTopLevelWindowMac* win = wxFindWinFromMacWindow( (WXWindow) window ) ;
if ( win )
win->MacMouseUp( ev , windowPart ) ;
}
{
// if window is not having a focus still testing for default enter or cancel
// TODO add the UMA version for ActiveNonFloatingWindow
- wxWindow* focus = wxFindWinFromMacWindow( FrontWindow() ) ;
+ wxWindow* focus = wxFindWinFromMacWindow( (WXWindow) FrontWindow() ) ;
if ( focus )
{
if ( keyval == WXK_RETURN )
// if it is a floater we activate/deactivate the front non-floating window instead
window = ::FrontNonFloatingWindow() ;
}
- wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ;
+ wxTopLevelWindowMac* win = wxFindWinFromMacWindow( (WXWindow) window ) ;
if ( win )
win->MacActivate( ev->when , activate ) ;
}
{
EventRecord* ev = (EventRecord*) evr ;
WindowRef window = (WindowRef) ev->message ;
- wxTopLevelWindowMac * win = wxFindWinFromMacWindow( window ) ;
+ wxTopLevelWindowMac * win = wxFindWinFromMacWindow( (WXWindow) window ) ;
if ( win )
{
if ( !wxPendingDelete.Member(win) )
if ( oldFrontWindow )
{
- wxTopLevelWindowMac* win = wxFindWinFromMacWindow( oldFrontWindow ) ;
+ wxTopLevelWindowMac* win = wxFindWinFromMacWindow( (WXWindow) oldFrontWindow ) ;
if ( win )
win->MacActivate( ev->when , false ) ;
}
if ( newFrontWindow )
{
- wxTopLevelWindowMac* win = wxFindWinFromMacWindow( newFrontWindow ) ;
+ wxTopLevelWindowMac* win = wxFindWinFromMacWindow( (WXWindow) newFrontWindow ) ;
if ( win )
win->MacActivate( ev->when , true ) ;
}
{
case inContent :
{
- wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ;
+ wxTopLevelWindowMac* win = wxFindWinFromMacWindow( (WXWindow) window ) ;
if ( win )
win->MacMouseMoved( ev , windowPart ) ;
else
MacPreControlCreate( parent , id , wxEmptyString , pos , wxSize( width , height ) ,style, validator , name , &bounds , title ) ;
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 ,
+ m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 ,
kControlBehaviorOffsetContents +
( bmap && bmap->m_bitmapType == kMacBitmapTypeIcon ?
kControlContentCIconHandle : kControlContentPictHandle ) , 0,
MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ;
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
+ m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
kControlPushButtonProc , (long) this ) ;
wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
maxValue = 2 /* kControlCheckboxMixedValue */;
}
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , maxValue,
+ m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , maxValue,
kControlCheckBoxProc , (long) this ) ;
MacPostControlCreate() ;
long result ;
wxStAppResource resload ;
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false ,
+ m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false ,
kwxMacListWithVerticalScrollbar , 0 , 0,
kControlListBoxProc , (long) this ) ;
::GetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlListBoxListHandleTag ,
Str255 title ;
MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ;
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , -12345 , 0 ,
+ m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , -12345 , 0 ,
kControlPopupButtonProc + kControlPopupFixedWidthVariant , (long) this ) ;
m_macPopUpMenuHandle = NewUniqueMenu() ;
wxControl* wx = (wxControl*) GetControlReference( control ) ;
if ( wx )
{
- wx->MacHandleControlClick( control , partCode , true /* stillDown */ ) ;
+ wx->MacHandleControlClick( (WXWidget) control , partCode , true /* stillDown */ ) ;
}
}
}
wxTheApp->s_lastMouseDown = 0 ;
if ( control && controlpart != kControlNoPart )
{
- MacHandleControlClick( control , controlpart , false /* mouse not down anymore */ ) ;
+ MacHandleControlClick( (WXWidget) control , controlpart , false /* mouse not down anymore */ ) ;
}
}
}
// and make this NORMAL later, but first
// we have a few calculations that we must fix
- if ( variant == wxWINDOW_VARIANT_DEFAULT )
+ if ( variant == wxWINDOW_VARIANT_NORMAL )
{
if ( IsKindOf( CLASSINFO( wxScrollBar ) ) )
variant = wxWINDOW_VARIANT_NORMAL ;
#endif
-wxDialog::Init()
+void wxDialog::Init()
{
m_isModalStyle = false;
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
Point mouse, localMouse;
DragAttributes attributes;
GetDragAttributes(theDrag, &attributes);
- wxTopLevelWindowMac* toplevel = wxFindWinFromMacWindow( theWindow ) ;
+ wxTopLevelWindowMac* toplevel = wxFindWinFromMacWindow( (WXWindow) theWindow ) ;
KeyMap keymap;
GetKeys(keymap);
MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style & 0xE0FFFFFF /* no borders on mac */ , validator , name , &bounds , title ) ;
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , range,
+ m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , range,
kControlProgressBarProc , (long) this ) ;
MacPostControlCreate() ;
long result ;
wxStAppResource resload ;
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false ,
+ m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false ,
(style & wxLB_HSCROLL) ? kwxMacListWithVerticalAndHorizontalScrollbar : kwxMacListWithVerticalScrollbar ,
0 , 0, kControlListBoxProc , (long) this ) ;
::GetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlListBoxListHandleTag ,
tabstyle = kControlTabSmallSouthProc ;
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
+ m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
tabstyle , (long) this ) ;
MacPostControlCreate() ;
MacPreControlCreate( parent , id , wxStripMenuCodes(label) , pos , size ,style, val , name , &bounds , title ) ;
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
+ m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
kControlGroupBoxTextTitleProc , (long) this ) ;
for (i = 0; i < n; i++)
MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ;
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
+ m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
kControlRadioButtonProc , (long) this ) ;
MacPostControlCreate() ;
MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ;
- m_macControl = ::NewControl(MAC_WXHWND(parent->MacGetRootWindow()) ,
+ m_macControl = (WXWidget) ::NewControl(MAC_WXHWND(parent->MacGetRootWindow()) ,
&bounds , title , false , 0 , 0 , 100,
kControlScrollBarLiveProc , (long) this) ;
}
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, title, false,
+ m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()), &bounds, title, false,
value, minValue, maxValue, procID, (long) this);
wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style,*( (wxValidator*) NULL ) , name , &bounds , title ) ;
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 100,
+ m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 100,
kControlLittleArrowsProc , (long) this ) ;
wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
MacPreControlCreate( parent , id , label , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
+ m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
kControlGroupBoxTextTitleProc , (long) this ) ;
MacPostControlCreate() ;
MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
+ m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
kControlSeparatorLineProc , (long) this ) ;
MacPostControlCreate() ;
MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
+ m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
kControlTabSmallProc , (long) this ) ;
MacPostControlCreate() ;
wxMacConvertNewlines13To10( &st ) ;
if ( !m_macUsesTXN )
{
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , "\p" , false , 0 , 0 , 1,
+ m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , "\p" , false , 0 , 0 , 1,
(style & wxTE_PASSWORD) ? kControlEditTextPasswordProc : kControlEditTextProc , (long) this ) ;
long size ;
::GetControlData((ControlHandle) m_macControl , 0, kControlEditTextTEHandleTag , sizeof( TEHandle ) , (char*)((TEHandle *)&m_macTE) , &size ) ;
| kControlWantsActivate | kControlHandlesTracking | kControlHasSpecialBackground
| kControlGetsFocusOnClick | kControlSupportsLiveFeedback;
/* create the control */
- m_macControl = NewControl(MAC_WXHWND(parent->MacGetRootWindow()), &bounds, "\p", false , featurSet, 0, featurSet, kControlUserPaneProc, 0);
+ m_macControl = (WXWidget) ::NewControl(MAC_WXHWND(parent->MacGetRootWindow()), &bounds, "\p", false , featurSet, 0, featurSet, kControlUserPaneProc, 0);
/* set up the mUP specific features and data */
mUPOpenControl((ControlHandle) m_macControl, m_windowStyle );
}
wxToolBarTool* tool = (wxToolBarTool*) node->GetData() ;
if ( tool->IsButton() )
{
- if( tool->GetControlHandle() == control )
+ if( (WXWidget) tool->GetControlHandle() == control )
{
if ( tool->CanBeToggled() )
{
wxTheApp->s_lastMouseDown = 0 ;
if ( control && controlpart != kControlNoPart ) // otherwise we will get the event twice
{
- MacHandleControlClick( control , controlpart , false /* not down anymore */ ) ;
+ MacHandleControlClick( (WXWidget) control , controlpart , false /* not down anymore */ ) ;
}
}
}
return (wxTopLevelWindowMac *)node->GetData();
}
-void wxAssociateWinWithMacWindow(WXWindow inWindowRef, wxTopLevelWindowMac *win)
+void wxAssociateWinWithMacWindow(WindowRef inWindowRef, wxTopLevelWindowMac *win);
+void wxAssociateWinWithMacWindow(WindowRef inWindowRef, wxTopLevelWindowMac *win)
{
// adding NULL WindowRef is (first) surely a result of an error and
// (secondly) breaks menu command processing
// wxTopLevelWindowMac creation
// ----------------------------------------------------------------------------
-WXHWND wxTopLevelWindowMac::s_macWindowInUpdate = NULL;
+WXWindow wxTopLevelWindowMac::s_macWindowInUpdate = NULL;
wxTopLevelWindowMac *wxTopLevelWindowMac::s_macDeactivateWindow = NULL;
bool wxTopLevelWindowMac::s_macWindowCompositing = FALSE;
}
wxCHECK_RET( err == noErr, wxT("Mac OS error when trying to create new window") );
- wxAssociateWinWithMacWindow( m_macWindow , this ) ;
+ wxAssociateWinWithMacWindow( (WindowRef) m_macWindow , this ) ;
UMASetWTitle( (WindowRef)m_macWindow , title , m_font.GetEncoding() ) ;
if ( wxTopLevelWindowMac::s_macWindowCompositing )
{
return oldval;
}
-void wxTopLevelWindowMac::MacGetPortParams(WXPOINTPTR localOrigin, WXRECTPTR clipRect, WXHWND *window , wxWindowMac** rootwin)
+void wxTopLevelWindowMac::MacGetPortParams(WXPOINTPTR localOrigin, WXRECTPTR clipRect, WXWindow *window , wxWindowMac** rootwin)
{
((Point*)localOrigin)->h = 0;
((Point*)localOrigin)->v = 0;
wxWindowMac* parent = GetParent() ;
while( parent )
{
- if ( parent->MacGetRootWindow() != window )
+ if ( parent->MacGetRootWindow() != (WXWindow) window )
{
// we are in a different window on the mac system
parent = NULL ;
{
wxWindowMac *child = node->GetData();
// added the m_isShown test --dmazzoni
- if ( child->MacGetRootWindow() == window && child->m_isShown )
+ if ( child->MacGetRootWindow() == (WXWindow) window && child->m_isShown )
{
if (child->MacGetWindowFromPointSub(newPoint , outWin ))
return TRUE;
if ( ::FindWindow( pt , &window ) == 3 )
{
- wxWindowMac* win = wxFindWinFromMacWindow( window ) ;
+ wxWindowMac* win = wxFindWinFromMacWindow( (WXWindow) window ) ;
if ( win )
{
// No, this yields the CLIENT are, we need the whole frame. RR.
for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext())
{
wxWindowMac *child = node->GetData();
- if ( child->MacGetRootWindow() == window && child->IsShown() && child->IsEnabled() )
+ if ( child->MacGetRootWindow() == (WXWindow) window && child->IsShown() && child->IsEnabled() )
{
if (child->MacDispatchMouseEvent(event))
return TRUE;
WindowRef window = (WindowRef) MacGetRootWindow() ;
if ( window )
{
- win = wxFindWinFromMacWindow( window ) ;
+ win = wxFindWinFromMacWindow( (WXWindow) window ) ;
}
return win ;
}
{
wxControl *child = wxDynamicCast( ( wxWindow*)node->GetData() , wxControl ) ;
- if ( child && child->MacGetRootWindow() == window && child->IsShown() && child->GetMacControl() )
+ if ( child && child->MacGetRootWindow() == (WXWindow) window && child->IsShown() && child->GetMacControl() )
{
SetControlVisibility( (ControlHandle) child->GetMacControl() , false , false ) ;
hiddenWindows.Append( child ) ;
SetRectRgn( childupdate , child->m_x , child->m_y , child->m_x + child->m_width , child->m_y + child->m_height ) ;
SectRgn( childupdate , updatergn , childupdate ) ;
OffsetRgn( childupdate , -child->m_x , -child->m_y ) ;
- if ( child->MacGetRootWindow() == window && child->IsShown() && !EmptyRgn( childupdate ) )
+ if ( child->MacGetRootWindow() == (WXWindow) window && child->IsShown() && !EmptyRgn( childupdate ) )
{
// because dialogs may also be children
child->MacRedraw( childupdate , time , erase ) ;
}
-WXHWND wxWindowMac::MacGetRootWindow() const
+WXWindow wxWindowMac::MacGetRootWindow() const
{
wxWindowMac *iter = (wxWindowMac*)this ;