- if ( ! wxPopupWindowBase::Create(parent) )
- return false;
-
- WindowClass wclass = kHelpWindowClass;
- WindowAttributes attr = kWindowCompositingAttribute ;
-
- Rect bounds = { 0,0,0,0 };
- OSStatus err = ::CreateNewWindow( wclass , attr , &bounds , (WindowRef*)&m_popupWindowRef ) ;
- if ( err == noErr )
- {
-#if 0
- WindowRef parentWindow =(WindowRef) parent->MacGetTopLevelWindowRef();
- SetWindowGroup( (WindowRef) m_popupWindowRef, GetWindowGroup(parentWindow)); // Put them in the same group so that their window layers are consistent
-#endif
-}
-
- m_peer = new wxMacControl(this , true /*isRootControl*/) ;
-
- HIViewFindByID( HIViewGetRoot( (WindowRef) m_popupWindowRef ) , kHIViewWindowContentID ,
- m_peer->GetControlRefAddr() ) ;
- if ( !m_peer->Ok() )
-{
- // compatibility mode fallback
- GetRootControl( (WindowRef) m_popupWindowRef , m_peer->GetControlRefAddr() ) ;
- if ( !m_peer->Ok() )
- CreateRootControl( (WindowRef) m_popupWindowRef , m_peer->GetControlRefAddr() ) ;
- }
-
- // the root control level handler
- MacInstallEventHandler( (WXWidget) m_peer->GetControlRef() ) ;
-
- // the frame window event handler
- InstallStandardEventHandler( GetWindowEventTarget(MAC_WXHWND(m_popupWindowRef)) ) ;
- // MacInstallTopLevelWindowEventHandler() ;
-
- if ( parent )
- parent->AddChild(this);
-
- return true;
-}
-
-void wxPopupWindow::DoMoveWindow(int x, int y, int width, int height)
-{
- Rect bounds = { y , x , y + height , x + width } ;
- verify_noerr(SetWindowBounds( (WindowRef) m_popupWindowRef, kWindowStructureRgn , &bounds )) ;
- wxWindowMac::MacSuperChangedPosition() ; // like this only children will be notified
-}
-
-void wxPopupWindow::DoGetPosition( int *x, int *y ) const
- {
- Rect bounds ;
-
- verify_noerr(GetWindowBounds((WindowRef) m_popupWindowRef, kWindowStructureRgn , &bounds )) ;