Files
wxWidgets/src/motif/popupwin.cpp
Mattia Barbon 105fbe1ffa Rework wxMotif font/color inheritance so it works
like in the other ports.  Avoid setting foreground/background
color for windows and let the toolkit use the natural color.
As an intermediate step font is still explicitly set.

  Handle the cases where m_foregroundColour, m_backgroundColour ir m_font
are not initialized.

  Set default (overridable) X resources to emulate the old look.

  Unify wxMOTIF_NEW_FONT_HANDLING with wxMOTIF_USE_RENDER_TABLE.

  Minor unrelated (sizing) fixes to wxCheckListBox, wxStaticText, wxTextCtrl.

  Tagged with MOTIF_BEFORE_COLOUR_FONT_INHERITANCE before the changes.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45312 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-04-07 21:18:33 +00:00

79 lines
1.8 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: src/motif/popupwin.cpp
// Purpose: wxPopupWindow implementation
// Author: Mattia barbon
// Modified by:
// Created: 28.08.03
// RCS-ID: $Id$
// Copyright: (c) Mattia barbon
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#include "wx/popupwin.h"
#ifndef WX_PRECOMP
#include "wx/app.h"
#endif
#ifdef __VMS__
#pragma message disable nosimpint
#endif
#include <Xm/Xm.h>
#ifdef __VMS__
#pragma message enable nosimpint
#endif
#include "wx/motif/private.h"
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;
wxAddWindowToTable( (Widget) m_mainWidget, this );
DoSetSizeIntr( -1, -1, 100, 100, 0, true );
XtSetMappedWhenManaged( popup, False );
XtRealizeWidget( popup );
XtManageChild ( popup );
/*
XtTranslations ptr;
XtOverrideTranslations (popup,
ptr = XtParseTranslationTable ("<Configure>: resize()"));
XtFree ((char *) ptr);
*/
return true;
}
bool wxPopupWindow::Show( bool show )
{
if( !wxWindowBase::Show( show ) )
return false;
if( show )
{
XtPopup( (Widget)GetMainWidget(), XtGrabNonexclusive );
}
else
{
XtPopdown( (Widget)GetMainWidget() );
}
return true;
}