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:
17
Makefile.in
17
Makefile.in
@@ -1529,6 +1529,7 @@ COND_TOOLKIT_MOTIF_GUI_HDR = \
|
||||
wx/motif/minifram.h \
|
||||
wx/motif/msgdlg.h \
|
||||
wx/motif/palette.h \
|
||||
wx/motif/popupwin.h \
|
||||
wx/motif/print.h \
|
||||
wx/motif/private.h \
|
||||
wx/motif/radiobox.h \
|
||||
@@ -3405,6 +3406,7 @@ COND_TOOLKIT_MOTIF___GUI_SRC_OBJECTS = \
|
||||
monodll_minifram.o \
|
||||
monodll_msgdlg.o \
|
||||
monodll_palette.o \
|
||||
monodll_popupwin.o \
|
||||
monodll_radiobox.o \
|
||||
monodll_radiobut.o \
|
||||
monodll_scrolbar.o \
|
||||
@@ -3800,6 +3802,7 @@ COND_TOOLKIT_MOTIF___GUI_SRC_OBJECTS_1 = \
|
||||
monolib_minifram.o \
|
||||
monolib_msgdlg.o \
|
||||
monolib_palette.o \
|
||||
monolib_popupwin.o \
|
||||
monolib_radiobox.o \
|
||||
monolib_radiobut.o \
|
||||
monolib_scrolbar.o \
|
||||
@@ -4195,6 +4198,7 @@ COND_TOOLKIT_MOTIF___GUI_SRC_OBJECTS_2 = \
|
||||
coredll_minifram.o \
|
||||
coredll_msgdlg.o \
|
||||
coredll_palette.o \
|
||||
coredll_popupwin.o \
|
||||
coredll_radiobox.o \
|
||||
coredll_radiobut.o \
|
||||
coredll_scrolbar.o \
|
||||
@@ -4590,6 +4594,7 @@ COND_TOOLKIT_MOTIF___GUI_SRC_OBJECTS_3 = \
|
||||
corelib_minifram.o \
|
||||
corelib_msgdlg.o \
|
||||
corelib_palette.o \
|
||||
corelib_popupwin.o \
|
||||
corelib_radiobox.o \
|
||||
corelib_radiobut.o \
|
||||
corelib_scrolbar.o \
|
||||
@@ -8508,6 +8513,9 @@ coredll_pnghand.o: $(srcdir)/src/mac/pnghand.cpp
|
||||
@COND_TOOLKIT_MSW_USE_GUI_1@coredll_popupwin.o: $(srcdir)/src/msw/popupwin.cpp
|
||||
@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $<
|
||||
|
||||
@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@coredll_popupwin.o: $(srcdir)/src/motif/popupwin.cpp
|
||||
@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $<
|
||||
|
||||
coredll_print.o: $(srcdir)/src/os2/print.cpp
|
||||
$(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $<
|
||||
|
||||
@@ -10607,6 +10615,9 @@ corelib_pnghand.o: $(srcdir)/src/mac/pnghand.cpp
|
||||
@COND_TOOLKIT_MSW_USE_GUI_1@corelib_popupwin.o: $(srcdir)/src/msw/popupwin.cpp
|
||||
@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $<
|
||||
|
||||
@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@corelib_popupwin.o: $(srcdir)/src/motif/popupwin.cpp
|
||||
@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $<
|
||||
|
||||
corelib_print.o: $(srcdir)/src/os2/print.cpp
|
||||
$(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $<
|
||||
|
||||
@@ -13433,6 +13444,9 @@ monodll_pnghand.o: $(srcdir)/src/mac/pnghand.cpp
|
||||
@COND_TOOLKIT_MSW_USE_GUI_1@monodll_popupwin.o: $(srcdir)/src/msw/popupwin.cpp
|
||||
@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $<
|
||||
|
||||
@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monodll_popupwin.o: $(srcdir)/src/motif/popupwin.cpp
|
||||
@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $<
|
||||
|
||||
monodll_print.o: $(srcdir)/src/os2/print.cpp
|
||||
$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $<
|
||||
|
||||
@@ -16033,6 +16047,9 @@ monolib_pnghand.o: $(srcdir)/src/mac/pnghand.cpp
|
||||
@COND_TOOLKIT_MSW_USE_GUI_1@monolib_popupwin.o: $(srcdir)/src/msw/popupwin.cpp
|
||||
@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $<
|
||||
|
||||
@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monolib_popupwin.o: $(srcdir)/src/motif/popupwin.cpp
|
||||
@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $<
|
||||
|
||||
monolib_print.o: $(srcdir)/src/os2/print.cpp
|
||||
$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $<
|
||||
|
||||
|
@@ -2,9 +2,6 @@ dnl This macro was generated by
|
||||
dnl Bakefile 0.1.1 (http://bakefile.sourceforge.net)
|
||||
dnl Do not modify, all changes will be overwritten!
|
||||
|
||||
|
||||
dnl Conditions:
|
||||
|
||||
dnl ### begin block 0_AC_BAKEFILE_PRECOMP_HEADERS ###
|
||||
AC_BAKEFILE_PRECOMP_HEADERS
|
||||
|
||||
|
@@ -868,6 +868,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
|
||||
src/motif/minifram.cpp
|
||||
src/motif/msgdlg.cpp
|
||||
src/motif/palette.cpp
|
||||
src/motif/popupwin.cpp
|
||||
src/motif/radiobox.cpp
|
||||
src/motif/radiobut.cpp
|
||||
src/motif/scrolbar.cpp
|
||||
@@ -944,6 +945,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
|
||||
wx/motif/minifram.h
|
||||
wx/motif/msgdlg.h
|
||||
wx/motif/palette.h
|
||||
wx/motif/popupwin.h
|
||||
wx/motif/print.h
|
||||
wx/motif/private.h
|
||||
wx/motif/radiobox.h
|
||||
|
5
configure
vendored
5
configure
vendored
@@ -33310,10 +33310,6 @@ if test "$wxUSE_POPUPWIN" = "yes"; then
|
||||
if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1 ; then
|
||||
{ echo "$as_me:$LINENO: WARNING: Popup window not yet supported under Mac OS X... disabled" >&5
|
||||
echo "$as_me: WARNING: Popup window not yet supported under Mac OS X... disabled" >&2;}
|
||||
else
|
||||
if test "$wxUSE_MOTIF" = 1; then
|
||||
{ echo "$as_me:$LINENO: WARNING: wxPopupWindow not yet supported under Motif... disabled" >&5
|
||||
echo "$as_me: WARNING: wxPopupWindow not yet supported under Motif... disabled" >&2;}
|
||||
else
|
||||
if test "$wxUSE_PM" = 1; then
|
||||
{ echo "$as_me:$LINENO: WARNING: wxPopupWindow not yet supported under PM... disabled" >&5
|
||||
@@ -33327,7 +33323,6 @@ _ACEOF
|
||||
USES_CONTROLS=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$wxUSE_TIPWINDOW" = "yes"; then
|
||||
|
@@ -5318,9 +5318,6 @@ fi
|
||||
if test "$wxUSE_POPUPWIN" = "yes"; then
|
||||
if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1 ; then
|
||||
AC_MSG_WARN([Popup window not yet supported under Mac OS X... disabled])
|
||||
else
|
||||
if test "$wxUSE_MOTIF" = 1; then
|
||||
AC_MSG_WARN([wxPopupWindow not yet supported under Motif... disabled])
|
||||
else
|
||||
if test "$wxUSE_PM" = 1; then
|
||||
AC_MSG_WARN([wxPopupWindow not yet supported under PM... disabled])
|
||||
@@ -5330,7 +5327,6 @@ if test "$wxUSE_POPUPWIN" = "yes"; then
|
||||
USES_CONTROLS=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$wxUSE_TIPWINDOW" = "yes"; then
|
||||
|
40
include/wx/motif/popupwin.h
Normal file
40
include/wx/motif/popupwin.h
Normal file
@@ -0,0 +1,40 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/motif/popupwin.h
|
||||
// Purpose: wxPopupWindow class for wxMotif
|
||||
// Author: Mattia Barbon
|
||||
// Modified by:
|
||||
// Created: 28.08.03
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2003 Mattia Barbon
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_MOTIF_POPUPWIN_H_
|
||||
#define _WX_MOTIF_POPUPWIN_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "popup.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxPopupWindow
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxPopupWindow : public wxPopupWindowBase
|
||||
{
|
||||
public:
|
||||
wxPopupWindow() { Init(); }
|
||||
|
||||
wxPopupWindow( wxWindow *parent, int flags = wxBORDER_NONE )
|
||||
{ Init(); (void)Create( parent, flags ); }
|
||||
|
||||
bool Create( wxWindow *parent, int flags = wxBORDER_NONE );
|
||||
|
||||
virtual bool Show( bool show = true );
|
||||
private:
|
||||
void Init() { m_isShown = false; }
|
||||
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxPopupWindow)
|
||||
};
|
||||
|
||||
#endif // _WX_MOTIF_POPUPWIN_H_
|
@@ -59,6 +59,8 @@ public:
|
||||
#include "wx/gtk/popupwin.h"
|
||||
#elif __WXX11__
|
||||
#include "wx/x11/popupwin.h"
|
||||
#elif __WXMOTIF__
|
||||
#include "wx/motif/popupwin.h"
|
||||
#elif __WXMGL__
|
||||
#include "wx/mgl/popupwin.h"
|
||||
#else
|
||||
|
@@ -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
70
src/motif/popupwin.cpp
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user