From e70f5e1301456e02668807d3795a5f2912c2ea86 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Thu, 5 Aug 1999 20:38:51 +0000 Subject: [PATCH] Compile fix for dynarray, Use wxStreams in dialoged, Small typo in wxApp::OnIdle() Distrib things, wxPython makefile corrections (libpy.c and libptr.c missing) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3295 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/gtk/Setup | 2 +- distrib/gtk/copy_src | 2 +- docs/latex/wx/manual.tex | 2 +- include/wx/dynarray.h | 9 ++++++--- include/wx/resource.h | 10 +++++----- samples/resource/dialog1.wxr | 22 +++++++++++----------- src/gtk/app.cpp | 10 ++-------- src/gtk1/app.cpp | 10 ++-------- utils/dialoged/src/dlghndlr.cpp | 10 ---------- utils/dialoged/src/reseditr.cpp | 10 ---------- utils/dialoged/src/reseditr.h | 5 +++-- utils/dialoged/src/reswrite.cpp | 25 ++++++++----------------- utils/dialoged/src/winprop.cpp | 10 ---------- wxGTK.spec | 4 ++-- wxMotif.spec | 4 ++-- wxWINE.spec | 2 +- 16 files changed, 45 insertions(+), 92 deletions(-) diff --git a/distrib/gtk/Setup b/distrib/gtk/Setup index 60f8fd0db1..ec11650375 100644 --- a/distrib/gtk/Setup +++ b/distrib/gtk/Setup @@ -37,7 +37,7 @@ TARGETDIR=$(BINLIBDEST)/wxPython wxc wx.cpp helpers.cpp windows.cpp events.cpp misc.cpp gdi.cpp \ mdi.cpp controls.cpp controls2.cpp windows2.cpp cmndlgs.cpp \ frames.cpp stattool.cpp windows3.cpp image.cpp misc2.cpp \ - utils.cpp printfw.cpp \ + utils.cpp printfw.cpp libpy.c libptr.c \ ## comment out the next line to disable wxGLCanvas ##_glcanvas.cpp glcanvas.cpp -DWITH_GLCANVAS -lGL -lGLU \ -I. $(WX_CONFIG_CFLAGS) -I/usr/local/lib/glib/include \ diff --git a/distrib/gtk/copy_src b/distrib/gtk/copy_src index 915369398b..9dcda76273 100755 --- a/distrib/gtk/copy_src +++ b/distrib/gtk/copy_src @@ -811,4 +811,4 @@ cp README.txt ~/wxgtk_dist/wxGTK/utils/wxPython cp Setup ~/wxgtk_dist/wxGTK/utils/wxPython/src cd ~/wxgtk_dist -tar ch wxGTK | gzip -f9 > wxGTK-2.1.0-b8b.tgz +tar ch wxGTK | gzip -f9 > wxGTK-2.1.0-b8.tgz diff --git a/docs/latex/wx/manual.tex b/docs/latex/wx/manual.tex index db52b67158..1a718b141a 100644 --- a/docs/latex/wx/manual.tex +++ b/docs/latex/wx/manual.tex @@ -30,7 +30,7 @@ %\winhelponly{\\$$\image{1cm;0cm}{wxwin.wmf}$$} }} \winhelpignore{\author{Julian Smart, Robert Roebling, Vadim Zeitlin et al} -\date{June 12th 1999} +\date{August 6th 1999} } \makeindex \begin{document} diff --git a/include/wx/dynarray.h b/include/wx/dynarray.h index c15997d203..34aaff0a2b 100644 --- a/include/wx/dynarray.h +++ b/include/wx/dynarray.h @@ -174,9 +174,11 @@ class WXDLLEXPORT name : public wxBaseArray \ { \ public: \ name() \ - { size_t type = sizeof(T); \ + { \ + size_t type = sizeof(T); \ size_t sizelong = sizeof(long); \ - wxASSERT( type <= sizelong ); \ + if ( type <= sizelong ) \ + { wxFAIL_MSG( _T("illegal use of DEFINE_ARRAY") ); } \ } \ \ name& operator=(const name& src) \ @@ -237,7 +239,8 @@ public: \ name(SCMPFUNC##T fn) \ { size_t type = sizeof(T); \ size_t sizelong = sizeof(long); \ - wxASSERT( type <= sizelong ); \ + if ( type <= sizelong ) \ + { wxFAIL_MSG( _T("illegal use of DEFINE_ARRAY") ); } \ m_fnCompare = fn; \ } \ \ diff --git a/include/wx/resource.h b/include/wx/resource.h index 7e1f825e0f..bbd5aa1f75 100644 --- a/include/wx/resource.h +++ b/include/wx/resource.h @@ -88,10 +88,10 @@ class WXDLLEXPORT wxItemResource: public wxObject inline long GetStyle() const { return m_windowStyle; } inline int GetId() const { return m_windowId; } - inline long GetValue1() const { return m_value1; } - inline long GetValue2() const { return m_value2; } - inline long GetValue3() const { return m_value3; } - inline long GetValue5() const { return m_value5; } + inline wxInt32 GetValue1() const { return m_value1; } + inline wxInt32 GetValue2() const { return m_value2; } + inline wxInt32 GetValue3() const { return m_value3; } + inline wxInt32 GetValue5() const { return m_value5; } inline wxString GetValue4() const { return m_value4; } inline wxList& GetChildren() const { return (wxList&) m_children; } inline wxStringList& GetStringValues() const { return (wxStringList&) m_stringValues; } @@ -105,7 +105,7 @@ class WXDLLEXPORT wxItemResource: public wxObject inline wxColour& GetButtonColour() const { return (wxColour&) m_buttonColour; } inline void SetResourceStyle(long style) { m_exStyle = style; } - inline long GetResourceStyle() const { return m_exStyle; } + inline wxInt32 GetResourceStyle() const { return m_exStyle; } protected: wxList m_children; diff --git a/samples/resource/dialog1.wxr b/samples/resource/dialog1.wxr index 690edaa08c..6823b00437 100644 --- a/samples/resource/dialog1.wxr +++ b/samples/resource/dialog1.wxr @@ -2,25 +2,25 @@ static char *dialog1 = "dialog(name = 'dialog1',\ style = 'wxRAISED_BORDER | wxCAPTION | wxTHICK_FRAME | wxSYSTEM_MENU',\ title = 'Test dialog box',\ id = 100,\ - x = 10, y = 10, width = 198, height = 147,\ + x = 10, y = 10, width = 197, height = 146,\ background_colour = 'D6D6D6',\ use_dialog_units = 1,\ use_system_defaults = 1,\ - font = [12, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'Swiss'],\ + font = [12, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0],\ control = [101, wxStaticBox, 'wxStaticBox', '0', 'group6', 5, 7, 184, 103,\ - [12, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'Swiss']],\ - control = [102, wxRadioBox, 'Radiobox', 'wxRA_HORIZONTAL', 'radiobox2', 15, 24, 36, 58, ['One', 'Two', 'Three', 'Four'], 1,\ - [12, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'Swiss']],\ + [12, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]],\ + control = [102, wxRadioBox, 'Radiobox', 'wxRA_SPECIFY_COLS', 'radiobox2', 13, 24, 40, 72, ['One', 'Two', 'Three', 'Four', 'One more'], 1,\ + [12, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]],\ control = [104, wxTextCtrl, '', 'wxTE_MULTILINE', 'multitext3', 62, 24, 67, 33, 'wxWindows rules!',\ - [12, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'Swiss']],\ + [12, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]],\ control = [105, wxListBox, '', '0', 'listbox4', 62, 66, 67, 33, ['Apples', 'Bananas', 'Pears', 'Kiwis'],\ - [12, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'Swiss']],\ + [12, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]],\ control = [106, wxCheckBox, 'Checkbox', '0', 'checkbox9', 141, 26, 36, 14, 0,\ - [12, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'Swiss']],\ + [12, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]],\ control = [107, wxStaticText, 'My Message', '0', 'message10', 143, 57, 39, 12, '',\ - [12, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'Swiss']],\ + [12, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]],\ control = [108, wxButton, 'Press me', '0', 'button7', 141, 81, 36, 13, '',\ - [12, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'Swiss']],\ + [12, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]],\ control = [109, wxButton, 'Cancel', '0', 'button8', 62, 119, 55, 17, '',\ - [12, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'Swiss']])."; + [12, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]])."; diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index a81c4dd205..d3323035ce 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -414,14 +414,6 @@ bool wxApp::ProcessIdle() event.SetEventObject( this ); ProcessEvent( event ); - wxWindowList::Node* node = wxTopLevelWindows.GetFirst(); - while (node) - { - wxWindow* win = node->GetData(); - win->OnInternalIdle(); - node = node->GetNext(); - } - return event.MoreRequested(); } @@ -485,6 +477,8 @@ bool wxApp::SendIdleEvents( wxWindow* win ) win->ProcessEvent(event); + win->OnInternalIdle(); + if (event.MoreRequested()) needMore = TRUE; diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp index a81c4dd205..d3323035ce 100644 --- a/src/gtk1/app.cpp +++ b/src/gtk1/app.cpp @@ -414,14 +414,6 @@ bool wxApp::ProcessIdle() event.SetEventObject( this ); ProcessEvent( event ); - wxWindowList::Node* node = wxTopLevelWindows.GetFirst(); - while (node) - { - wxWindow* win = node->GetData(); - win->OnInternalIdle(); - node = node->GetNext(); - } - return event.MoreRequested(); } @@ -485,6 +477,8 @@ bool wxApp::SendIdleEvents( wxWindow* win ) win->ProcessEvent(event); + win->OnInternalIdle(); + if (event.MoreRequested()) needMore = TRUE; diff --git a/utils/dialoged/src/dlghndlr.cpp b/utils/dialoged/src/dlghndlr.cpp index d8c428e47b..794043ecb0 100644 --- a/utils/dialoged/src/dlghndlr.cpp +++ b/utils/dialoged/src/dlghndlr.cpp @@ -29,16 +29,6 @@ #include #include -#if wxUSE_IOSTREAMH -#if defined(__WXMSW__) && !defined(__GNUWIN32__) -#include -#else -#include -#endif -#else -#include -#endif - #include "reseditr.h" #include "winprop.h" #include "dlghndlr.h" diff --git a/utils/dialoged/src/reseditr.cpp b/utils/dialoged/src/reseditr.cpp index da588d9349..e6157c5e82 100644 --- a/utils/dialoged/src/reseditr.cpp +++ b/utils/dialoged/src/reseditr.cpp @@ -44,16 +44,6 @@ #include #include -#if wxUSE_IOSTREAMH -#if defined(__WXMSW__) && !defined(__GNUWIN32__) -#include -#else -#include -#endif -#else -#include -#endif - #ifdef __WXMSW__ #include "wx/help.h" #endif diff --git a/utils/dialoged/src/reseditr.h b/utils/dialoged/src/reseditr.h index 56e17c1adf..c0b2c6840b 100644 --- a/utils/dialoged/src/reseditr.h +++ b/utils/dialoged/src/reseditr.h @@ -26,6 +26,7 @@ #include "wx/imaglist.h" #include "wx/treectrl.h" #include "wx/proplist.h" +#include "wx/txtstrm.h" #include "symbtabl.h" #include "winstyle.h" @@ -117,7 +118,7 @@ class wxResourceTableWithSaving: public wxResourceTable m_styleTable.Init(); } virtual bool Save(const wxString& filename); - virtual bool SaveResource(ostream& stream, wxItemResource* item, wxItemResource* parentItem); + virtual bool SaveResource(wxTextOutputStream& stream, wxItemResource* item, wxItemResource* parentItem); void GeneratePanelStyleString(long windowStyle, char *buf); void GenerateDialogStyleString(long windowStyle, char *buf); @@ -144,7 +145,7 @@ class wxResourceTableWithSaving: public wxResourceTable bool GenerateStyle(char *buf, long windowStyle, long flag, char *strStyle); */ - void OutputFont(ostream& stream, const wxFont& font); + void OutputFont(wxTextOutputStream& stream, const wxFont& font); wxControl *CreateItem(wxPanel *panel, const wxItemResource *childResource, const wxItemResource* parentResource); protected: diff --git a/utils/dialoged/src/reswrite.cpp b/utils/dialoged/src/reswrite.cpp index 9cdde107dc..3959269ab0 100644 --- a/utils/dialoged/src/reswrite.cpp +++ b/utils/dialoged/src/reswrite.cpp @@ -29,21 +29,10 @@ #include #include -#if wxUSE_IOSTREAMH -#if defined(__WXMSW__) && !defined(__GNUWIN32__) -#include -#include -#else -#include -#include -#endif -#else -#include -#include -#endif - #include "wx/scrolbar.h" #include "wx/string.h" +#include "wx/wfstream.h" +#include "wx/txtstrm.h" #include "reseditr.h" @@ -60,7 +49,7 @@ wxControl *wxResourceTableWithSaving::CreateItem(wxPanel *panel, const wxItemRes return item; } -void wxResourceTableWithSaving::OutputFont(ostream& stream, const wxFont& font) +void wxResourceTableWithSaving::OutputFont(wxTextOutputStream& stream, const wxFont& font) { stream << "[" << font.GetPointSize() << ", '"; stream << font.GetFamilyString() << "', '"; @@ -78,10 +67,12 @@ void wxResourceTableWithSaving::OutputFont(ostream& stream, const wxFont& font) bool wxResourceTableWithSaving::Save(const wxString& filename) { - ofstream stream(((wxString &) filename).GetData()); - if (stream.bad()) + wxFileOutputStream file_output( filename.fn_str() ); + if (file_output.LastError()) return FALSE; + wxTextOutputStream stream( file_output ); + BeginFind(); wxNode *node = NULL; while ((node = Next())) @@ -98,7 +89,7 @@ bool wxResourceTableWithSaving::Save(const wxString& filename) return TRUE; } -bool wxResourceTableWithSaving::SaveResource(ostream& stream, wxItemResource* item, wxItemResource* parentItem) +bool wxResourceTableWithSaving::SaveResource(wxTextOutputStream& stream, wxItemResource* item, wxItemResource* parentItem) { char styleBuf[400]; wxString itemType(item->GetType()); diff --git a/utils/dialoged/src/winprop.cpp b/utils/dialoged/src/winprop.cpp index afebc0f554..ad0bd926f6 100644 --- a/utils/dialoged/src/winprop.cpp +++ b/utils/dialoged/src/winprop.cpp @@ -29,16 +29,6 @@ #include #include -#if wxUSE_IOSTREAMH -#if defined(__WXMSW__) && !defined(__GNUWIN32__) -#include -#else -#include -#endif -#else -#include -#endif - #ifdef __WXMSW__ #include #endif diff --git a/wxGTK.spec b/wxGTK.spec index 2f490b78d4..e0839a4e80 100644 --- a/wxGTK.spec +++ b/wxGTK.spec @@ -9,7 +9,7 @@ Version: %{ver} Release: %{rel} Copyright: wxWindows Licence Group: X11/Libraries -Source: ftp://wesley.informatik.uni-freiburg.de/pub/linux/wxxt/source/wxGTK-2.1.0-b7.tgz +Source: ftp://wesley.informatik.uni-freiburg.de/pub/linux/wxxt/source/wxGTK-2.1.0-b8.tgz URL: http://wesley.informatik.uni-freiburg.de/~wxxt/docs.html Packager: Robert Roebling Requires: gtk+ >= 1.2.1 @@ -27,7 +27,7 @@ Motif/LessTif, MS Windows, Mac) from the same source code. %prep %setup -n wxGTK -./configure --prefix=%{pref} --enable-threads +./configure --prefix=%{pref} --enable-threads --disable-std_iostreams %build cd src && make diff --git a/wxMotif.spec b/wxMotif.spec index 4f248f85c7..b750c4b634 100644 --- a/wxMotif.spec +++ b/wxMotif.spec @@ -9,7 +9,7 @@ Version: %{ver} Release: %{rel} Copyright: wxWindows Licence Group: X11/Libraries -Source: ftp://wesley.informatik.uni-freiburg.de/pub/linux/wxxt/source/wxMotif-2.1.0-b7.tgz +Source: ftp://wesley.informatik.uni-freiburg.de/pub/linux/wxxt/source/wxMotif-2.1.0-b8.tgz URL: http://wesley.informatik.uni-freiburg.de/~wxxt/docs.html Packager: Robert Roebling BuildRoot: /tmp/wxmotif_root @@ -26,7 +26,7 @@ Motif/LessTif, MS Windows, Mac) from the same source code. %prep %setup -n wxMotif -./configure --prefix=%{pref} +./configure --prefix=%{pref} --disable-threads --disable-std_iostreams %build cd src && make diff --git a/wxWINE.spec b/wxWINE.spec index 0aca200369..70e5230a10 100644 --- a/wxWINE.spec +++ b/wxWINE.spec @@ -9,7 +9,7 @@ Version: %{ver} Release: %{rel} Copyright: wxWindows Licence Group: X11/Libraries -Source: ftp://wesley.informatik.uni-freiburg.de/pub/linux/wxxt/source/wxWINE-2.1.0-b7.tgz +Source: ftp://wesley.informatik.uni-freiburg.de/pub/linux/wxxt/source/wxWINE-2.1.0-b8.tgz URL: http://wesley.informatik.uni-freiburg.de/~wxxt/docs.html Packager: Robert Roebling BuildRoot: /tmp/wxwine_root -- 2.45.2