From cba2db0c2969f9b83e8a1736e260d22200e99a99 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 12 Feb 1999 08:22:29 +0000 Subject: [PATCH] Some doc corrections (added blank lines at end of docs); corrected Forty sample dialog behaviour; added dummy menubar constructors; corrected wxMSW wxRegion bug git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/msw/gtk.rsp | 2 + docs/bugs.txt | 18 +++++ docs/changes.txt | 2 +- docs/latex/wx/classes.tex | 2 +- docs/latex/wx/fltinstr.tex | 1 + docs/latex/wx/fltoutst.tex | 1 + docs/latex/wx/protocol.tex | 1 + docs/latex/wx/tvalidat.tex | 12 +++- docs/motif/install.txt | 12 +++- docs/msw/install.txt | 15 ++-- docs/readme.txt | 4 +- include/wx/motif/bitmap.h | 4 +- include/wx/motif/icon.h | 8 +-- include/wx/motif/menu.h | 1 + include/wx/msw/menu.h | 1 + include/wx/prop.h | 14 ++-- samples/forty/canvas.cpp | 5 +- samples/forty/card.cpp | 2 +- samples/forty/forty.cpp | 4 +- samples/forty/playerdg.cpp | 6 +- samples/makefile.b32 | 138 ++++++++++++++++++------------------- src/generic/prop.cpp | 14 ++-- src/motif/control.cpp | 2 +- src/motif/dialog.cpp | 28 +++----- src/motif/menu.cpp | 13 ++++ src/motif/window.cpp | 6 +- src/msw/makefile.vc | 6 ++ src/msw/menu.cpp | 9 +++ src/msw/region.cpp | 4 +- 29 files changed, 201 insertions(+), 134 deletions(-) diff --git a/distrib/msw/gtk.rsp b/distrib/msw/gtk.rsp index 6c53a637c5..14cfe7c01d 100644 --- a/distrib/msw/gtk.rsp +++ b/distrib/msw/gtk.rsp @@ -10,6 +10,8 @@ mkinstalldirs wxGTK.spec distrib/gtk/copy_src +distrib/gtk/README.txt +distrib/gtk/Setup docs/gtk/*.html docs/gtk/*.txt diff --git a/docs/bugs.txt b/docs/bugs.txt index 78abe19b55..7a00fc64b3 100644 --- a/docs/bugs.txt +++ b/docs/bugs.txt @@ -4,9 +4,13 @@ wxWindows Buglist wxGTK: ------ +- TODO + wxMSW: ------ +- TODO + wxMotif: -------- @@ -28,6 +32,20 @@ wxMotif: - Can't set the colours for the buttons in the file selector, for some reason. +- On SGI IRIX 6.4, XtDestroyWidget in ~wxWindow causes a crash in + some cicumstances. This is being looked into. Meanwhile, a + possible workaround is to remove the final XtDestroyWidget line in ~wxWindow + (window.cpp). This will mean that child windows will only get + destroyed when frames and dialogs are destroyed, so dynamic subwindow + deletion may not work properly. + +- There are reports that scrolling can cause crashes under Lesstif. + This is probably a Lesstif bug. + General: -------- +- Dialog Editor could be more user-friendly. Controls are hard to + size and position accurately. No way of changing tab order + except by editing .wxr file. + diff --git a/docs/changes.txt b/docs/changes.txt index f0140f39e3..0cec649ba2 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -12,7 +12,7 @@ wxMSW: - Makefiles for more compilers and samples; Cygwin makefiles rationalised. -- Added VC++ project file for compiling as DLL. +- Added VC++ project file for compiling wxWindows as DLL. wxMotif: diff --git a/docs/latex/wx/classes.tex b/docs/latex/wx/classes.tex index 1b99b55c74..5768d09eea 100644 --- a/docs/latex/wx/classes.tex +++ b/docs/latex/wx/classes.tex @@ -191,7 +191,7 @@ $$\image{14cm;0cm}{wxclass.ps}$$ \input strlist.tex \input strmbase.tex \input stream.tex -\input strmmem.tex +%\input strmmem.tex \input sysclevt.tex \input settings.tex \input tab.tex diff --git a/docs/latex/wx/fltinstr.tex b/docs/latex/wx/fltinstr.tex index 4e935524df..a0deb39e6f 100644 --- a/docs/latex/wx/fltinstr.tex +++ b/docs/latex/wx/fltinstr.tex @@ -24,3 +24,4 @@ Initializes a "filter" stream. A filter stream has the capability of a normal stream but it can be placed on the top of another stream. So, for example, it can uncompress, uncrypt the datas which are read from another stream and pass it to the requester. + diff --git a/docs/latex/wx/fltoutst.tex b/docs/latex/wx/fltoutst.tex index 9feae4fd13..c0a775aec9 100644 --- a/docs/latex/wx/fltoutst.tex +++ b/docs/latex/wx/fltoutst.tex @@ -24,3 +24,4 @@ Initializes a "filter" stream. A filter stream has the capability of a normal stream but it can be placed on the top of another stream. So, for example, it can compress, crypt the datas which are passed to it and write them to another stream. + diff --git a/docs/latex/wx/protocol.tex b/docs/latex/wx/protocol.tex index 81c68bc9bb..c2232d2924 100644 --- a/docs/latex/wx/protocol.tex +++ b/docs/latex/wx/protocol.tex @@ -98,3 +98,4 @@ Sets the authentication user. It is mainly useful when FTP is used. \func{void}{SetPassword}{\param{const wxString\&}{ user}} Sets the authentication password. It is mainly useful when FTP is used. + diff --git a/docs/latex/wx/tvalidat.tex b/docs/latex/wx/tvalidat.tex index 2709a704c6..9d910371ee 100644 --- a/docs/latex/wx/tvalidat.tex +++ b/docs/latex/wx/tvalidat.tex @@ -1,6 +1,7 @@ \section{Validator overview}\label{validatoroverview} -Classes: \helpref{wxValidator}{wxvalidator}, \helpref{wxTextValidator}{wxtextvalidator} +Classes: \helpref{wxValidator}{wxvalidator}, \helpref{wxTextValidator}{wxtextvalidator}, +\helpref{wxGenericValidator}{wxgenericvalidator} The aim of the validator concept is to make dialogs very much easier to write. A validator is an object that can be plugged into a control (such as a wxTextCtrl), and @@ -8,8 +9,10 @@ mediates between C++ data and the control, transferring the data in either direc and validating it. It also is able to intercept events generated by the control, providing filtering behaviour without the need to derive a new control class. -You can use a stock validator, such as \helpref{wxTextValidator}{wxtextvalidator}; or -you can write your own. +You can use a stock validator, such as \helpref{wxTextValidator}{wxtextvalidator} (which does text +control data transfer, validation and filtering) and +\helpref{wxGenericValidator}{wxgenericvalidator} (which does data transfer for a range of controls); +or you can write your own. \wxheading{Example} @@ -114,3 +117,6 @@ void wxDialog::OnOK(wxCommandEvent& event) So if using validators and a normal OK button, you may not even need to write any code for handling dialog dismissal. +If you load your dialog from a resource file, you'll need to iterate through the controls +setting validators, since validators can't be specified in a dialog resource. + diff --git a/docs/motif/install.txt b/docs/motif/install.txt index 6e9db5b047..8f39f650df 100644 --- a/docs/motif/install.txt +++ b/docs/motif/install.txt @@ -118,6 +118,15 @@ Troubleshooting functions, try putting the gcc fixinclude file paths early in the include path. +- If you get strange memory problems (for example in deletion + of string arrays), set wxUSE_GLOBAL_MEMORY_OPERATORS to 0 in + setup.h, and recompile. + +- Problems with XtDestroyWidget crashing in ~wxWindow have been + reported on SGI IRIX 6.4. This has not yet been resolved, so + any advice here would be very welcome. See bugs.txt for a + possible temporary workaround. + Other Notes ----------- @@ -163,6 +172,5 @@ compiler and the error message(s) to the wxwin-users mailing list at: wxwin-users@wx.dent.med.uni-muenchen.de - -Julian Smart, January 1999. +Julian Smart, February 1999. julian.smart@ukonline.co.uk diff --git a/docs/msw/install.txt b/docs/msw/install.txt index ddb16cc334..2263c5bc0c 100644 --- a/docs/msw/install.txt +++ b/docs/msw/install.txt @@ -60,7 +60,10 @@ Using project files: 1. Unarchive wx200vc.zip, the VC++ 5 project makefiles. 2. Open src/wxvc.dsp, set Debug or Release configuration, and - compile. This will produce lib/wxvc.lib or lib/wxvc_debug.lib. + compile. This will produce src/Debug/wxvc.lib or + src/Release/wxvc.lib. The project file src/wxvc_dll.dsp + will make a DLL version of wxWindow, which will go in + src/DebugDLL/wxvc.[lib,dll] and src/ReleaseDLL/wxvc.[lib,dll]. 3. Open a sample project file, choose a configuration, and compile. The project files don't use precompiled headers, to save space, but you can switch PCH compiling on for greater speed. @@ -154,8 +157,8 @@ supplied. Watcom C++ 10.6 compilation --------------------------- -1. Make sure your WXWIN variable is set, and uses the FAT (short - name) form. +1. Make sure your WXWIN variable is set, and uses the DOS short + name form. 2. Change directory to wx\src\msw. Type 'wmake -f makefile.wat' to make the wxWindows core library. 3. Change directory to wx\samples\minimal and type 'wmake -f makefile.wat' @@ -173,9 +176,9 @@ Metrowerks CodeWarrior compilation NOTES: (a) Unfortunately CodeWarrior support is broken in this -release. Stefan Csomor (csomor@advancedconcepts.ch) will rectify this shortly. + release. Stefan Csomor (csomor@advancedconcepts.ch) will rectify this shortly. (b) You need CodeWarrior Pro 4 plus the patches to 4.1 from the -Metrowerks Web site. + Metrowerks Web site. Symantec C++ compilation ------------------------ @@ -268,6 +271,8 @@ Here are the steps required: > cd c:\wx\samples\minimal > make -f makefile.g95 + Ignore the warning about the default entry point. + - Use the 'strip' command to reduce executable size. - With Cygnus Cygwin, you can invoke gdb --nw myfile.exe to diff --git a/docs/readme.txt b/docs/readme.txt index d8fff9d674..619896c0fa 100644 --- a/docs/readme.txt +++ b/docs/readme.txt @@ -96,7 +96,7 @@ The wxWindows Web site is located at: http://www.wxwindows.org -The wxGTK Web site (with further wxGTK-specific fiels and +The wxGTK Web site (with further wxGTK-specific files and information) is located at: http://www.freiburg.linux.de/~wxxt @@ -115,5 +115,5 @@ or contact Julian Smart . Good luck! -The wxWindows Team, January 1999 +The wxWindows Team, February 1999 diff --git a/include/wx/motif/bitmap.h b/include/wx/motif/bitmap.h index 39bd89c5a8..644039ef0a 100644 --- a/include/wx/motif/bitmap.h +++ b/include/wx/motif/bitmap.h @@ -144,7 +144,7 @@ public: wxBitmap(char **data, wxControl* control = NULL); // Load a file or resource - wxBitmap(const wxString& name, long type = wxBITMAP_TYPE_XBM); + wxBitmap(const wxString& name, long type = wxBITMAP_TYPE_XPM); // Constructor for generalised creation from data wxBitmap(void *data, long type, int width, int height, int depth = 1); @@ -155,7 +155,7 @@ public: virtual bool Create(int width, int height, int depth = -1); virtual bool Create(void *data, long type, int width, int height, int depth = 1); - virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_XBM); + virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_XPM); virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL); inline bool Ok() const { return (M_BITMAPDATA && M_BITMAPDATA->m_ok); } diff --git a/include/wx/motif/icon.h b/include/wx/motif/icon.h index 4231ec7e05..cbb4f53c69 100644 --- a/include/wx/motif/icon.h +++ b/include/wx/motif/icon.h @@ -50,14 +50,14 @@ public: // Initialize with XPM data wxIcon(char **data); - wxIcon(const wxString& name, long flags = wxBITMAP_TYPE_ICO_RESOURCE, + wxIcon(const wxString& name, long flags = wxBITMAP_TYPE_XPM, int desiredWidth = -1, int desiredHeight = -1); ~wxIcon(); - bool LoadFile(const wxString& name, long flags = wxBITMAP_TYPE_ICO_RESOURCE, + bool LoadFile(const wxString& name, long flags = wxBITMAP_TYPE_XPM, int desiredWidth = -1, int desiredHeight = -1); - bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_XBM) - { return wxBitmap::LoadFile(name, type); } +// bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_XBM) +// { return wxBitmap::LoadFile(name, type); } inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; } inline bool operator == (const wxIcon& icon) { return m_refData == icon.m_refData; } diff --git a/include/wx/motif/menu.h b/include/wx/motif/menu.h index 1ed3a0da6b..22ddece86e 100644 --- a/include/wx/motif/menu.h +++ b/include/wx/motif/menu.h @@ -169,6 +169,7 @@ class WXDLLEXPORT wxMenuBar: public wxEvtHandler { DECLARE_DYNAMIC_CLASS(wxMenuBar) + wxMenuBar( long style ); wxMenuBar(); wxMenuBar(int n, wxMenu *menus[], const wxString titles[]); ~wxMenuBar(); diff --git a/include/wx/msw/menu.h b/include/wx/msw/menu.h index 7c40f1ab0e..33c6701ca6 100644 --- a/include/wx/msw/menu.h +++ b/include/wx/msw/menu.h @@ -143,6 +143,7 @@ class WXDLLEXPORT wxMenuBar: public wxEvtHandler public: wxMenuBar(); + wxMenuBar( long style ); wxMenuBar(int n, wxMenu *menus[], const wxString titles[]); ~wxMenuBar(); diff --git a/include/wx/prop.h b/include/wx/prop.h index 327bd20379..8471c8b0a6 100644 --- a/include/wx/prop.h +++ b/include/wx/prop.h @@ -42,27 +42,27 @@ class WXDLLEXPORT wxPropertySheet: public wxObject { DECLARE_DYNAMIC_CLASS(wxPropertySheet) public: - wxPropertySheet(wxString name = ""); + wxPropertySheet(const wxString& name = ""); ~wxPropertySheet(void); // Set the name of the sheet - inline virtual void SetName(wxString name) { m_name=name; } - inline virtual wxString GetName() { return m_name; } + inline virtual void SetName(const wxString& name) { m_name=name; } + inline virtual wxString GetName() const { return m_name; } // Does this sheet contain a property with this name - virtual bool HasProperty(wxString name); + virtual bool HasProperty(const wxString& name) const; // Set property name to value - virtual bool SetProperty(const wxString name, wxPropertyValue value); + virtual bool SetProperty(const wxString& name, const wxPropertyValue& value); // Remove property from sheet by name, deleting it - virtual void RemoveProperty(wxString name); + virtual void RemoveProperty(const wxString& name); // Get the name of the sheet // Add a property virtual void AddProperty(wxProperty *property); // Get property by name - virtual wxProperty *GetProperty(wxString name); + virtual wxProperty *GetProperty(const wxString& name) const; // Clear all properties virtual void Clear(void); diff --git a/samples/forty/canvas.cpp b/samples/forty/canvas.cpp index 373e16942f..384d2bebbe 100644 --- a/samples/forty/canvas.cpp +++ b/samples/forty/canvas.cpp @@ -51,7 +51,6 @@ FortyCanvas::FortyCanvas(wxWindow* parent, int x, int y, int w, int h) : m_font = wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxNORMAL); #endif SetBackgroundColour(FortyApp::BackgroundColour()); - AllowDoubleClick(TRUE); m_handCursor = new wxCursor(wxCURSOR_HAND); m_arrowCursor = new wxCursor(wxCURSOR_ARROW); @@ -98,7 +97,7 @@ void FortyCanvas::OnDraw(wxDC& dc) // then ask the player for their name if (m_player.Length() == 0 && !m_playerDialog) { - m_playerDialog = new PlayerSelectionDialog(this, m_scoreFile); + m_playerDialog = new PlayerSelectionDialog(this, m_scoreFile); m_playerDialog->ShowModal(); m_player = m_playerDialog->GetPlayersName(); if (m_player.Length() > 0) @@ -108,7 +107,7 @@ void FortyCanvas::OnDraw(wxDC& dc) m_scoreFile->ReadPlayersScore(m_player, wins, games, score); m_game->NewPlayer(wins, games, score); m_game->DisplayScore(dc); - delete m_playerDialog; + m_playerDialog->Destroy(); m_playerDialog = 0; Refresh(); } diff --git a/samples/forty/card.cpp b/samples/forty/card.cpp index 5b5af43963..37999de3ed 100644 --- a/samples/forty/card.cpp +++ b/samples/forty/card.cpp @@ -41,7 +41,7 @@ #include "forty.h" #include "card.h" -#ifdef __WXGTK__ +#if defined(__WXGTK__) || defined(__WXMOTIF__) #include "pictures.xpm" #include "symbols.xbm" #endif diff --git a/samples/forty/forty.cpp b/samples/forty/forty.cpp index 425f420247..4d952a9993 100644 --- a/samples/forty/forty.cpp +++ b/samples/forty/forty.cpp @@ -91,7 +91,7 @@ bool FortyApp::OnInit() -1, -1, 668, 510 ); - // Show the frame + // Show the frame frame->Show(TRUE); return TRUE; @@ -192,7 +192,7 @@ FortyFrame::~FortyFrame() void FortyFrame::OnCloseWindow(wxCloseEvent& event) { - if (m_canvas->OnCloseCanvas()) + if (m_canvas->OnCloseCanvas() ) { this->Destroy(); } diff --git a/samples/forty/playerdg.cpp b/samples/forty/playerdg.cpp index 2b221ecd4a..fa3ea03d04 100644 --- a/samples/forty/playerdg.cpp +++ b/samples/forty/playerdg.cpp @@ -172,17 +172,17 @@ void PlayerSelectionDialog::ButtonCallback(wxCommandEvent& event) else { m_player = name; - Show(FALSE); + EndModal(wxID_OK); } } else { - wxMessageBox("Please enter your name", "Forty Thieves"); + wxMessageBox("Please enter your name", "Forty Thieves"); } } else { m_player = ""; - Show(FALSE); + EndModal(wxID_CANCEL); } } diff --git a/samples/makefile.b32 b/samples/makefile.b32 index 465f71c58e..0c81281ef5 100644 --- a/samples/makefile.b32 +++ b/samples/makefile.b32 @@ -8,7 +8,7 @@ # "%W% %G%" # # Makefile : Builds samples for Win95, BC++ WIN32 -# Use FINAL=1 argument to nmake to build final version with no debugging +# Use FINAL=1 argument to make to build final version with no debugging # info # Set WXDIR for your system @@ -16,146 +16,144 @@ WXDIR = $(WXWIN) THISDIR=$(WXDIR)\samples -!include $(WXDIR)\src\makevc.env - all: cd $(WXDIR)\samples\splitter - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\resource - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\controls - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\listctrl - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\treectrl - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\validate - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\mdi - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\minimal - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\layout - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\printing - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\toolbar - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\dialogs - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\docview - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\docvwmdi - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\controls - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\nativdlg - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\grid - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\internat - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\dnd - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\joytest - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\taskbar - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\sashtest - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) !if "$(FINAL)" == "0" cd $(WXDIR)\samples\memcheck !endif - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\ownerdrw - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\checklst - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\minifram - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\bombs - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\fractal - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\wxpoem - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\typetest - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\proplist - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\image - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) cd $(WXDIR)\samples\dde - nmake -f makefile.b32 FINAL=$(FINAL) + make -f makefile.b32 FINAL=$(FINAL) # cd $(WXDIR)\samples\regtest -# nmake -f makefile.b32 FINAL=$(FINAL) +# make -f makefile.b32 FINAL=$(FINAL) clean: cd $(WXDIR)\samples\splitter - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\mdi - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\minimal - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\layout - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\printing - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\toolbar - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\dialogs - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\resource - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\listctrl - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\treectrl - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\validate - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\docview - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\docvwmdi - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\controls - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\nativdlg - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\grid - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\internat - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\checklst - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\ownerdrw - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\dnd - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\joytest - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\regtest - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\taskbar - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\sashtest - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\memcheck - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\minifram - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\bombs - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\fractal - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\wxpoem - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\typetest - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\proplist - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\image - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples\dde - nmake -f makefile.b32 clean + make -f makefile.b32 clean cd $(WXDIR)\samples diff --git a/src/generic/prop.cpp b/src/generic/prop.cpp index bd2f6c1323..a353201fcc 100644 --- a/src/generic/prop.cpp +++ b/src/generic/prop.cpp @@ -941,7 +941,7 @@ wxPropertyValidator *wxPropertyView::FindPropertyValidator(wxProperty *property) IMPLEMENT_DYNAMIC_CLASS(wxPropertySheet, wxObject) -wxPropertySheet::wxPropertySheet(wxString name) +wxPropertySheet::wxPropertySheet(const wxString& name) :m_properties(wxKEY_STRING),m_name(name) { } @@ -972,7 +972,7 @@ void wxPropertySheet::AddProperty(wxProperty *property) } // Get property by name -wxProperty *wxPropertySheet::GetProperty(wxString name) +wxProperty *wxPropertySheet::GetProperty(const wxString& name) const { wxNode *node = m_properties.Find((const char*) name); if (!node) @@ -980,7 +980,8 @@ wxProperty *wxPropertySheet::GetProperty(wxString name) else return (wxProperty *)node->Data(); } -bool wxPropertySheet::SetProperty(const wxString name, wxPropertyValue value) + +bool wxPropertySheet::SetProperty(const wxString& name, const wxPropertyValue& value) { wxProperty* prop = GetProperty(name); if(prop){ @@ -990,7 +991,8 @@ bool wxPropertySheet::SetProperty(const wxString name, wxPropertyValue value) return FALSE; } } -void wxPropertySheet::RemoveProperty(wxString name) + +void wxPropertySheet::RemoveProperty(const wxString& name) { wxNode *node = m_properties.Find(name); if(node) @@ -1000,10 +1002,12 @@ void wxPropertySheet::RemoveProperty(wxString name) m_properties.DeleteNode(node); } } -bool wxPropertySheet::HasProperty(wxString name) + +bool wxPropertySheet::HasProperty(const wxString& name) const { return (GetProperty(name)?TRUE:FALSE); } + // Clear all properties void wxPropertySheet::Clear(void) { diff --git a/src/motif/control.cpp b/src/motif/control.cpp index 91758e606a..090eae88f8 100644 --- a/src/motif/control.cpp +++ b/src/motif/control.cpp @@ -42,7 +42,7 @@ wxControl::~wxControl() if (parent) { if (parent->GetDefaultItem() == (wxButton*) this) - parent->SetDefaultItem(NULL); + parent->SetDefaultItem((wxButton*) NULL); } } diff --git a/src/motif/dialog.cpp b/src/motif/dialog.cpp index 8cb958e77a..30b03d55b2 100644 --- a/src/motif/dialog.cpp +++ b/src/motif/dialog.cpp @@ -285,26 +285,16 @@ wxDialog::~wxDialog() // but I think this should work, if we destroy the children first. // 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; - if (m_mainWidget) - display = XtDisplay((Widget) m_mainWidget); - else - display = (Display*) wxGetDisplay(); - - XSync(display, FALSE); - XEvent event; - while (XtAppPending((XtAppContext) wxTheApp->GetAppContext())) { - XFlush(display); - XtAppNextEvent((XtAppContext) wxTheApp->GetAppContext(), &event); - XtDispatchEvent(&event); + + // The idea about doing it here is that if you have to remove the + // XtDestroyWidget from ~wxWindow, at least top-level windows + // will still be deleted (and destroy children implicitly). + if (GetMainWidget()) + { + DetachWidget(GetMainWidget()); // Removes event handlers + XtDestroyWidget((Widget) GetMainWidget()); + SetMainWidget((WXWidget) NULL); } -#endif } // By default, pressing escape cancels the dialog diff --git a/src/motif/menu.cpp b/src/motif/menu.cpp index 959d442bb9..b940cce133 100644 --- a/src/motif/menu.cpp +++ b/src/motif/menu.cpp @@ -508,6 +508,19 @@ wxMenuBar::wxMenuBar() m_font = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT); } +wxMenuBar::wxMenuBar(long WXUNUSED(style)) +{ + m_eventHandler = this; + m_menuCount = 0; + m_menus = NULL; + m_titles = NULL; + m_menuBarFrame = NULL; + m_mainWidget = (WXWidget) NULL; + m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_MENU); + m_foregroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_MENUTEXT); + m_font = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT); +} + wxMenuBar::wxMenuBar(int n, wxMenu *menus[], const wxString titles[]) { m_eventHandler = this; diff --git a/src/motif/window.cpp b/src/motif/window.cpp index 8ec4c0d3b5..9fcceb9f7b 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -235,7 +235,11 @@ wxWindow::~wxWindow() // Destroy the window if (GetMainWidget()) { - wxDeleteWindowFromTable((Widget) GetMainWidget()); + // If this line (XtDestroyWidget) causes a crash, you may comment it out. + // Child widgets will get destroyed automatically when a frame + // or dialog is destroyed, but before that you may get some memory + // leaks and potential layout problems if you delete and then add + // child windows. XtDestroyWidget((Widget) GetMainWidget()); SetMainWidget((WXWidget) NULL); } diff --git a/src/msw/makefile.vc b/src/msw/makefile.vc index 4bb2cd095a..365acc54da 100644 --- a/src/msw/makefile.vc +++ b/src/msw/makefile.vc @@ -92,6 +92,7 @@ COMMONOBJS = \ $(COMMDIR)\filefn.obj \ $(COMMDIR)\fileconf.obj \ $(COMMDIR)\framecmn.obj \ + $(COMMDIR)\ftp.obj \ $(COMMDIR)\gdicmn.obj \ $(COMMDIR)\image.obj \ $(COMMDIR)\intl.obj \ @@ -833,6 +834,11 @@ $(COMMDIR)/framecmn.obj: $*.$(SRCSUFF) $(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ << +$(COMMDIR)/ftp.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ +<< + $(COMMDIR)/gdicmn.obj: $*.$(SRCSUFF) cl @<< $(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index dbf1723bef..77923bb06a 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -562,7 +562,16 @@ bool wxWindow::PopupMenu(wxMenu *menu, int x, int y) wxMenuBar::wxMenuBar() { m_eventHandler = this; + m_menuCount = 0; + m_menus = NULL; + m_titles = NULL; + m_menuBarFrame = NULL; + m_hMenu = 0; +} +wxMenuBar::wxMenuBar( long WXUNUSED(style) ) +{ + m_eventHandler = this; m_menuCount = 0; m_menus = NULL; m_titles = NULL; diff --git a/src/msw/region.cpp b/src/msw/region.cpp index e26d294ce7..56846e68dd 100644 --- a/src/msw/region.cpp +++ b/src/msw/region.cpp @@ -351,13 +351,13 @@ void wxRegionIterator::Reset(const wxRegion& region) m_rects = new wxRect[header->nCount]; - RECT* rect = (RECT*) (rgnData + sizeof(RGNDATAHEADER)) ; + RECT* rect = (RECT*) ((char*)rgnData + sizeof(RGNDATAHEADER)) ; size_t i; for (i = 0; i < header->nCount; i++) { m_rects[i] = wxRect(rect->left, rect->top, rect->right - rect->left, rect->bottom - rect->top); - rect += sizeof(RECT); + rect ++; // Advances pointer by sizeof(RECT) } m_numRects = header->nCount;