1. Assorted Motif fixes

a) tear off menus
 b) native dialogs
 c) crash in ~wxWindow fixed
 d) compilation and linking fixes
2. test code removed from minimal sample, text one compiles without clipboard
3. wxAppBase/wxApp small fixes


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3074 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-07-21 16:10:18 +00:00
parent 20a8b34e2c
commit ee31c392ac
16 changed files with 633 additions and 462 deletions

View File

@@ -53,6 +53,7 @@
#include <Xm/ScrollBar.h>
#include <Xm/Frame.h>
#include <Xm/Label.h>
#include <Xm/RowColumn.h> // for XmMenuPosition
#include "wx/motif/private.h"
@@ -369,6 +370,9 @@ wxWindow::~wxWindow()
ClearUpdateRects();
if ( m_parent )
m_parent->RemoveChild( this );
// If m_drawingArea, we're a fully-fledged window with drawing area,
// scrollbars etc. (what wxCanvas used to be)
if ( m_drawingArea )
@@ -1040,6 +1044,76 @@ void wxWindow::DoSetToolTip(wxToolTip * WXUNUSED(tooltip))
#endif // wxUSE_TOOLTIPS
// ----------------------------------------------------------------------------
// popup menus
// ----------------------------------------------------------------------------
bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y)
{
Widget widget = (Widget) GetMainWidget();
/* The menuId field seems to be usused, so we'll use it to
indicate whether a menu is popped up or not:
0: Not currently created as a popup
-1: Created as a popup, but not active
1: Active popup.
*/
if (menu->GetParent() && (menu->GetId() != -1))
return FALSE;
if (menu->GetMainWidget()) {
menu->DestroyMenu(TRUE);
}
menu->SetId(1); /* Mark as popped-up */
menu->CreateMenu(NULL, widget, menu);
menu->SetInvokingWindow(this);
menu->UpdateUI();
// menu->SetParent(parent);
// parent->children->Append(menu); // Store menu for later deletion
Widget menuWidget = (Widget) menu->GetMainWidget();
int rootX = 0;
int rootY = 0;
int deviceX = x;
int deviceY = y;
/*
if (this->IsKindOf(CLASSINFO(wxCanvas)))
{
wxCanvas *canvas = (wxCanvas *) this;
deviceX = canvas->GetDC ()->LogicalToDeviceX (x);
deviceY = canvas->GetDC ()->LogicalToDeviceY (y);
}
*/
Display *display = XtDisplay (widget);
Window rootWindow = RootWindowOfScreen (XtScreen((Widget)widget));
Window thisWindow = XtWindow (widget);
Window childWindow;
XTranslateCoordinates (display, thisWindow, rootWindow, (int) deviceX, (int) deviceY,
&rootX, &rootY, &childWindow);
XButtonPressedEvent event;
event.type = ButtonPress;
event.button = 1;
event.x = deviceX;
event.y = deviceY;
event.x_root = rootX;
event.y_root = rootY;
XmMenuPosition (menuWidget, &event);
XtManageChild (menuWidget);
return TRUE;
}
// ---------------------------------------------------------------------------
// moving and resizing
// ---------------------------------------------------------------------------