From: Julian Smart Date: Sun, 31 Jan 1999 13:58:17 +0000 (+0000) Subject: Various small fixes X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0a240683ed2ed0ad7efe733d451dd36740607605 Various small fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/distrib/msw/cw.rsp b/distrib/msw/cw.rsp index d032bd9478..0b552666ae 100644 --- a/distrib/msw/cw.rsp +++ b/distrib/msw/cw.rsp @@ -5,6 +5,8 @@ include/wx_cw.pch include/wx_cw.pch++ include/wx_cw_d.pch include/wx_cw_d.pch++ +include/wx_x86++_d.mch +include/wx_x86_d.mch samples/bombs/make_cw.mcp diff --git a/docs/msw/install.txt b/docs/msw/install.txt index 6cb0f70a7a..78b70e8193 100644 --- a/docs/msw/install.txt +++ b/docs/msw/install.txt @@ -137,6 +137,13 @@ Metrowerks CodeWarrior compilation Further project files for samples will be available in due course. +NOTES: + +(a) Unfortunately CodeWarrior support is broken in this +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. + Symantec C++ compilation ------------------------ diff --git a/docs/msw/todo.txt b/docs/msw/todo.txt index 3ace16d97d..0fa40eff7d 100644 --- a/docs/msw/todo.txt +++ b/docs/msw/todo.txt @@ -33,19 +33,9 @@ e.g. ',' instead of '.' for decimal points. Supply correct ctl3d/odbc lib files for BC++, Watcom (corrupt?) -16-bit compilation: replace small icons in treectrl/listctrl -samples that also have a 32x32 icon, with icons with only one -image, using Borland Image Editor. WIN16 doesn't have a function -for specifying which image to use, so the larger one gets used -erroneously. +Implement new wxClipboard and DnD (Vadim) -Add headers to VC++ project files. - -Implement Robert's wxClipboard. - -Distribution naming? - -wxToolTip +Implement wxToolTip LOW PRIORITY (MEDIUM TERM) -------------------------- @@ -97,8 +87,6 @@ Miscellaneous file/system function wrappers. Bug database. -OpenGL integration: check that wxGLCanvas works cross-platform. - Menu bitmaps - document Vadim's enhancements. wxCreateDynamicObject is apparently slow: ~ 2000 calls to strcmp. Need to diff --git a/include/wx/confbase.h b/include/wx/confbase.h index 2fcb50efee..edbe8ca2ca 100644 --- a/include/wx/confbase.h +++ b/include/wx/confbase.h @@ -109,8 +109,8 @@ public: // Not all args will always be used by derived classes, but // including them all in each class ensures compatibility. // If appName is empty, uses wxApp name - wxConfigBase(const wxString& appName = "", const wxString& vendorName = "", - const wxString& localFilename = "", const wxString& globalFilename = "", + wxConfigBase(const wxString& appName = wxEmptyString, const wxString& vendorName = wxEmptyString, + const wxString& localFilename = wxEmptyString, const wxString& globalFilename = wxEmptyString, long style = 0); // empty but ensures that dtor of all derived classes is virtual @@ -152,7 +152,7 @@ public: virtual bool Read(const wxString& key, wxString *pStr) const = 0; virtual bool Read(const wxString& key, wxString *pStr, const wxString& defVal) const; - virtual wxString Read(const wxString& key, const wxString& defVal = "") const; + virtual wxString Read(const wxString& key, const wxString& defVal = wxEmptyString) const; virtual bool Read(const wxString& key, long *pl) const = 0; virtual bool Read(const wxString& key, long *pl, long defVal) const; diff --git a/include/wx/filefn.h b/include/wx/filefn.h index 3127f1c51e..3c78364288 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -104,8 +104,8 @@ WXDLLEXPORT char* wxExpandPath(char *dest, const char *path); // and make (if under the home tree) relative to home // [caller must copy-- volatile] WXDLLEXPORT char* wxContractPath(const wxString& filename, - const wxString& envname = "", - const wxString& user = ""); + const wxString& envname = wxEmptyString, + const wxString& user = wxEmptyString); // Destructive removal of /./ and /../ stuff WXDLLEXPORT char* wxRealPath(char *path); diff --git a/include/wx/generic/listctrl.h b/include/wx/generic/listctrl.h index 810d91f9a6..697ce88046 100644 --- a/include/wx/generic/listctrl.h +++ b/include/wx/generic/listctrl.h @@ -314,10 +314,10 @@ class WXDLLEXPORT wxListLineData : public wxObject public: wxList m_items; - wxRectangle m_bound_all; - wxRectangle m_bound_label; - wxRectangle m_bound_icon; - wxRectangle m_bound_hilight; + wxRect m_bound_all; + wxRect m_bound_label; + wxRect m_bound_icon; + wxRect m_bound_hilight; int m_mode; bool m_hilighted; wxBrush *m_hilightBrush; @@ -342,15 +342,15 @@ class WXDLLEXPORT wxListLineData : public wxObject void GetText( int index, wxString &s ); void SetText( int index, const wxString s ); int GetImage( int index ); - void GetRect( wxRectangle &rect ); + void GetRect( wxRect &rect ); void Hilight( bool on ); void ReverseHilight( void ); void DrawRubberBand( wxDC *dc, bool on ); void Draw( wxDC *dc ); - bool IsInRect( int x, int y, const wxRectangle &rect ); + bool IsInRect( int x, int y, const wxRect &rect ); bool IsHilighted( void ); - void AssignRect( wxRectangle &dest, int x, int y, int width, int height ); - void AssignRect( wxRectangle &dest, const wxRectangle &source ); + void AssignRect( wxRect &dest, int x, int y, int width, int height ); + void AssignRect( wxRect &dest, const wxRect &source ); }; //----------------------------------------------------------------------------- @@ -503,7 +503,7 @@ class WXDLLEXPORT wxListMainWindow: public wxScrolledWindow void SetItemState( long item, long state, long stateMask ); int GetItemState( long item, long stateMask ); int GetItemCount( void ); - void GetItemRect( long index, wxRectangle &rect ); + void GetItemRect( long index, wxRect &rect ); bool GetItemPosition(long item, wxPoint& pos); int GetSelectedItemCount( void ); void SetMode( long mode ); @@ -568,7 +568,7 @@ class WXDLLEXPORT wxListCtrl: public wxControl void SetItemText( long item, const wxString& str ); long GetItemData( long item ) const; bool SetItemData( long item, long data ); - bool GetItemRect( long item, wxRectangle& rect, int code = wxLIST_RECT_BOUNDS ) const; + bool GetItemRect( long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS ) const; bool GetItemPosition( long item, wxPoint& pos ) const; bool SetItemPosition( long item, const wxPoint& pos ); // not supported in wxGLC int GetItemCount(void) const; diff --git a/include/wx/msw/setup.h b/include/wx/msw/setup.h index 5e58c37d5f..0d40d36837 100644 --- a/include/wx/msw/setup.h +++ b/include/wx/msw/setup.h @@ -281,6 +281,13 @@ #endif +#if defined(__WXMSW__) && !defined(__WIN32__) + +#undef wxUSE_THREADS +#define wxUSE_THREADS 0 + +#endif + // Minimal setup e.g. for compiling small utilities #define MINIMAL_WXWINDOWS_SETUP 0 diff --git a/samples/config/conftest.def b/samples/config/conftest.def new file mode 100644 index 0000000000..5db07c48eb --- /dev/null +++ b/samples/config/conftest.def @@ -0,0 +1,7 @@ +NAME Conftest +DESCRIPTION 'wxWindows Config Sample' +EXETYPE WINDOWS +CODE PRELOAD MOVEABLE DISCARDABLE +DATA PRELOAD MOVEABLE MULTIPLE +HEAPSIZE 4048 +STACKSIZE 16000 diff --git a/samples/treectrl/bitmaps/file1.ico b/samples/treectrl/bitmaps/file1.ico index cc828ab4f2..1ee29d83fb 100644 Binary files a/samples/treectrl/bitmaps/file1.ico and b/samples/treectrl/bitmaps/file1.ico differ diff --git a/samples/treectrl/bitmaps/folder1.ico b/samples/treectrl/bitmaps/folder1.ico index c43de1c07c..387080ef43 100644 Binary files a/samples/treectrl/bitmaps/folder1.ico and b/samples/treectrl/bitmaps/folder1.ico differ diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index 59bfba85ac..3868180f3d 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -279,7 +279,7 @@ MyTreeCtrl::MyTreeCtrl(wxWindow *parent, const wxWindowID id, // should correspond to TreeCtrlIcon_xxx enum #if defined(__WXMSW__) && defined(__WIN16__) // This is required in 16-bit Windows mode only because we can't load a specific (16x16) - // icon image, so it comes out blank (using the empty 32x32 icon). + // icon image, so it comes out stretched m_imageListNormal->Add(wxBitmap("bitmap1", wxBITMAP_TYPE_BMP_RESOURCE)); m_imageListNormal->Add(wxBitmap("bitmap2", wxBITMAP_TYPE_BMP_RESOURCE)); #else diff --git a/src/common/file.cpp b/src/common/file.cpp index 2d3f2c1329..8dacc13967 100644 --- a/src/common/file.cpp +++ b/src/common/file.cpp @@ -324,7 +324,7 @@ size_t wxFile::Write(const void *pBuf, size_t nCount) bool wxFile::Flush() { if ( IsOpened() ) { - #if defined(_MSC_VER) || wxHAVE_FSYNC + #if (defined(_MSC_VER) && !defined(__MWERKS__)) || wxHAVE_FSYNC if ( fsync(m_fd) == -1 ) { wxLogSysError(_("can't flush file descriptor %d"), m_fd); diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 5e198b6dac..22f789c196 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -443,7 +443,7 @@ void wxListLineData::GetLabelExtent( int &x, int &y, int &width, int &height ) height = m_bound_label.height; } -void wxListLineData::GetRect( wxRectangle &rect ) +void wxListLineData::GetRect( wxRect &rect ) { AssignRect( rect, m_bound_all ); } @@ -641,7 +641,7 @@ void wxListLineData::Draw( wxDC *dc ) DoDraw( dc, m_hilighted, m_hilighted ); } -bool wxListLineData::IsInRect( int x, int y, const wxRectangle &rect ) +bool wxListLineData::IsInRect( int x, int y, const wxRect &rect ) { return ((x >= rect.x) && (x <= rect.x+rect.width) && (y >= rect.y) && (y <= rect.y+rect.height)); @@ -652,7 +652,7 @@ bool wxListLineData::IsHilighted( void ) return m_hilighted; } -void wxListLineData::AssignRect( wxRectangle &dest, int x, int y, int width, int height ) +void wxListLineData::AssignRect( wxRect &dest, int x, int y, int width, int height ) { dest.x = x; dest.y = y; @@ -660,7 +660,7 @@ void wxListLineData::AssignRect( wxRectangle &dest, int x, int y, int width, int dest.height = height; } -void wxListLineData::AssignRect( wxRectangle &dest, const wxRectangle &source ) +void wxListLineData::AssignRect( wxRect &dest, const wxRect &source ) { dest.x = source.x; dest.y = source.y; @@ -1029,7 +1029,7 @@ void wxListMainWindow::RefreshLine( wxListLineData *line ) wxClientDC dc(this); PrepareDC( dc ); line->GetExtent( x, y, w, h ); - wxRectangle rect( + wxRect rect( dc.LogicalToDeviceX(x-3), dc.LogicalToDeviceY(y-3), dc.LogicalToDeviceXRel(w+6), @@ -1826,7 +1826,7 @@ int wxListMainWindow::GetItemCount( void ) return m_lines.Number(); } -void wxListMainWindow::GetItemRect( long index, wxRectangle &rect ) +void wxListMainWindow::GetItemRect( long index, wxRect &rect ) { wxNode *node = m_lines.Nth( index ); if (node) @@ -1848,7 +1848,7 @@ bool wxListMainWindow::GetItemPosition(long item, wxPoint& pos) wxNode *node = m_lines.Nth( item ); if (node) { - wxRectangle rect; + wxRect rect; wxListLineData *line = (wxListLineData*)node->Data(); line->GetRect( rect ); pos.x = rect.x; @@ -2511,7 +2511,7 @@ bool wxListCtrl::SetItemData( long item, long data ) return TRUE; } -bool wxListCtrl::GetItemRect( long item, wxRectangle &rect, int WXUNUSED(code) ) const +bool wxListCtrl::GetItemRect( long item, wxRect &rect, int WXUNUSED(code) ) const { m_mainWin->GetItemRect( item, rect ); return TRUE; diff --git a/src/generic/prop.cpp b/src/generic/prop.cpp index b63cafa0cf..bd2f6c1323 100644 --- a/src/generic/prop.cpp +++ b/src/generic/prop.cpp @@ -985,9 +985,9 @@ bool wxPropertySheet::SetProperty(const wxString name, wxPropertyValue value) wxProperty* prop = GetProperty(name); if(prop){ prop->SetValue(value); - return true; + return TRUE; }else{ - return false; + return FALSE; } } void wxPropertySheet::RemoveProperty(wxString name) @@ -1002,7 +1002,7 @@ void wxPropertySheet::RemoveProperty(wxString name) } bool wxPropertySheet::HasProperty(wxString name) { - return (GetProperty(name)?true:false); + return (GetProperty(name)?TRUE:FALSE); } // Clear all properties void wxPropertySheet::Clear(void) diff --git a/src/generic/treectrl.cpp b/src/generic/treectrl.cpp index 99b984f77d..522b3d9ad3 100644 --- a/src/generic/treectrl.cpp +++ b/src/generic/treectrl.cpp @@ -570,7 +570,7 @@ wxTreeItemId wxTreeCtrl::GetLastChild(const wxTreeItemId& item) const wxCHECK_MSG( item.IsOk(), wxTreeItemId(), "invalid tree item" ); wxArrayTreeItems& children = item.m_pItem->GetChildren(); - return children.IsEmpty() ? wxTreeItemId() : children.Last(); + return (children.IsEmpty() ? wxTreeItemId() : wxTreeItemId(children.Last())); } wxTreeItemId wxTreeCtrl::GetNextSibling(const wxTreeItemId& item) const diff --git a/src/make_cw.mcp b/src/make_cw.mcp index 32016cd192..4a0fabde94 100644 Binary files a/src/make_cw.mcp and b/src/make_cw.mcp differ diff --git a/src/makeprog.bcc b/src/makeprog.bcc index 95ae2e1160..e8f20a2b00 100644 --- a/src/makeprog.bcc +++ b/src/makeprog.bcc @@ -16,13 +16,13 @@ nul $(LIBS) $(TARGET).def ! - rc -K $(TARGET).res + brc -K $(TARGET).res .$(SRCSUFF).obj: bcc $(CPPFLAGS) -c {$< } $(TARGET).res : $(TARGET).rc $(WXDIR)\include\wx\msw\wx.rc - rc -r /i$(BCCDIR)\include /i$(WXDIR)\include $(TARGET) + brc -r /i$(BCCDIR)\include /i$(WXDIR)\include $(TARGET) clean: -erase *.obj diff --git a/src/makewat.env b/src/makewat.env index d52e0c2dac..64abaf4388 100644 --- a/src/makewat.env +++ b/src/makewat.env @@ -52,8 +52,9 @@ MINDATA = MAXDATA = STACK = option stack=64k EXTRALIBS = $(WXDIR)\lib\zlib.lib $(WXDIR)\lib\png.lib $(WXDIR)\lib\xpm.lib & - $(WATLIBDIR)\odbc32.lib $(WATLIBDIR)\comctl32.lib $(WATLIBDIR)\comdlg32.lib & - $(WATLIBDIR)\ole32.lib $(WATLIBDIR)\oleaut32.lib $(WATLIBDIR)\uuid.lib + $(WATLIBDIR)\comctl32.lib $(WATLIBDIR)\comdlg32.lib & + $(WATLIBDIR)\ole32.lib $(WATLIBDIR)\oleaut32.lib & + $(WATLIBDIR)\uuid.lib # $(WATLIBDIR)\odbc32.lib IFLAGS = -i=$(WXINC) -i=$(%watcom)\h;$(%watcom)\h\nt # -i=$(WXDIR)\include\wx\msw\gnuwin32 RESFLAGS1 = -r -bt=nt /i$(WXDIR)\include RESFLAGS2 = -R $(name) /i$(WXDIR)\include diff --git a/src/msw/iniconf.cpp b/src/msw/iniconf.cpp index c249619a24..9bb3f31d92 100644 --- a/src/msw/iniconf.cpp +++ b/src/msw/iniconf.cpp @@ -355,7 +355,7 @@ bool wxIniConfig::Read(const wxString& szKey, long *pl) const // is it really nMagic? lVal = GetPrivateProfileInt(m_strGroup, strKey, nMagic2, m_strLocalFilename); - if ( lVal == nMagic ) { + if ( lVal == nMagic2 ) { // the nMagic it returned was indeed read from the file *pl = lVal; return TRUE; diff --git a/src/msw/makefile.bcc b/src/msw/makefile.bcc index f4a4898606..bf74b2988f 100644 --- a/src/msw/makefile.bcc +++ b/src/msw/makefile.bcc @@ -77,7 +77,6 @@ GENERICOBJS= \ $(MSWDIR)\helpxlp.obj \ $(MSWDIR)\laywin.obj \ $(MSWDIR)\listctrl.obj \ - $(MSWDIR)\msgdlgg.obj \ $(MSWDIR)\notebook.obj \ $(MSWDIR)\panelg.obj \ $(MSWDIR)\prop.obj \ @@ -91,6 +90,7 @@ GENERICOBJS= \ $(MSWDIR)\textdlgg.obj \ $(MSWDIR)\treectrl.obj +# $(MSWDIR)\msgdlgg.obj \ # $(MSWDIR)\printps.obj \ # $(MSWDIR)\prntdlgg.obj \ @@ -115,7 +115,6 @@ COMMONOBJS = \ $(MSWDIR)\memory.obj \ $(MSWDIR)\module.obj \ $(MSWDIR)\object.obj \ - $(MSWDIR)\postscrp.obj \ $(MSWDIR)\prntbase.obj \ $(MSWDIR)\resource.obj \ $(MSWDIR)\resourc2.obj \ @@ -506,8 +505,6 @@ $(MSWDIR)\object.obj: $(COMMDIR)\object.$(SRCSUFF) $(MSWDIR)\odbc.obj: $(COMMDIR)\odbc.$(SRCSUFF) -$(MSWDIR)\postscrp.obj: $(COMMDIR)\postscrp.$(SRCSUFF) - $(MSWDIR)\prntbase.obj: $(COMMDIR)\prntbase.$(SRCSUFF) $(MSWDIR)\resource.obj: $(COMMDIR)\resource.$(SRCSUFF) @@ -702,7 +699,7 @@ $(CFG): makefile.bcc -Fs- -Vf -Ff=4 --I$(WXINC);$(BCCDIR)\include;$(WXDIR)/src/png;$(WXDIR)/src/zlib +-I$(WXINC);$(BCCDIR)\include;$(WXDIR)/src/png;$(WXDIR)/src/zlib;$(WXDIR)/src/xpm -I$(WXDIR)\include\wx\msw\gnuwin32 -L$(BCCDIR)\lib -D__WXWIN__ diff --git a/src/msw/makefile.g95 b/src/msw/makefile.g95 index 4cd5a40d0e..846779e281 100644 --- a/src/msw/makefile.g95 +++ b/src/msw/makefile.g95 @@ -130,8 +130,6 @@ COMMONOBJS = \ $(COMMDIR)/extended.$(OBJSUFF) \ $(COMMDIR)/wincmn.$(OBJSUFF) -# $(COMMDIR)/postscrp.$(OBJSUFF) \ - # NOTE: if the socket-related files fail with a syntax error in Sockets.h, # remove the files (probably all GnuWin32 releases < b20). Cygwin b20 is OK, # Mingw32 may still have problems. diff --git a/src/msw/makefile.sl b/src/msw/makefile.sl index 1a08e2b644..dbd5d612b0 100644 --- a/src/msw/makefile.sl +++ b/src/msw/makefile.sl @@ -570,9 +570,6 @@ object.obj: $(COMMDIR)\object.cpp odbc.obj: $(COMMDIR)\odbc.cpp $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\odbc.cpp /BINARY odbc.obj -postscrp.obj: $(COMMDIR)\postcrp.cpp - $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\postcrp.cpp /BINARY postscrp.obj - prntbase.obj: $(COMMDIR)\prntbase.cpp $(CCC) $(CPPFLAGS) $(IFLAGS) $(COMMDIR)\prntbase.cpp /BINARY prntbase.obj diff --git a/src/msw/makefile.vc b/src/msw/makefile.vc index b197ff7de3..908f09f85b 100644 --- a/src/msw/makefile.vc +++ b/src/msw/makefile.vc @@ -76,8 +76,7 @@ NONESSENTIALOBJS= \ $(GENDIR)\msgdlgg.obj \ $(GENDIR)\helpxlp.obj \ $(GENDIR)\colrdlgg.obj \ - $(GENDIR)\fontdlgg.obj \ - $(COMMDIR)\postscrp.obj + $(GENDIR)\fontdlgg.obj COMMONOBJS = \ $(COMMDIR)\cmndata.obj \ @@ -882,11 +881,6 @@ $(COMMDIR)/odbc.obj: $*.$(SRCSUFF) $(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ << -$(COMMDIR)/postscrp.obj: $*.$(SRCSUFF) - cl @<< -$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ -<< - $(COMMDIR)/prntbase.obj: $*.$(SRCSUFF) cl @<< $(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ diff --git a/src/msw/makefile.wat b/src/msw/makefile.wat index 9315e3d1b3..5e14fef2ee 100644 --- a/src/msw/makefile.wat +++ b/src/msw/makefile.wat @@ -223,7 +223,7 @@ $(LIBTARGET) : $(OBJECTS) # wlib /b /c /n /p=512 $^@ @tmp.lbc -clean: $(EXTRATARGETSCLEAN) +clean: .SYMBOLIC $(EXTRATARGETSCLEAN) -erase *.obj -erase $(LIBTARGET) -erase *.pch @@ -582,9 +582,6 @@ object.obj: $(COMMDIR)\object.cpp odbc.obj: $(COMMDIR)\odbc.cpp *$(CCC) $(CPPFLAGS) $(IFLAGS) $< -postscrp.obj: $(COMMDIR)\postcrp.cpp - *$(CCC) $(CPPFLAGS) $(IFLAGS) $< - prntbase.obj: $(COMMDIR)\prntbase.cpp *$(CCC) $(CPPFLAGS) $(IFLAGS) $< diff --git a/src/xpm/xpm34.h b/src/xpm/xpm34.h index fba32dbc2b..1f7c046197 100644 --- a/src/xpm/xpm34.h +++ b/src/xpm/xpm34.h @@ -40,7 +40,7 @@ #ifndef XPM_h #define XPM_h -#if defined(_WINDOWS) || defined(__WXMSW__) || defined(WIN32) +#if (defined(_WINDOWS) || defined(__WXMSW__) || defined(WIN32)) && !defined(FOR_MSW) #define FOR_MSW #endif