From: Julian Smart Date: Fri, 1 Jan 1999 19:13:35 +0000 (+0000) Subject: Lots of wxMotif fixes X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b412f9be504e07559a98ae234f30bb1bd0b2aa1f?ds=sidebyside Lots of wxMotif fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1304 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/distrib/msw/generic.rsp b/distrib/msw/generic.rsp index 73a2e4d1f7..37a5f1f542 100644 --- a/distrib/msw/generic.rsp +++ b/distrib/msw/generic.rsp @@ -9,6 +9,7 @@ docs/upgrade.txt docs/todo.txt docs/licence.txt docs/symbols.txt +docs/bugs.txt docs/*.html src/*.inc diff --git a/docs/bugs.txt b/docs/bugs.txt index e64dc10130..915dad0712 100644 --- a/docs/bugs.txt +++ b/docs/bugs.txt @@ -10,6 +10,29 @@ wxMSW: wxMotif: -------- +- wxNotebook and property list frame do not appear properly when + first shown. + Workaround: resize the window (manually or programmatically) to + make the window appear. + This also happens with other windows, e.g. the sizer + dialog in the layout sample. + +- wxSashWindow borders aren't repainted properly if the sashtest + sample is exposed (after being under another window). + +- If a popup wxMenu is destroyed after its parent window has been + destroyed, we get the message "Object XXX does not have windowed + ancestor". + Workaround: delete the menu before deleting the window on which it + was popped up. + Possible fix: call menu->DestroyMenu() before deleting the window, + if the window knows about the menu that was last popped up (hard + to know this with confidence). + +- In wxGrid, cell highlight is not drawn/erased properly. + +- Setting the size of a hidden window may show that window. + General: -------- diff --git a/docs/changes.txt b/docs/changes.txt index 1a8b76e2d7..bb7589eb7c 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -1,6 +1,44 @@ wxWindows 2.0 Change Log ------------------------ +Beta 2, ??? 1998 +-------------------------- + +wxGTK: + +wxMSW: + +- 16-bit BC++ compilation/linking works albeit without the resource system. + +wxMotif: + +- Cured wxScreenDC origin problem so e.g. sash window sash is drawn at + the right place. +- Cured some widget table clashes. +- Added thread support (Robert). +- wxPoem sample now works. + +General: + +- Rearranged documentation a bit. +- Sash window uses area of first frame/dialog to paint over when drawing + the dragged sash, not just the sash window itself (it clipped to the right + or below). +- Made resource sample use the correct Cancel button id. +- Moved wxProp to main library (generic directory), created proplist + sample. +- Added bombs and fractal samples. + +Beta 1, December 24th 1998 +-------------------------- + +wxGTK: + +- Various + +wxMSW, wxMotif: not in sync with this release. + + Alpha 18, December 29th 1998 ---------------------------- diff --git a/docs/latex/wx/menu.tex b/docs/latex/wx/menu.tex index 8d2b277cf5..29304cf79f 100644 --- a/docs/latex/wx/menu.tex +++ b/docs/latex/wx/menu.tex @@ -53,6 +53,13 @@ Constructs a wxMenu object. Destructor, destroying the menu. +Note: under Motif, a popup menu must have a valid parent (the window +it was last popped up on) when being destroyed. Therefore, make sure +you delete or re-use the popup menu {\it before} destroying the +parent window. Re-use in this context means popping up the menu on +a different window from last time, which causes an implicit destruction +and recreation of internal data structures. + \membersection{wxMenu::Append}\label{wxmenuappend} \func{void}{Append}{\param{int}{ id}, \param{const wxString\& }{ item}, \param{const wxString\& }{helpString = ""},\rtfsp diff --git a/docs/motif/install.txt b/docs/motif/install.txt index 2f99c8a5a8..f86f3cf0a9 100644 --- a/docs/motif/install.txt +++ b/docs/motif/install.txt @@ -81,6 +81,12 @@ Notes: I'd prefer you to fix the problem and send the fix to me :-) or at least let me know about it. +- Thread support is switched off by default in setup.h (wxUSE_THREADS) + because standard Unices often do not have the necessary thread library + installed. Please see ../docs/gtk/install.txt for more details on this. + For Linux, the problem is expected to go away with future + distributions of the operating system. + - If you have trouble compiling the file y_tab.c, or have strange linking errors, check whether you're using a C or C++ compiler for this file. You should specify a C compiler in the CCLEX variable in src/make.env. diff --git a/include/wx/motif/setup.h b/include/wx/motif/setup.h index 8be4743065..7a02e4c3b3 100644 --- a/include/wx/motif/setup.h +++ b/include/wx/motif/setup.h @@ -123,6 +123,10 @@ #define wxUSE_TIMEDATE 1 // Use time and date + +#define wxUSE_THREADS 0 + // Use threads + /* * Finer detail * diff --git a/include/wx/motif/statbox.h b/include/wx/motif/statbox.h index 90069cea8e..4f8e005eec 100644 --- a/include/wx/motif/statbox.h +++ b/include/wx/motif/statbox.h @@ -36,6 +36,7 @@ class WXDLLEXPORT wxStaticBox: public wxControl { Create(parent, id, label, pos, size, style, name); } + ~wxStaticBox(); bool Create(wxWindow *parent, wxWindowID id, const wxString& label, diff --git a/samples/bombs/bombs.cpp b/samples/bombs/bombs.cpp index 0494fc7f8d..cd652bcd46 100644 --- a/samples/bombs/bombs.cpp +++ b/samples/bombs/bombs.cpp @@ -79,9 +79,9 @@ BombsFrameClass::BombsFrameClass(wxFrame *parent, const wxString& title, const w wxMenu *menu2 = new wxMenu; menu2->Append(IDM_RESTART, "&Restart"); // , "Clear the play field"); menu2->AppendSeparator(); - menu2->Append(IDM_EASY, "&Easy", (char*)NULL, TRUE); // "10x10 play field", TRUE); - menu2->Append(IDM_MEDIUM, "&Medium", (char*)NULL, TRUE); // "15x15 play field", TRUE); - menu2->Append(IDM_DIFFICULT, "&Difficult", (char*)NULL, TRUE); // "25x20 play field", TRUE); + menu2->Append(IDM_EASY, "&Easy", wxEmptyString, TRUE); // "10x10 play field", TRUE); + menu2->Append(IDM_MEDIUM, "&Medium", wxEmptyString, TRUE); // "15x15 play field", TRUE); + menu2->Append(IDM_DIFFICULT, "&Difficult", wxEmptyString, TRUE); // "25x20 play field", TRUE); menuBar1->Append(menu2, "&Game"); SetMenuBar(menuBar1); menuBar=menuBar1; diff --git a/samples/docvwmdi/makefile.unx b/samples/docvwmdi/makefile.unx index bbdccc3fc4..7b3a448e48 100644 --- a/samples/docvwmdi/makefile.unx +++ b/samples/docvwmdi/makefile.unx @@ -1,64 +1,16 @@ # # File: makefile.unx # Author: Julian Smart -# Created: 1993 +# Created: 1998 # Updated: -# Copyright: (c) 1993, AIAI, University of Edinburgh +# Copyright: (c) 1998 Julian Smart # # "%W% %G%" # -# Makefile for docview example (UNIX). +# Makefile for docvwmdi example (UNIX). -WXDIR = ../.. +PROGRAM=docview -# All common UNIX compiler flags and options are now in -# this central makefile. -include $(WXDIR)/src/make.env +OBJECTS=$(PROGRAM).o doc.o view.o -OBJECTS = $(OBJDIR)/docview.$(OBJSUFF) $(OBJDIR)/view.$(OBJSUFF) $(OBJDIR)/doc.$(OBJSUFF) - -.SUFFIXES: - -all: $(OBJDIR) wx$(GUISUFFIX) docview$(GUISUFFIX) - -wx_motif: - cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx motif - -wx_ol: - cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx xview -motif: - $(MAKE) -f makefile.unx GUISUFFIX=_motif GUI=-Dwx_motif GUISUFFIX=_motif OPT='$(OPT)' LDLIBS='$(MOTIFLDLIBS)' OPTIONS='$(OPTIONS)' DEBUG='$(DEBUG)' WARN='$(WARN)' XLIB='$(XLIB)' XINCLUDE='$(XINCLUDE)' XVIEW_LINK= - -xview: - $(MAKE) -f makefile.unx GUI=-Dwx_xview GUISUFFIX=_ol CC=$(CC) OPTIONS='$(OPTIONS)' DEBUG='$(DEBUG)' WARN='$(WARN)' XLIB='$(XLIB)' XINCLUDE='$(XINCLUDE)' - -hp: - $(MAKE) -f makefile,unx GUI=-Dwx_motif GUISUFFIX=_hp CC=CC DEBUG='$(DEBUG)' WARN='-w' \ - XINCLUDE='$(HPXINCLUDE)' XLIB='$(HPXLIB)' XVIEW_LINK='' LDLIBS='$(HPLDLIBS)' - -$(OBJDIR): - mkdir $(OBJDIR) - -docview$(GUISUFFIX): $(OBJECTS) $(WXLIB) - $(CC) $(LDFLAGS) -o docview$(GUISUFFIX) $(OBJECTS) $(XVIEW_LINK) $(LDLIBS) - -$(OBJDIR)/docview.$(OBJSUFF): docview.$(SRCSUFF) docview.h doc.h view.h - $(CC) -c $(CPPFLAGS) -o $@ docview.$(SRCSUFF) - -$(OBJDIR)/doc.$(OBJSUFF): doc.$(SRCSUFF) doc.h - $(CC) -c $(CPPFLAGS) -o $@ doc.$(SRCSUFF) - -$(OBJDIR)/view.$(OBJSUFF): view.$(SRCSUFF) view.h - $(CC) -c $(CPPFLAGS) -o $@ view.$(SRCSUFF) - -clean_motif: - $(MAKE) -f makefile.unx GUISUFFIX=_motif cleanany - -clean_ol: - $(MAKE) -f makefile.unx GUISUFFIX=_ol cleanany - -clean_hp: - $(MAKE) -f makefile.unx GUISUFFIX=_hp cleanany - -cleanany: - rm -f $(OBJECTS) docview$(GUISUFFIX) core +include ../../src/makeprog.env diff --git a/samples/docvwmdi/view.cpp b/samples/docvwmdi/view.cpp index 7da43c504b..ea08110776 100644 --- a/samples/docvwmdi/view.cpp +++ b/samples/docvwmdi/view.cpp @@ -54,7 +54,7 @@ bool DrawingView::OnCreate(wxDocument *doc, long WXUNUSED(flags) ) // X seems to require a forced resize int x, y; frame->GetSize(&x, &y); - frame->SetSize(x, y); + frame->SetSize(-1, -1, x, y); #endif frame->Show(TRUE); @@ -146,7 +146,7 @@ bool TextEditView::OnCreate(wxDocument *doc, long WXUNUSED(flags) ) // X seems to require a forced resize int x, y; frame->GetSize(&x, &y); - frame->SetSize(x, y); + frame->SetSize(-1, -1, x, y); #endif frame->Show(TRUE); diff --git a/samples/internat/internat.cpp b/samples/internat/internat.cpp index 1a7d4a0e39..40d065e674 100644 --- a/samples/internat/internat.cpp +++ b/samples/internat/internat.cpp @@ -29,7 +29,7 @@ #include "wx/file.h" #include "wx/log.h" -#ifdef __WXGTK__ +#if defined(__WXGTK__) || defined(__WXMOTIF__) #include "mondrian.xpm" #endif @@ -95,14 +95,10 @@ bool MyApp::OnInit(void) m_locale.AddCatalog("fileutils"); // 3) and another just for testing // Create the main frame window - MyFrame *frame = new MyFrame((wxFrame *) NULL, _("Minimal wxWindows App"), 50, 50, 150, 40); + MyFrame *frame = new MyFrame((wxFrame *) NULL, _("International wxWindows App"), 50, 50, 150, 40); // Give it an icon -#ifdef __WXMSW__ - frame->SetIcon(wxIcon("mondrian")); -#else - frame->SetIcon(wxIcon(mondrian_xpm)); -#endif + frame->SetIcon(wxICON(mondrian)); // Make a menubar wxMenu *file_menu = new wxMenu; diff --git a/samples/proplist/makefile.unx b/samples/proplist/makefile.unx new file mode 100644 index 0000000000..f874755623 --- /dev/null +++ b/samples/proplist/makefile.unx @@ -0,0 +1,17 @@ +# +# File: makefile.unx +# Author: Julian Smart +# Created: 1998 +# Updated: +# Copyright: (c) 1998 Julian Smart +# +# "%W% %G%" +# +# Makefile for proplist example (UNIX). + +PROGRAM=test + +OBJECTS=$(PROGRAM).o + +include ../../src/makeprog.env + diff --git a/samples/resource/resource.cpp b/samples/resource/resource.cpp index 9b4db2b651..19aab9edca 100644 --- a/samples/resource/resource.cpp +++ b/samples/resource/resource.cpp @@ -179,19 +179,19 @@ bool MyFrame::OnClose(void) } BEGIN_EVENT_TABLE(MyDialog, wxDialog) - EVT_BUTTON(RESOURCE_OK, MyDialog::OnOk) - EVT_BUTTON(RESOURCE_CANCEL, MyDialog::OnCancel) + // EVT_BUTTON(RESOURCE_OK, MyDialog::OnOk) + EVT_BUTTON(ID_BUTTON109, MyDialog::OnCancel) END_EVENT_TABLE() void MyDialog::OnOk(wxCommandEvent& WXUNUSED(event) ) { - EndModal(RESOURCE_OK); + // EndModal(RESOURCE_OK); } void MyDialog::OnCancel(wxCommandEvent& WXUNUSED(event) ) { - EndModal(RESOURCE_CANCEL); + EndModal(ID_BUTTON109); } diff --git a/samples/resource/resource.h b/samples/resource/resource.h index 39c46068c9..9111d6caf0 100644 --- a/samples/resource/resource.h +++ b/samples/resource/resource.h @@ -55,5 +55,7 @@ class MyDialog : public wxDialog #define RESOURCE_QUIT 4 #define RESOURCE_TEST1 2 +/* #define RESOURCE_OK 1 #define RESOURCE_CANCEL 2 +*/ diff --git a/samples/typetest/typetest.cpp b/samples/typetest/typetest.cpp index f16da8366c..59bc12f3db 100644 --- a/samples/typetest/typetest.cpp +++ b/samples/typetest/typetest.cpp @@ -30,7 +30,7 @@ #include "typetest.h" -#ifdef __WXGTK__ +#if defined(__WXGTK__) || defined(__WXMOTIF__) #include "mondrian.xpm" #endif diff --git a/samples/wxpoem/wxpoem.cpp b/samples/wxpoem/wxpoem.cpp index cc3f25bad6..dea7b5ac0f 100644 --- a/samples/wxpoem/wxpoem.cpp +++ b/samples/wxpoem/wxpoem.cpp @@ -35,7 +35,7 @@ #include "wxpoem.h" -#ifdef __WXGTK__ +#if defined(__WXGTK__) || defined(__WXMOTIF__) #include "corner1.xpm" #include "corner2.xpm" #include "corner3.xpm" @@ -159,6 +159,14 @@ MainWindow::MainWindow(wxFrame *frame, wxWindowID id, const wxString& title, { } +MainWindow::~MainWindow() +{ + // Note: this must be done before the main window/canvas are destroyed + // or we get an error (no parent window for menu item button) + delete popupMenu; + popupMenu = NULL; +} + // Read the poetry buffer, either for finding the size // or for writing to a bitmap (not to the window directly, // since that displays messily) @@ -639,7 +647,7 @@ bool MyApp::OnInit() Corner3 = new wxIcon("icon_3"); Corner4 = new wxIcon("icon_4"); #endif -#ifdef __WXGTK__ +#if defined(__WXGTK__) || defined(__WXMOTIF__) Corner1 = new wxIcon( corner1_xpm ); Corner2 = new wxIcon( corner2_xpm ); Corner3 = new wxIcon( corner3_xpm ); @@ -658,17 +666,14 @@ int MyApp::OnExit() if (backingBitmap) delete backingBitmap; delete HelpController; - delete popupMenu; delete GreyPen; delete DarkGreyPen; delete WhitePen; -//#ifdef __WXMSW__ delete Corner1; delete Corner2; delete Corner3; delete Corner4; -//#endif delete NormalFont; delete BoldFont; @@ -1070,7 +1075,7 @@ bool Compile(void) void PopupFunction(wxMenu& /*menu*/, wxCommandEvent& event) { - switch (event.m_commandInt) + switch (event.GetId()) { case POEM_NEXT: // Another poem/page diff --git a/samples/wxpoem/wxpoem.h b/samples/wxpoem/wxpoem.h index 6be433bff4..d61fba8b18 100644 --- a/samples/wxpoem/wxpoem.h +++ b/samples/wxpoem/wxpoem.h @@ -47,6 +47,7 @@ class MainWindow: public wxFrame public: MyCanvas *canvas; MainWindow(wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style); + ~MainWindow(); void OnCloseWindow(wxCloseEvent& event); void OnChar(wxKeyEvent& event); diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 124df43951..186a49a22c 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -834,6 +834,7 @@ void wxSocketBase::SetupCallbacks() m_internal->sock_inputid = XtAppAddInput (wxAPP_CONTEXT, m_fd, (XtPointer *) XtInputReadMask, (XtInputCallbackProc) wx_socket_read, + (XtPointer) this); } } else diff --git a/src/generic/gridg.cpp b/src/generic/gridg.cpp index 5d2fd50e1f..0747e1917f 100644 --- a/src/generic/gridg.cpp +++ b/src/generic/gridg.cpp @@ -1024,7 +1024,7 @@ void wxGenericGrid::AdjustScrollbars(void) if (m_hScrollBar && !m_hScrollBar->IsShown()) horizScrollBarHeight = 0; - if (m_hScrollBar) + if (m_hScrollBar && m_hScrollBar->IsShown()) { int nCols = GetCols(); m_hScrollBar->SetScrollbar(m_hScrollBar->GetThumbPosition(), wxMax(noHorizSteps, 1), (noHorizSteps == 0) ? 1 : nCols, wxMax(noHorizSteps, 1)); @@ -1038,7 +1038,7 @@ void wxGenericGrid::AdjustScrollbars(void) } - if (m_vScrollBar) + if (m_vScrollBar && m_vScrollBar->IsShown()) { int nRows = GetRows(); diff --git a/src/generic/sashwin.cpp b/src/generic/sashwin.cpp index 9bac85b92d..831085a907 100644 --- a/src/generic/sashwin.cpp +++ b/src/generic/sashwin.cpp @@ -115,13 +115,21 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event) { if ( sashHit != wxSASH_NONE ) { - CaptureMouse(); + CaptureMouse(); // Required for X to specify that - // that we wish to draw on top of all windows - // - and we optimise by specifying the area - // for creating the overlap window. - wxScreenDC::StartDrawingOnTop(this); + // that we wish to draw on top of all windows + // - and we optimise by specifying the area + // for creating the overlap window. + // Find the first frame or dialog and use this to specify + // the area to draw on. + wxWindow* parent = this; + + while (parent && !parent->IsKindOf(CLASSINFO(wxDialog)) && + !parent->IsKindOf(CLASSINFO(wxFrame))) + parent = parent->GetParent(); + + wxScreenDC::StartDrawingOnTop(parent); // We don't say we're dragging yet; we leave that // decision for the Dragging() branch, to ensure diff --git a/src/make.env b/src/make.env index 73fac0fcda..44017fcc57 100644 --- a/src/make.env +++ b/src/make.env @@ -29,7 +29,7 @@ RANLIB = ranlib ############################ Switches ################################# # Debug/trace mode. 1 or more for debugging. -DEBUG = 0 +DEBUG = 1 GUI = -D__WXSTUBS__ -D__LINUX__ -D__UNIX__ GUISUFFIX = _stubs @@ -38,7 +38,7 @@ GUISUFFIX = _stubs # Misc options OPTIONS = -D__WXDEBUG__ COPTIONS = -DEBUGFLAGS = +DEBUGFLAGS = -ggdb INCLUDE = WARN = -Wall -Wno-unused # -w CWARN = -Wall -Wno-unused # -w diff --git a/src/motif/app.cpp b/src/motif/app.cpp index cc74c9b771..e1b12c2243 100644 --- a/src/motif/app.cpp +++ b/src/motif/app.cpp @@ -28,7 +28,10 @@ #include "wx/log.h" #include "wx/module.h" #include "wx/memory.h" + +#if wxUSE_THREADS #include "wx/thread.h" +#endif #if wxUSE_WX_RESOURCES #include "wx/resource.h" @@ -299,9 +302,12 @@ int wxApp::MainLoop() { if (!ProcessIdle()) { + // TODO: Robert, what's this for? +#if wxUSE_THREADS wxMutexGuiLeave(); usleep(20); wxMutexGuiEnter(); +#endif } } diff --git a/src/motif/choice.cpp b/src/motif/choice.cpp index 566dc1ea49..022dc9be30 100644 --- a/src/motif/choice.cpp +++ b/src/motif/choice.cpp @@ -148,6 +148,7 @@ wxChoice::~wxChoice() if (GetMainWidget()) { DetachWidget(GetMainWidget()); // Removes event handlers + DetachWidget(m_formWidget); XtDestroyWidget((Widget) m_formWidget); m_formWidget = (WXWidget) 0; diff --git a/src/motif/dcscreen.cpp b/src/motif/dcscreen.cpp index 2f5d52453b..cdb5ed5dd4 100644 --- a/src/motif/dcscreen.cpp +++ b/src/motif/dcscreen.cpp @@ -66,7 +66,8 @@ bool wxScreenDC::StartDrawingOnTop(wxWindow* window) wxRect rect; int x, y, width, height; window->GetPosition(& x, & y); - window->ClientToScreen(& x, & y); + if (window->GetParent()) + window->GetParent()->ClientToScreen(& x, & y); window->GetSize(& width, & height); rect.x = x; rect.y = y; rect.width = width; rect.height = height; diff --git a/src/motif/dialog.cpp b/src/motif/dialog.cpp index 84e727db65..093cb901fb 100644 --- a/src/motif/dialog.cpp +++ b/src/motif/dialog.cpp @@ -286,6 +286,9 @@ wxDialog::~wxDialog() // Note that this might need to be done for wxFrame also. DestroyChildren(); + // This causes a crash in e.g. the resource sample when closing + // the example dialog. TODO: Probably not necessary (?) +#if 0 // Now process all events, because otherwise // this might remain on the screen. Display* display; @@ -301,6 +304,7 @@ wxDialog::~wxDialog() XtAppNextEvent((XtAppContext) wxTheApp->GetAppContext(), &event); XtDispatchEvent(&event); } +#endif } // By default, pressing escape cancels the dialog diff --git a/src/motif/listbox.cpp b/src/motif/listbox.cpp index 02cef45259..15fc68c34b 100644 --- a/src/motif/listbox.cpp +++ b/src/motif/listbox.cpp @@ -688,7 +688,7 @@ void wxListBoxCallback (Widget w, XtPointer clientData, if (item->InSetValue()) return; - wxCommandEvent event (wxEVT_COMMAND_LISTBOX_SELECTED); + wxCommandEvent event (wxEVT_COMMAND_LISTBOX_SELECTED, item->GetId()); switch (cbs->reason) { case XmCR_MULTIPLE_SELECT: diff --git a/src/motif/makefile.unx b/src/motif/makefile.unx index fd2d922b97..28d029c185 100644 --- a/src/motif/makefile.unx +++ b/src/motif/makefile.unx @@ -98,7 +98,6 @@ LIB_CPP_SRC=\ frame.cpp \ gauge.cpp \ gdiobj.cpp \ - helpxxxx.cpp \ icon.cpp \ listbox.cpp \ joystick.cpp \ diff --git a/src/motif/menuitem.cpp b/src/motif/menuitem.cpp index 7ce6558e9b..e04e0e938a 100644 --- a/src/motif/menuitem.cpp +++ b/src/motif/menuitem.cpp @@ -70,6 +70,7 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu, int id, m_pSubMenu = pSubMenu; m_idItem = id; m_bEnabled = TRUE; + m_bChecked = FALSE; //// Motif-specific m_menuBar = NULL; @@ -310,6 +311,7 @@ void wxMenuItemCallback (Widget w, XtPointer clientData, { wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, item->GetId()); commandEvent.SetEventObject(item->GetMenuBar()->GetMenuBarFrame()); + commandEvent.SetInt( item->GetId() ); item->GetMenuBar()->GetMenuBarFrame()->GetEventHandler()->ProcessEvent(commandEvent); } @@ -317,6 +319,8 @@ void wxMenuItemCallback (Widget w, XtPointer clientData, { wxCommandEvent event (wxEVT_COMMAND_MENU_SELECTED, item->GetId()); event.SetEventObject(item->GetTopMenu()); + event.SetInt( item->GetId() ); + item->GetTopMenu()->ProcessCommand (event); } } diff --git a/src/motif/radiobox.cpp b/src/motif/radiobox.cpp index fd6c929cd3..4efaf974f3 100644 --- a/src/motif/radiobox.cpp +++ b/src/motif/radiobox.cpp @@ -181,6 +181,7 @@ wxRadioBox::~wxRadioBox() { delete[] m_radioButtonLabels; delete[] m_radioButtons; + DetachWidget(m_formWidget); } wxString wxRadioBox::GetLabel(int item) const diff --git a/src/motif/radiobut.cpp b/src/motif/radiobut.cpp index d73b55569b..1c40f01114 100644 --- a/src/motif/radiobut.cpp +++ b/src/motif/radiobut.cpp @@ -87,7 +87,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id, XtManageChild (radioButtonWidget); SetCanAddEventHandler(TRUE); - AttachWidget (parent, m_mainWidget, NULL, pos.x, pos.y, size.x, size.y); + AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y); ChangeBackgroundColour(); diff --git a/src/motif/scrolbar.cpp b/src/motif/scrolbar.cpp index 08dca34d54..c1ab7edb9f 100644 --- a/src/motif/scrolbar.cpp +++ b/src/motif/scrolbar.cpp @@ -155,16 +155,17 @@ void wxScrollBar::Command(wxCommandEvent& event) void wxScrollBar::ChangeFont(bool keepOriginalSize) { // TODO + // Do anything for a scrollbar? A font will never be seen. } void wxScrollBar::ChangeBackgroundColour() { - // TODO + wxWindow::ChangeBackgroundColour(); } void wxScrollBar::ChangeForegroundColour() { - // TODO + wxWindow::ChangeForegroundColour(); } static void wxScrollBarCallback(Widget widget, XtPointer clientData, diff --git a/src/motif/statbox.cpp b/src/motif/statbox.cpp index 8f16b556ef..5d8bf67b59 100644 --- a/src/motif/statbox.cpp +++ b/src/motif/statbox.cpp @@ -124,6 +124,11 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID id, return TRUE; } +wxStaticBox::~wxStaticBox() +{ + DetachWidget(m_formWidget); +} + void wxStaticBox::SetLabel(const wxString& label) { if (!m_labelWidget) @@ -194,10 +199,14 @@ void wxStaticBox::ChangeFont(bool keepOriginalSize) void wxStaticBox::ChangeBackgroundColour() { wxWindow::ChangeBackgroundColour(); + if (m_labelWidget) + DoChangeBackgroundColour(m_labelWidget, m_backgroundColour); } void wxStaticBox::ChangeForegroundColour() { wxWindow::ChangeForegroundColour(); + if (m_labelWidget) + DoChangeForegroundColour(m_labelWidget, m_foregroundColour); } diff --git a/src/motif/thread.cpp b/src/motif/thread.cpp index cf16365374..f5e0d88bfb 100644 --- a/src/motif/thread.cpp +++ b/src/motif/thread.cpp @@ -13,15 +13,20 @@ #pragma implementation "thread.h" #endif -#include -#include -#include -#include +#include "wx/defs.h" + +#if wxUSE_THREADS + #include "wx/module.h" #include "wx/thread.h" #include "wx/utils.h" #include "wx/log.h" +#include +#include +#include +#include + #include #include @@ -434,4 +439,5 @@ public: IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule) - +#endif + // wxUSE_THREADS diff --git a/src/motif/window.cpp b/src/motif/window.cpp index 87495d12b7..1d78e7a52a 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -2259,12 +2259,7 @@ bool wxAddWindowToTable(Widget w, wxWindow *win) // printf("Adding widget %ld, name = %s\n", w, win->GetClassInfo()->GetClassName()); if ((oldItem = (wxWindow *)wxWidgetHashTable->Get ((long) w))) { - char buf[300]; - sprintf(buf, "Widget table clash: new widget is %ld, %s", (long)w, win->GetClassInfo()->GetClassName()); - wxError (buf); - fflush(stderr); - sprintf(buf, "Old widget was %s", oldItem->GetClassInfo()->GetClassName()); - wxError (buf); + wxLogError("Widget table clash: new widget is %ld, %s", (long)w, win->GetClassInfo()->GetClassName()); return FALSE; } @@ -3266,8 +3261,23 @@ void wxWindow::ChangeBackgroundColour() { if (GetMainWidget()) DoChangeBackgroundColour(GetMainWidget(), m_backgroundColour); + + // This not necessary +#if 0 + if (m_scrolledWindow && (GetMainWidget() != m_scrolledWindow)) + { DoChangeBackgroundColour(m_scrolledWindow, m_backgroundColour); + // Have to set the scrollbar colours back since + // the scrolled window seemed to change them + wxColour backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE) ; + + if (m_hScrollBar) + DoChangeBackgroundColour(m_hScrollBar, backgroundColour); + if (m_vScrollBar) + DoChangeBackgroundColour(m_vScrollBar, backgroundColour); + } +#endif } void wxWindow::ChangeForegroundColour()