Implemented wxPopupWindow for wxMotif.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24175 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mattia Barbon
2003-10-14 17:05:28 +00:00
parent 58b2e303b1
commit 833a51f67e
9 changed files with 141 additions and 22 deletions

View File

@@ -28,7 +28,7 @@
#pragma hdrstop
#endif
#if wxUSE_POPUPWIN && !defined(__WXMOTIF__)
#if wxUSE_POPUPWIN
#include "wx/popupwin.h"

70
src/motif/popupwin.cpp Normal file
View File

@@ -0,0 +1,70 @@
/////////////////////////////////////////////////////////////////////////////
// Name: popupwin.cpp
// Purpose: wxPopupWindow implementation
// Author: Mattia barbon
// Modified by:
// Created: 28.08.03
// RCS-ID: $Id$
// Copyright: (c) Mattia barbon
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "popup.h"
#endif
#include "wx/popupwin.h"
#include "wx/app.h"
#ifdef __VMS__
#pragma message disable nosimpint
#endif
#include <Xm/Xm.h>
#ifdef __VMS__
#pragma message enable nosimpint
#endif
#include "wx/motif/private.h"
IMPLEMENT_DYNAMIC_CLASS( wxPopupWindow, wxWindow );
bool wxPopupWindow::Create( wxWindow *parent, int flags )
{
if( !wxPopupWindowBase::Create( parent, flags ) )
return false;
SetParent( parent );
if( parent )
parent->AddChild( this );
Widget popup = XtVaCreatePopupShell( "shell",
overrideShellWidgetClass,
(Widget)wxTheApp->GetTopLevelWidget(),
NULL );
m_mainWidget = (WXWidget)popup;
SetSize( 100, 100 ); // for child creation to work
XtSetMappedWhenManaged( popup, False );
XtRealizeWidget( popup );
return true;
}
bool wxPopupWindow::Show( bool show )
{
if( !wxWindowBase::Show( show ) )
return false;
if( show )
{
XtPopup( (Widget)GetMainWidget(), XtGrabNone );
}
else
{
XtPopdown( (Widget)GetMainWidget() );
}
return true;
}