Added variant.h/cpp; changed variable names in object.h; added some

functions to wxStringList; some bugs fixes


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@730 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 1998-09-12 17:29:57 +00:00
parent cb43b372fb
commit 341287bf49
16 changed files with 1365 additions and 26 deletions

View File

@ -276,7 +276,7 @@ bool wxFile::Flush()
if ( IsOpened() ) {
// @@@ fsync() is not ANSI (BSDish)
// if ( fsync(m_fd) == -1 ) { // TODO
if (TRUE) {
if (wxTrue) {
wxLogSysError(_("can't flush file descriptor %d"), m_fd);
return FALSE;
}

View File

@ -466,6 +466,11 @@ wxList ()
{
}
wxStringList::wxStringList (const wxStringList& list)
{
(*this) = list;
}
// Variable argument list, terminated by a zero
// Makes new storage for the strings
wxStringList::wxStringList (const char *first...)
@ -516,7 +521,12 @@ wxStringList::wxStringList (const char *first...)
wxStringList::~wxStringList (void)
{
wxNode *each = first_node;
Clear();
}
void wxStringList::Clear(void)
{
wxNode *each = First();
while (each)
{
char *s = (char *) each->Data ();
@ -525,6 +535,7 @@ wxStringList::~wxStringList (void)
delete each;
each = next;
}
wxList::Clear();
}
wxNode *wxStringList::Add (const char *s)
@ -605,3 +616,24 @@ bool wxStringList::Member (const char *s) const
}
return FALSE;
}
void wxStringList::operator= (const wxStringList& list)
{
Clear();
wxNode *node = list.First();
while (node)
{
char *s = (char *) node->Data ();
Add(s);
node = node->Next();
}
}
char* wxStringList::operator[] (int i) const
{
wxASSERT_MSG( (i < Number()), "Invalid index for wxStringList" );
return (char*) (Nth(i)->Data());
}

View File

@ -74,7 +74,7 @@ wxObject::~wxObject(void)
* two possible base classes.
*/
bool wxObject::IsKindOf(wxClassInfo *info)
bool wxObject::IsKindOf(wxClassInfo *info) const
{
wxClassInfo *thisInfo = GetClassInfo();
if (thisInfo)
@ -166,7 +166,7 @@ wxClassInfo *wxClassInfo::FindClass(char *c)
// Climb upwards through inheritance hierarchy.
// Dual inheritance is catered for.
bool wxClassInfo::IsKindOf(wxClassInfo *info)
bool wxClassInfo::IsKindOf(wxClassInfo *info) const
{
if (info == NULL)
return FALSE;
@ -352,3 +352,7 @@ wxObjectRefData::~wxObjectRefData(void)
{
}
// These are here so we can avoid 'always true/false' warnings
// by referring to these instead of TRUE/FALSE
const bool wxTrue = TRUE;
const bool wxFalse = FALSE;

View File

@ -613,7 +613,7 @@ bool wxPrintPreviewBase::PaintPage(wxWindow *canvas, wxDC& dc)
double actualWidth = (zoomScale*m_pageWidth*m_previewScale);
// float actualHeight = (float)(zoomScale*m_pageHeight*m_previewScale);
int x = ((canvasWidth - actualWidth)/2.0);
int x = (int) ((canvasWidth - actualWidth)/2.0);
if (x < m_leftMargin)
x = m_leftMargin;
int y = m_topMargin;

1273
src/common/variant.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -12,12 +12,14 @@
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#include "wx/frame.h"
#include "wx/defs.h"
#include "wx/window.h"

View File

@ -52,7 +52,7 @@ wxSashLayoutWindow::wxSashLayoutWindow(wxWindow *parent, wxWindowID id, const wx
// dimensions.
void wxSashLayoutWindow::OnQueryLayoutInfo(wxQueryLayoutInfoEvent& event)
{
int flags = event.GetFlags();
// int flags = event.GetFlags();
int requestedLength = event.GetRequestedLength();
// This code won't be in the final thing, it's just so we don't have to give it
@ -145,6 +145,11 @@ void wxSashLayoutWindow::OnCalculateLayout(wxCalculateLayoutEvent& event)
clientSize.height -= thisRect.height;
break;
}
case wxLAYOUT_NONE:
{
break;
}
}
if ((flags & wxLAYOUT_QUERY) == 0)

View File

@ -198,6 +198,10 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
dragRect = wxRect(xp, yp, newWidth, h);
break;
}
case wxSASH_NONE:
{
break;
}
}
wxSashEvent event(GetId(), edge);
@ -271,7 +275,7 @@ void wxSashWindow::OnSize(wxSizeEvent& WXUNUSED(event))
SizeWindows();
}
wxSashEdgePosition wxSashWindow::SashHitTest(int x, int y, int tolerance)
wxSashEdgePosition wxSashWindow::SashHitTest(int x, int y, int WXUNUSED(tolerance))
{
int cx, cy;
GetClientSize(& cx, & cy);
@ -310,6 +314,10 @@ wxSashEdgePosition wxSashWindow::SashHitTest(int x, int y, int tolerance)
return wxSASH_LEFT;
break;
}
case wxSASH_NONE:
{
break;
}
}
}
}
@ -570,7 +578,7 @@ void wxSashWindow::InitColours()
m_hilightColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DHILIGHT);
#else
m_faceColour = *(wxTheColourDatabase->FindColour("LIGHT GREY"));
m_mediumShadowColour = *(wxTheColourDatabase->FindColour("GREY", 1, wxSOLID));
m_mediumShadowColour = *(wxTheColourDatabase->FindColour("GREY"));
m_darkShadowColour = *(wxTheColourDatabase->FindColour("BLACK"));
m_lightShadowColour = *(wxTheColourDatabase->FindColour("LIGHT GREY"));
m_hilightColour = *(wxTheColourDatabase->FindColour("WHITE"));

