From 74e34480fbfd892bc6450c3978b825b81c3c870b Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 26 Nov 1998 09:56:02 +0000 Subject: [PATCH] Fixed Dialog Editor compilation and window sizing bug. Various warning-related fixed. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1059 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/msw/install.txt | 2 +- docs/msw/issues.txt | 31 ------------------------------- include/wx/event.h | 2 +- include/wx/fileconf.h | 7 ++++--- include/wx/gtk/accel.h | 8 ++++---- include/wx/gtk/region.h | 2 +- include/wx/gtk1/accel.h | 8 ++++---- include/wx/gtk1/region.h | 2 +- include/wx/list.h | 1 + include/wx/msw/setup.h | 6 ------ include/wx/time.h | 2 +- samples/memcheck/makefile.g95 | 1 - src/msw/makefile.g95 | 3 ++- utils/dialoged/src/reseditr.cpp | 2 +- utils/dialoged/src/reswrite.cpp | 2 +- utils/dialoged/src/symbtabl.cpp | 6 +++--- utils/dialoged/src/winprop.cpp | 2 +- utils/wxprop/src/proplist.cpp | 3 ++- 18 files changed, 28 insertions(+), 62 deletions(-) diff --git a/docs/msw/install.txt b/docs/msw/install.txt index 5f6609cb81..3a2834a09a 100644 --- a/docs/msw/install.txt +++ b/docs/msw/install.txt @@ -111,7 +111,7 @@ and other intermediate compiler files. Gotchas: -- libwx.a is 28 MB or more - but only 2.9 MB if compiled with no +- libwx.a is 48 MB or more - but much less if compiled with no debug info (-g0) and level 4 optimization (-O4). - install.exe doesn't have built-in decompression because lzexpand.lib isn't available with Gnu-Win32. However, you can use it with external diff --git a/docs/msw/issues.txt b/docs/msw/issues.txt index d8df16c583..25655ae98d 100644 --- a/docs/msw/issues.txt +++ b/docs/msw/issues.txt @@ -1,37 +1,6 @@ Current issues and bugs ----------------------- -Debugging code --------------- - -wxDebugContext and global memory operators doesn't work correctly, -for different (unresolved) reasons on different compilers. - -1) In VC++ 5.0, if you use wxDebugAlloc for new and wxDebugFree -for delete, you get a crash to do with deallocating the debug -buffer in wxDebugContext. So although the global operators are -defined, they are #ifdefed to just call malloc and free to avoid -the problem. This means that non-object memory checking doesn't work. -The problem does seem to be something to do with a pointer -mysteriously changing its address, very similar to 2). - -2) In BC++ 4.5, there isn't a crash, but instead the ofstream -pointer passed to SetStream from SetFile (which is called in -memcheck.cpp) gets mysteriously changed as it's passed to SetStream. -This means that when counting the number of outstanding memory -blocks, we can't compare the allocated block with m_debugStream -to say 'ignore this block because we can't free it before the -very end of the application'. Therefore it always looks like -there's a memory leak of one object, in memory.cpp, unless you -don't call wxDebugContext::SetFile. - -The fact that pointers appear to change in both cases must -indicate a common problem and solution. If we could use the -standard global memory operators for ofstream and -wxDebugStreamBuf it might help, but I don't know how to do that - -I've redefined 'new' throughout as WXDEBUG_NEW (which is itself -defined as the 3-argument operator). - Owner-draw menus ---------------- diff --git a/include/wx/event.h b/include/wx/event.h index 3ccfb3b428..327b2bdfc5 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -1135,7 +1135,7 @@ const wxEventTable theClass::sm_eventTable =\ const wxEventTableEntry theClass::sm_eventTableEntries[] = { \ #define END_EVENT_TABLE() \ - { 0, 0, 0, 0 } }; + { 0, 0, 0, 0, 0 } }; /* * Event table macros diff --git a/include/wx/fileconf.h b/include/wx/fileconf.h index 24b1a95902..532f0c4a63 100644 --- a/include/wx/fileconf.h +++ b/include/wx/fileconf.h @@ -193,6 +193,9 @@ public: class LineList { public: + void SetNext(LineList *pNext) { m_pNext = pNext; } + void SetPrev(LineList *pPrev) { m_pPrev = pPrev; } + // ctor LineList(const wxString& str, LineList *pNext = (LineList *) NULL) : m_strLine(str) { SetNext(pNext); SetPrev((LineList *) NULL); } @@ -200,8 +203,6 @@ public: // LineList *Next() const { return m_pNext; } LineList *Prev() const { return m_pPrev; } - void SetNext(LineList *pNext) { m_pNext = pNext; } - void SetPrev(LineList *pPrev) { m_pPrev = pPrev; } // void SetText(const wxString& str) { m_strLine = str; } @@ -316,9 +317,9 @@ public: wxFileConfig *Config() const { return m_pConfig; } bool IsDirty() const { return m_bDirty; } - bool IsEmpty() const { return Entries().IsEmpty() && Groups().IsEmpty(); } const ArrayEntries& Entries() const { return m_aEntries; } const ArrayGroups& Groups() const { return m_aSubgroups; } + bool IsEmpty() const { return Entries().IsEmpty() && Groups().IsEmpty(); } // find entry/subgroup (NULL if not found) ConfigGroup *FindSubgroup(const char *szName) const; diff --git a/include/wx/gtk/accel.h b/include/wx/gtk/accel.h index d2eb53c070..4765e6fe3d 100644 --- a/include/wx/gtk/accel.h +++ b/include/wx/gtk/accel.h @@ -83,16 +83,16 @@ class wxAcceleratorTable: public wxObject wxAcceleratorTable(int n, wxAcceleratorEntry entries[] ); ~wxAcceleratorTable(); - inline wxAcceleratorTable(const wxAcceleratorTable& accel) + inline wxAcceleratorTable(const wxAcceleratorTable& accel) : wxObject() { Ref(accel); } inline wxAcceleratorTable(const wxAcceleratorTable* accel) { if (accel) Ref(*accel); } - inline wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) - { if (*this == accel) return (*this); Ref(accel); return *this; } - inline bool operator == (const wxAcceleratorTable& accel) + inline bool operator == (const wxAcceleratorTable& accel) { return m_refData == accel.m_refData; } inline bool operator != (const wxAcceleratorTable& accel) { return m_refData != accel.m_refData; } + inline wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) + { if (*this == accel) return (*this); Ref(accel); return *this; } bool Ok() const; diff --git a/include/wx/gtk/region.h b/include/wx/gtk/region.h index 7ab28ddbd8..33af4087c3 100644 --- a/include/wx/gtk/region.h +++ b/include/wx/gtk/region.h @@ -58,7 +58,7 @@ class wxRegion : public wxGDIObject wxRegion(void); ~wxRegion(void); - inline wxRegion( const wxRegion& r ) + inline wxRegion( const wxRegion& r ): wxGDIObject() { Ref(r); } inline wxRegion& operator = ( const wxRegion& r ) { Ref(r); return (*this); } diff --git a/include/wx/gtk1/accel.h b/include/wx/gtk1/accel.h index d2eb53c070..4765e6fe3d 100644 --- a/include/wx/gtk1/accel.h +++ b/include/wx/gtk1/accel.h @@ -83,16 +83,16 @@ class wxAcceleratorTable: public wxObject wxAcceleratorTable(int n, wxAcceleratorEntry entries[] ); ~wxAcceleratorTable(); - inline wxAcceleratorTable(const wxAcceleratorTable& accel) + inline wxAcceleratorTable(const wxAcceleratorTable& accel) : wxObject() { Ref(accel); } inline wxAcceleratorTable(const wxAcceleratorTable* accel) { if (accel) Ref(*accel); } - inline wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) - { if (*this == accel) return (*this); Ref(accel); return *this; } - inline bool operator == (const wxAcceleratorTable& accel) + inline bool operator == (const wxAcceleratorTable& accel) { return m_refData == accel.m_refData; } inline bool operator != (const wxAcceleratorTable& accel) { return m_refData != accel.m_refData; } + inline wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) + { if (*this == accel) return (*this); Ref(accel); return *this; } bool Ok() const; diff --git a/include/wx/gtk1/region.h b/include/wx/gtk1/region.h index 7ab28ddbd8..33af4087c3 100644 --- a/include/wx/gtk1/region.h +++ b/include/wx/gtk1/region.h @@ -58,7 +58,7 @@ class wxRegion : public wxGDIObject wxRegion(void); ~wxRegion(void); - inline wxRegion( const wxRegion& r ) + inline wxRegion( const wxRegion& r ): wxGDIObject() { Ref(r); } inline wxRegion& operator = ( const wxRegion& r ) { Ref(r); return (*this); } diff --git a/include/wx/list.h b/include/wx/list.h index 795b5f579b..ee4df382e9 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -142,6 +142,7 @@ public: // @@ no check is done that the list is really keyed on strings const char *GetKeyString() const { return m_key.string; } + long GetKeyInteger() const { return m_key.integer; } #ifdef wxLIST_COMPATIBILITY // compatibility methods diff --git a/include/wx/msw/setup.h b/include/wx/msw/setup.h index f4846c3d61..1b96a7e26e 100644 --- a/include/wx/msw/setup.h +++ b/include/wx/msw/setup.h @@ -125,12 +125,6 @@ // be WXDEBUG_NEW (see object.h). // If this causes problems (e.g. link errors), set this to 0. -// GnuWin32 (b19) can't copy with these operators. -#ifdef __GNUWIN32__ -#undef wxUSE_GLOBAL_MEMORY_OPERATORS 1 -#define wxUSE_GLOBAL_MEMORY_OPERATORS 0 -#endif - #define REMOVE_UNUSED_ARG 1 // Set this to 0 if your compiler can't cope // with omission of prototype parameters. diff --git a/include/wx/time.h b/include/wx/time.h index 22fff97f9c..aed87d86ee 100644 --- a/include/wx/time.h +++ b/include/wx/time.h @@ -49,6 +49,7 @@ private: // static member functions public: wxTime(); // current time wxTime(clockTy s) { sec = s; } + void operator=(const wxTime& t) { sec = t.sec; } // Ordering required for some compilers wxTime(const wxTime& t) { (*this) = t ; } wxTime(hourTy h, minuteTy m, secondTy s =0, bool dst =FALSE); wxTime(const wxDate&, hourTy h =0, minuteTy m =0, secondTy s=0, bool dst =FALSE); @@ -61,7 +62,6 @@ public: bool operator>=(const wxTime& t) const { return sec >= t.sec; } bool operator==(const wxTime& t) const { return sec == t.sec; } bool operator!=(const wxTime& t) const { return sec != t.sec; } - void operator=(const wxTime& t) { sec = t.sec; } friend wxTime operator+(const wxTime& t, long s) { return wxTime(t.sec+s); } friend wxTime operator+(long s, const wxTime& t) { return wxTime(t.sec+s); } long operator-(const wxTime& t) const { return sec - t.sec; } diff --git a/samples/memcheck/makefile.g95 b/samples/memcheck/makefile.g95 index 08f1d7f262..468c694dd6 100644 --- a/samples/memcheck/makefile.g95 +++ b/samples/memcheck/makefile.g95 @@ -26,7 +26,6 @@ $(OBJDIR): memcheck$(GUISUFFIX)$(EXESUFF): $(OBJECTS) $(WXLIB) $(CC) $(LDFLAGS) -o memcheck$(GUISUFFIX)$(EXESUFF) $(OBJECTS) $(LDLIBS) - $(RSRC) memcheck.$(RESSUFF) memcheck.exe $(OBJDIR)/memcheck.$(OBJSUFF): memcheck.$(SRCSUFF) $(CC) -c $(CPPFLAGS) -o $@ memcheck.$(SRCSUFF) diff --git a/src/msw/makefile.g95 b/src/msw/makefile.g95 index cffc8f2cd7..eb06cd8071 100644 --- a/src/msw/makefile.g95 +++ b/src/msw/makefile.g95 @@ -221,13 +221,14 @@ MSWOBJS = \ wave.$(OBJSUFF) \ window.$(OBJSUFF) -# OLE not supported yet by GnuWin32 (?) +# OLE not supported yet by GnuWin32 # $(OLEDIR)/droptgt.$(OBJSUFF) \ # $(OLEDIR)/dropsrc.$(OBJSUFF) \ # $(OLEDIR)/dataobj.$(OBJSUFF) \ # $(OLEDIR)/oleutils.$(OBJSUFF) \ # $(OLEDIR)/uuid.$(OBJSUFF) + OBJECTS = $(MSWOBJS) $(COMMONOBJS) $(GENERICOBJS) all: $(OBJECTS) $(WXLIB) diff --git a/utils/dialoged/src/reseditr.cpp b/utils/dialoged/src/reseditr.cpp index c41b680fdb..00adb89d7d 100644 --- a/utils/dialoged/src/reseditr.cpp +++ b/utils/dialoged/src/reseditr.cpp @@ -653,7 +653,7 @@ wxItemResource *wxResourceManager::FindResourceForWindow(wxWindow *win) wxWindow *w = (wxWindow *)node->Data(); if (w == win) { - return (wxItemResource *)node->key.integer; + return (wxItemResource *)node->GetKeyInteger(); } } return NULL; diff --git a/utils/dialoged/src/reswrite.cpp b/utils/dialoged/src/reswrite.cpp index ef58aaefe6..9cdde107dc 100644 --- a/utils/dialoged/src/reswrite.cpp +++ b/utils/dialoged/src/reswrite.cpp @@ -32,6 +32,7 @@ #if wxUSE_IOSTREAMH #if defined(__WXMSW__) && !defined(__GNUWIN32__) #include +#include #else #include #include @@ -41,7 +42,6 @@ #include #endif - #include "wx/scrolbar.h" #include "wx/string.h" diff --git a/utils/dialoged/src/symbtabl.cpp b/utils/dialoged/src/symbtabl.cpp index b82e0ccb37..110764e782 100644 --- a/utils/dialoged/src/symbtabl.cpp +++ b/utils/dialoged/src/symbtabl.cpp @@ -133,7 +133,7 @@ bool wxResourceSymbolTable::WriteIncludeFile(const wxString& filename) wxNode* node = m_hashTable.Next(); while (node) { - char* str = node->key.string; + const char* str = node->GetKeyString(); int id = (int) node->Data() ; if (!IsStandardSymbol(str)) @@ -181,7 +181,7 @@ wxString wxResourceSymbolTable::GetSymbolForId(int id) wxNode* node = m_hashTable.Next(); while (node) { - char* str = node->key.string; + const char* str = node->GetKeyString(); if (str && ( ((int) node->Data()) == id) ) return wxString(str); @@ -323,7 +323,7 @@ bool wxResourceSymbolTable::FillComboBox(wxComboBox* comboBox) wxNode* node = m_hashTable.Next(); while (node) { - char* str = node->key.string; + const char* str = node->GetKeyString(); comboBox->Append(str); node = m_hashTable.Next(); diff --git a/utils/dialoged/src/winprop.cpp b/utils/dialoged/src/winprop.cpp index 6b485e5a69..5be5ca236a 100644 --- a/utils/dialoged/src/winprop.cpp +++ b/utils/dialoged/src/winprop.cpp @@ -308,7 +308,7 @@ wxProperty *wxWindowPropertyInfo::GetProperty(wxString& name) } else if (name == "height") { - return new wxProperty("width", (long)resource->GetHeight(), "integer"); + return new wxProperty("height", (long)resource->GetHeight(), "integer"); } else if (name == "id") { diff --git a/utils/wxprop/src/proplist.cpp b/utils/wxprop/src/proplist.cpp index d95005262a..606d83b59b 100644 --- a/utils/wxprop/src/proplist.cpp +++ b/utils/wxprop/src/proplist.cpp @@ -438,7 +438,8 @@ bool wxPropertyListView::CreateControls(void) #endif // May need to be changed in future to eliminate clashes with app. - panel->SetClientData((char *)this); + // WHAT WAS THIS FOR? +// panel->SetClientData((char *)this); // These buttons are at the bottom of the window, but create them now // so the constraints are evaluated in the correct order -- 2.47.2