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/minifram.h \
|
||||||
wx/motif/msgdlg.h \
|
wx/motif/msgdlg.h \
|
||||||
wx/motif/palette.h \
|
wx/motif/palette.h \
|
||||||
|
wx/motif/popupwin.h \
|
||||||
wx/motif/print.h \
|
wx/motif/print.h \
|
||||||
wx/motif/private.h \
|
wx/motif/private.h \
|
||||||
wx/motif/radiobox.h \
|
wx/motif/radiobox.h \
|
||||||
@@ -3405,6 +3406,7 @@ COND_TOOLKIT_MOTIF___GUI_SRC_OBJECTS = \
|
|||||||
monodll_minifram.o \
|
monodll_minifram.o \
|
||||||
monodll_msgdlg.o \
|
monodll_msgdlg.o \
|
||||||
monodll_palette.o \
|
monodll_palette.o \
|
||||||
|
monodll_popupwin.o \
|
||||||
monodll_radiobox.o \
|
monodll_radiobox.o \
|
||||||
monodll_radiobut.o \
|
monodll_radiobut.o \
|
||||||
monodll_scrolbar.o \
|
monodll_scrolbar.o \
|
||||||
@@ -3800,6 +3802,7 @@ COND_TOOLKIT_MOTIF___GUI_SRC_OBJECTS_1 = \
|
|||||||
monolib_minifram.o \
|
monolib_minifram.o \
|
||||||
monolib_msgdlg.o \
|
monolib_msgdlg.o \
|
||||||
monolib_palette.o \
|
monolib_palette.o \
|
||||||
|
monolib_popupwin.o \
|
||||||
monolib_radiobox.o \
|
monolib_radiobox.o \
|
||||||
monolib_radiobut.o \
|
monolib_radiobut.o \
|
||||||
monolib_scrolbar.o \
|
monolib_scrolbar.o \
|
||||||
@@ -4195,6 +4198,7 @@ COND_TOOLKIT_MOTIF___GUI_SRC_OBJECTS_2 = \
|
|||||||
coredll_minifram.o \
|
coredll_minifram.o \
|
||||||
coredll_msgdlg.o \
|
coredll_msgdlg.o \
|
||||||
coredll_palette.o \
|
coredll_palette.o \
|
||||||
|
coredll_popupwin.o \
|
||||||
coredll_radiobox.o \
|
coredll_radiobox.o \
|
||||||
coredll_radiobut.o \
|
coredll_radiobut.o \
|
||||||
coredll_scrolbar.o \
|
coredll_scrolbar.o \
|
||||||
@@ -4590,6 +4594,7 @@ COND_TOOLKIT_MOTIF___GUI_SRC_OBJECTS_3 = \
|
|||||||
corelib_minifram.o \
|
corelib_minifram.o \
|
||||||
corelib_msgdlg.o \
|
corelib_msgdlg.o \
|
||||||
corelib_palette.o \
|
corelib_palette.o \
|
||||||
|
corelib_popupwin.o \
|
||||||
corelib_radiobox.o \
|
corelib_radiobox.o \
|
||||||
corelib_radiobut.o \
|
corelib_radiobut.o \
|
||||||
corelib_scrolbar.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@coredll_popupwin.o: $(srcdir)/src/msw/popupwin.cpp
|
||||||
@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $<
|
@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
|
coredll_print.o: $(srcdir)/src/os2/print.cpp
|
||||||
$(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $<
|
$(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@corelib_popupwin.o: $(srcdir)/src/msw/popupwin.cpp
|
||||||
@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $<
|
@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
|
corelib_print.o: $(srcdir)/src/os2/print.cpp
|
||||||
$(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $<
|
$(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@monodll_popupwin.o: $(srcdir)/src/msw/popupwin.cpp
|
||||||
@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $<
|
@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
|
monodll_print.o: $(srcdir)/src/os2/print.cpp
|
||||||
$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $<
|
$(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@monolib_popupwin.o: $(srcdir)/src/msw/popupwin.cpp
|
||||||
@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $<
|
@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
|
monolib_print.o: $(srcdir)/src/os2/print.cpp
|
||||||
$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $<
|
$(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 Bakefile 0.1.1 (http://bakefile.sourceforge.net)
|
||||||
dnl Do not modify, all changes will be overwritten!
|
dnl Do not modify, all changes will be overwritten!
|
||||||
|
|
||||||
|
|
||||||
dnl Conditions:
|
|
||||||
|
|
||||||
dnl ### begin block 0_AC_BAKEFILE_PRECOMP_HEADERS ###
|
dnl ### begin block 0_AC_BAKEFILE_PRECOMP_HEADERS ###
|
||||||
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/minifram.cpp
|
||||||
src/motif/msgdlg.cpp
|
src/motif/msgdlg.cpp
|
||||||
src/motif/palette.cpp
|
src/motif/palette.cpp
|
||||||
|
src/motif/popupwin.cpp
|
||||||
src/motif/radiobox.cpp
|
src/motif/radiobox.cpp
|
||||||
src/motif/radiobut.cpp
|
src/motif/radiobut.cpp
|
||||||
src/motif/scrolbar.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/minifram.h
|
||||||
wx/motif/msgdlg.h
|
wx/motif/msgdlg.h
|
||||||
wx/motif/palette.h
|
wx/motif/palette.h
|
||||||
|
wx/motif/popupwin.h
|
||||||
wx/motif/print.h
|
wx/motif/print.h
|
||||||
wx/motif/private.h
|
wx/motif/private.h
|
||||||
wx/motif/radiobox.h
|
wx/motif/radiobox.h
|
||||||
|
15
configure
vendored
15
configure
vendored
@@ -33311,21 +33311,16 @@ if test "$wxUSE_POPUPWIN" = "yes"; then
|
|||||||
{ echo "$as_me:$LINENO: WARNING: Popup window not yet supported under Mac OS X... disabled" >&5
|
{ 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;}
|
echo "$as_me: WARNING: Popup window not yet supported under Mac OS X... disabled" >&2;}
|
||||||
else
|
else
|
||||||
if test "$wxUSE_MOTIF" = 1; then
|
if test "$wxUSE_PM" = 1; then
|
||||||
{ echo "$as_me:$LINENO: WARNING: wxPopupWindow not yet supported under Motif... disabled" >&5
|
{ echo "$as_me:$LINENO: WARNING: wxPopupWindow not yet supported under PM... 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
|
|
||||||
echo "$as_me: WARNING: wxPopupWindow not yet supported under PM... disabled" >&2;}
|
echo "$as_me: WARNING: wxPopupWindow not yet supported under PM... disabled" >&2;}
|
||||||
else
|
else
|
||||||
cat >>confdefs.h <<\_ACEOF
|
cat >>confdefs.h <<\_ACEOF
|
||||||
#define wxUSE_POPUPWIN 1
|
#define wxUSE_POPUPWIN 1
|
||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
|
|
||||||
USES_CONTROLS=1
|
USES_CONTROLS=1
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
12
configure.in
12
configure.in
@@ -5319,16 +5319,12 @@ if test "$wxUSE_POPUPWIN" = "yes"; then
|
|||||||
if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1 ; then
|
if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1 ; then
|
||||||
AC_MSG_WARN([Popup window not yet supported under Mac OS X... disabled])
|
AC_MSG_WARN([Popup window not yet supported under Mac OS X... disabled])
|
||||||
else
|
else
|
||||||
if test "$wxUSE_MOTIF" = 1; then
|
if test "$wxUSE_PM" = 1; then
|
||||||
AC_MSG_WARN([wxPopupWindow not yet supported under Motif... disabled])
|
AC_MSG_WARN([wxPopupWindow not yet supported under PM... disabled])
|
||||||
else
|
else
|
||||||
if test "$wxUSE_PM" = 1; then
|
AC_DEFINE(wxUSE_POPUPWIN)
|
||||||
AC_MSG_WARN([wxPopupWindow not yet supported under PM... disabled])
|
|
||||||
else
|
|
||||||
AC_DEFINE(wxUSE_POPUPWIN)
|
|
||||||
|
|
||||||
USES_CONTROLS=1
|
USES_CONTROLS=1
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
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"
|
#include "wx/gtk/popupwin.h"
|
||||||
#elif __WXX11__
|
#elif __WXX11__
|
||||||
#include "wx/x11/popupwin.h"
|
#include "wx/x11/popupwin.h"
|
||||||
|
#elif __WXMOTIF__
|
||||||
|
#include "wx/motif/popupwin.h"
|
||||||
#elif __WXMGL__
|
#elif __WXMGL__
|
||||||
#include "wx/mgl/popupwin.h"
|
#include "wx/mgl/popupwin.h"
|
||||||
#else
|
#else
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
#pragma hdrstop
|
#pragma hdrstop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if wxUSE_POPUPWIN && !defined(__WXMOTIF__)
|
#if wxUSE_POPUPWIN
|
||||||
|
|
||||||
#include "wx/popupwin.h"
|
#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