View File

@ -54,6 +54,7 @@ LIB_CPP_SRC=\
common/sckstrm.cpp \
common/validate.cpp \
common/valtext.cpp \
common/variant.cpp \
common/wxexpr.cpp \
common/socket.cpp \
common/sckaddr.cpp \
@ -117,10 +118,12 @@ LIB_CPP_SRC=\
generic/gridg.cpp \
generic/imaglist.cpp \
generic/listctrl.cpp \
generic/laywin.cpp \
generic/msgdlgg.cpp \
generic/panelg.cpp \
generic/printps.cpp \
generic/prntdlgg.cpp \
generic/sashwin.cpp \
generic/scrolwin.cpp \
generic/splitter.cpp \
generic/statusbr.cpp \

View File

@ -58,7 +58,13 @@ OPTIONS= # -D__MINGW32__ # -D__EGCS__
# IRIX: -g3
DEBUGFLAGS = -ggdb -D__WXDEBUG__
# Debug/trace mode. 1 or more for debugging.
# Debug/trace mode. 1 or more for memory debugging.
# Unfortunately this doesn't seem to work with GnuWin32 - get warning:
# ../../include/wx/memory.h:58: warning: declaration of `operator delete(void *)'
# throws different exceptions
# <internal>:58: warning: previous declaration here
# So setting to 0 for now.
WXDEBUG=0
WIN95=1

View File

@ -857,7 +857,7 @@ wxTextCtrl* wxListCtrl::EditLabel(long item, wxClassInfo* textControlClass)
// End label editing, optionally cancelling the edit
bool wxListCtrl::EndEditLabel(bool cancel)
{
wxASSERT( FALSE);
wxFAIL;
/* I don't know how to implement this: there's no such macro as ListView_EndEditLabelNow.
* ???

View File

@ -117,6 +117,7 @@ COMMONOBJS = \
$(MSWDIR)\utilscmn.obj \
$(MSWDIR)\validate.obj \
$(MSWDIR)\valtext.obj \
$(MSWDIR)\variant.obj \
$(MSWDIR)\date.obj \
$(MSWDIR)\hash.obj \
$(MSWDIR)\list.obj \
@ -526,6 +527,8 @@ $(MSWDIR)\list.obj: $(COMMDIR)\list.$(SRCSUFF)
$(MSWDIR)\string.obj: $(COMMDIR)\string.$(SRCSUFF)
$(MSWDIR)\variant.obj: $(COMMDIR)\variant.$(SRCSUFF)
$(MSWDIR)\matrix.obj: $(COMMDIR)\matrix.$(SRCSUFF)
$(MSWDIR)\time.obj: $(COMMDIR)\time.$(SRCSUFF)

View File

@ -105,6 +105,7 @@ COMMONOBJS = \
$(COMMDIR)\wxexpr.obj \
$(COMMDIR)\hash.obj \
$(COMMDIR)\list.obj \
$(COMMDIR)\variant.obj \
$(COMMDIR)\string.obj \
$(COMMDIR)\time.obj \
$(COMMDIR)\y_tab.obj \
@ -817,6 +818,11 @@ $(COMMDIR)/list.obj: $*.$(SRCSUFF)
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
<<
$(COMMDIR)/variant.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
<<
$(COMMDIR)/string.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)

View File

@ -112,6 +112,7 @@ COMMONOBJS = \
$(COMMDIR)/wxexpr.$(OBJSUFF) \
$(COMMDIR)/hash.$(OBJSUFF) \
$(COMMDIR)/list.$(OBJSUFF) \
$(COMMDIR)/variant.$(OBJSUFF) \
$(COMMDIR)/string.$(OBJSUFF) \
$(COMMDIR)/time.$(OBJSUFF) \
$(COMMDIR)/tokenzr.$(OBJSUFF) \

View File

@ -131,6 +131,7 @@ COMMONOBJS = \
$(COMMDIR)\stream.obj \
$(COMMDIR)\datstrm.obj \
$(COMMDIR)\objstrm.obj \
$(COMMDIR)\variant.obj \
$(COMMDIR)\wincmn.obj
MSWOBJS = \
@ -982,16 +983,6 @@ $(COMMDIR)/matrix.obj: $*.$(SRCSUFF)
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
<<
#$(COMMDIR)/wxstrgnu/wxstrgnu.obj: $*.$(SRCSUFF)
# cl @<<
#$(CPPFLAGS2) /c /Tp $*.$(SRCSUFF) /Fo$@
#<<
#$(COMMDIR)/wxstrgnu/wxregex.obj: $*.$(SRCSUFF)
# cl @<<
#$(CPPFLAGS2) /c /Tp $*.$(SRCSUFF) /Fo$@
#<<
$(COMMDIR)/time.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
@ -1034,12 +1025,17 @@ $(CPPFLAGS2) /c $*.c /Fo$@
$(COMMDIR)/process.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS2) /c /Tp $*.$(SRCSUFF) /Fo$@
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
<<
$(COMMDIR)/variant.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
<<
$(COMMDIR)/wincmn.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS2) /c /Tp $*.$(SRCSUFF) /Fo$@
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
<<
$(COMMDIR)/y_tab.obj: $*.c $(COMMDIR)/lex_yy.c

View File

@ -104,6 +104,6 @@ test: example.exe minigzip.exe
echo hello world | minigzip | minigzip -d
clean:
del *.obj
del *.exe
del $(LIBTARGET)
erase *.obj
erase *.exe
erase $(LIBTARGET)