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:
@@ -276,7 +276,7 @@ bool wxFile::Flush()
|
|||||||
if ( IsOpened() ) {
|
if ( IsOpened() ) {
|
||||||
// @@@ fsync() is not ANSI (BSDish)
|
// @@@ fsync() is not ANSI (BSDish)
|
||||||
// if ( fsync(m_fd) == -1 ) { // TODO
|
// if ( fsync(m_fd) == -1 ) { // TODO
|
||||||
if (TRUE) {
|
if (wxTrue) {
|
||||||
wxLogSysError(_("can't flush file descriptor %d"), m_fd);
|
wxLogSysError(_("can't flush file descriptor %d"), m_fd);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@@ -466,6 +466,11 @@ wxList ()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxStringList::wxStringList (const wxStringList& list)
|
||||||
|
{
|
||||||
|
(*this) = list;
|
||||||
|
}
|
||||||
|
|
||||||
// Variable argument list, terminated by a zero
|
// Variable argument list, terminated by a zero
|
||||||
// Makes new storage for the strings
|
// Makes new storage for the strings
|
||||||
wxStringList::wxStringList (const char *first...)
|
wxStringList::wxStringList (const char *first...)
|
||||||
@@ -516,7 +521,12 @@ wxStringList::wxStringList (const char *first...)
|
|||||||
|
|
||||||
wxStringList::~wxStringList (void)
|
wxStringList::~wxStringList (void)
|
||||||
{
|
{
|
||||||
wxNode *each = first_node;
|
Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxStringList::Clear(void)
|
||||||
|
{
|
||||||
|
wxNode *each = First();
|
||||||
while (each)
|
while (each)
|
||||||
{
|
{
|
||||||
char *s = (char *) each->Data ();
|
char *s = (char *) each->Data ();
|
||||||
@@ -525,6 +535,7 @@ wxStringList::~wxStringList (void)
|
|||||||
delete each;
|
delete each;
|
||||||
each = next;
|
each = next;
|
||||||
}
|
}
|
||||||
|
wxList::Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxNode *wxStringList::Add (const char *s)
|
wxNode *wxStringList::Add (const char *s)
|
||||||
@@ -605,3 +616,24 @@ bool wxStringList::Member (const char *s) const
|
|||||||
}
|
}
|
||||||
return FALSE;
|
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());
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -74,7 +74,7 @@ wxObject::~wxObject(void)
|
|||||||
* two possible base classes.
|
* two possible base classes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool wxObject::IsKindOf(wxClassInfo *info)
|
bool wxObject::IsKindOf(wxClassInfo *info) const
|
||||||
{
|
{
|
||||||
wxClassInfo *thisInfo = GetClassInfo();
|
wxClassInfo *thisInfo = GetClassInfo();
|
||||||
if (thisInfo)
|
if (thisInfo)
|
||||||
@@ -166,7 +166,7 @@ wxClassInfo *wxClassInfo::FindClass(char *c)
|
|||||||
|
|
||||||
// Climb upwards through inheritance hierarchy.
|
// Climb upwards through inheritance hierarchy.
|
||||||
// Dual inheritance is catered for.
|
// Dual inheritance is catered for.
|
||||||
bool wxClassInfo::IsKindOf(wxClassInfo *info)
|
bool wxClassInfo::IsKindOf(wxClassInfo *info) const
|
||||||
{
|
{
|
||||||
if (info == NULL)
|
if (info == NULL)
|
||||||
return FALSE;
|
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;
|
||||||
|
@@ -613,7 +613,7 @@ bool wxPrintPreviewBase::PaintPage(wxWindow *canvas, wxDC& dc)
|
|||||||
double actualWidth = (zoomScale*m_pageWidth*m_previewScale);
|
double actualWidth = (zoomScale*m_pageWidth*m_previewScale);
|
||||||
// float actualHeight = (float)(zoomScale*m_pageHeight*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)
|
if (x < m_leftMargin)
|
||||||
x = m_leftMargin;
|
x = m_leftMargin;
|
||||||
int y = m_topMargin;
|
int y = m_topMargin;
|
||||||
|
1273
src/common/variant.cpp
Normal file
1273
src/common/variant.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@@ -12,12 +12,14 @@
|
|||||||
// For compilers that support precompilation, includes "wx.h".
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
#include "wx/wxprec.h"
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
#ifdef __BORLANDC__
|
#ifdef __BORLANDC__
|
||||||
#pragma hdrstop
|
#pragma hdrstop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/frame.h"
|
#include "wx/frame.h"
|
||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
#include "wx/window.h"
|
#include "wx/window.h"
|
||||||
|
|
||||||
|
@@ -52,7 +52,7 @@ wxSashLayoutWindow::wxSashLayoutWindow(wxWindow *parent, wxWindowID id, const wx
|
|||||||
// dimensions.
|
// dimensions.
|
||||||
void wxSashLayoutWindow::OnQueryLayoutInfo(wxQueryLayoutInfoEvent& event)
|
void wxSashLayoutWindow::OnQueryLayoutInfo(wxQueryLayoutInfoEvent& event)
|
||||||
{
|
{
|
||||||
int flags = event.GetFlags();
|
// int flags = event.GetFlags();
|
||||||
int requestedLength = event.GetRequestedLength();
|
int requestedLength = event.GetRequestedLength();
|
||||||
|
|
||||||
// This code won't be in the final thing, it's just so we don't have to give it
|
// 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;
|
clientSize.height -= thisRect.height;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case wxLAYOUT_NONE:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flags & wxLAYOUT_QUERY) == 0)
|
if ((flags & wxLAYOUT_QUERY) == 0)
|
||||||
|
@@ -198,6 +198,10 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
|
|||||||
dragRect = wxRect(xp, yp, newWidth, h);
|
dragRect = wxRect(xp, yp, newWidth, h);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case wxSASH_NONE:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSashEvent event(GetId(), edge);
|
wxSashEvent event(GetId(), edge);
|
||||||
@@ -271,7 +275,7 @@ void wxSashWindow::OnSize(wxSizeEvent& WXUNUSED(event))
|
|||||||
SizeWindows();
|
SizeWindows();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSashEdgePosition wxSashWindow::SashHitTest(int x, int y, int tolerance)
|
wxSashEdgePosition wxSashWindow::SashHitTest(int x, int y, int WXUNUSED(tolerance))
|
||||||
{
|
{
|
||||||
int cx, cy;
|
int cx, cy;
|
||||||
GetClientSize(& cx, & cy);
|
GetClientSize(& cx, & cy);
|
||||||
@@ -310,6 +314,10 @@ wxSashEdgePosition wxSashWindow::SashHitTest(int x, int y, int tolerance)
|
|||||||
return wxSASH_LEFT;
|
return wxSASH_LEFT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case wxSASH_NONE:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -570,7 +578,7 @@ void wxSashWindow::InitColours()
|
|||||||
m_hilightColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DHILIGHT);
|
m_hilightColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DHILIGHT);
|
||||||
#else
|
#else
|
||||||
m_faceColour = *(wxTheColourDatabase->FindColour("LIGHT GREY"));
|
m_faceColour = *(wxTheColourDatabase->FindColour("LIGHT GREY"));
|
||||||
m_mediumShadowColour = *(wxTheColourDatabase->FindColour("GREY", 1, wxSOLID));
|
m_mediumShadowColour = *(wxTheColourDatabase->FindColour("GREY"));
|
||||||
m_darkShadowColour = *(wxTheColourDatabase->FindColour("BLACK"));
|
m_darkShadowColour = *(wxTheColourDatabase->FindColour("BLACK"));
|
||||||
m_lightShadowColour = *(wxTheColourDatabase->FindColour("LIGHT GREY"));
|
m_lightShadowColour = *(wxTheColourDatabase->FindColour("LIGHT GREY"));
|
||||||
m_hilightColour = *(wxTheColourDatabase->FindColour("WHITE"));
|
m_hilightColour = *(wxTheColourDatabase->FindColour("WHITE"));
|
||||||
|
@@ -54,6 +54,7 @@ LIB_CPP_SRC=\
|
|||||||
common/sckstrm.cpp \
|
common/sckstrm.cpp \
|
||||||
common/validate.cpp \
|
common/validate.cpp \
|
||||||
common/valtext.cpp \
|
common/valtext.cpp \
|
||||||
|
common/variant.cpp \
|
||||||
common/wxexpr.cpp \
|
common/wxexpr.cpp \
|
||||||
common/socket.cpp \
|
common/socket.cpp \
|
||||||
common/sckaddr.cpp \
|
common/sckaddr.cpp \
|
||||||
@@ -117,10 +118,12 @@ LIB_CPP_SRC=\
|
|||||||
generic/gridg.cpp \
|
generic/gridg.cpp \
|
||||||
generic/imaglist.cpp \
|
generic/imaglist.cpp \
|
||||||
generic/listctrl.cpp \
|
generic/listctrl.cpp \
|
||||||
|
generic/laywin.cpp \
|
||||||
generic/msgdlgg.cpp \
|
generic/msgdlgg.cpp \
|
||||||
generic/panelg.cpp \
|
generic/panelg.cpp \
|
||||||
generic/printps.cpp \
|
generic/printps.cpp \
|
||||||
generic/prntdlgg.cpp \
|
generic/prntdlgg.cpp \
|
||||||
|
generic/sashwin.cpp \
|
||||||
generic/scrolwin.cpp \
|
generic/scrolwin.cpp \
|
||||||
generic/splitter.cpp \
|
generic/splitter.cpp \
|
||||||
generic/statusbr.cpp \
|
generic/statusbr.cpp \
|
||||||
|
@@ -58,7 +58,13 @@ OPTIONS= # -D__MINGW32__ # -D__EGCS__
|
|||||||
# IRIX: -g3
|
# IRIX: -g3
|
||||||
DEBUGFLAGS = -ggdb -D__WXDEBUG__
|
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
|
WXDEBUG=0
|
||||||
|
|
||||||
WIN95=1
|
WIN95=1
|
||||||
|
@@ -857,7 +857,7 @@ wxTextCtrl* wxListCtrl::EditLabel(long item, wxClassInfo* textControlClass)
|
|||||||
// End label editing, optionally cancelling the edit
|
// End label editing, optionally cancelling the edit
|
||||||
bool wxListCtrl::EndEditLabel(bool cancel)
|
bool wxListCtrl::EndEditLabel(bool cancel)
|
||||||
{
|
{
|
||||||
wxASSERT( FALSE);
|
wxFAIL;
|
||||||
|
|
||||||
/* I don't know how to implement this: there's no such macro as ListView_EndEditLabelNow.
|
/* I don't know how to implement this: there's no such macro as ListView_EndEditLabelNow.
|
||||||
* ???
|
* ???
|
||||||
|
@@ -117,6 +117,7 @@ COMMONOBJS = \
|
|||||||
$(MSWDIR)\utilscmn.obj \
|
$(MSWDIR)\utilscmn.obj \
|
||||||
$(MSWDIR)\validate.obj \
|
$(MSWDIR)\validate.obj \
|
||||||
$(MSWDIR)\valtext.obj \
|
$(MSWDIR)\valtext.obj \
|
||||||
|
$(MSWDIR)\variant.obj \
|
||||||
$(MSWDIR)\date.obj \
|
$(MSWDIR)\date.obj \
|
||||||
$(MSWDIR)\hash.obj \
|
$(MSWDIR)\hash.obj \
|
||||||
$(MSWDIR)\list.obj \
|
$(MSWDIR)\list.obj \
|
||||||
@@ -526,6 +527,8 @@ $(MSWDIR)\list.obj: $(COMMDIR)\list.$(SRCSUFF)
|
|||||||
|
|
||||||
$(MSWDIR)\string.obj: $(COMMDIR)\string.$(SRCSUFF)
|
$(MSWDIR)\string.obj: $(COMMDIR)\string.$(SRCSUFF)
|
||||||
|
|
||||||
|
$(MSWDIR)\variant.obj: $(COMMDIR)\variant.$(SRCSUFF)
|
||||||
|
|
||||||
$(MSWDIR)\matrix.obj: $(COMMDIR)\matrix.$(SRCSUFF)
|
$(MSWDIR)\matrix.obj: $(COMMDIR)\matrix.$(SRCSUFF)
|
||||||
|
|
||||||
$(MSWDIR)\time.obj: $(COMMDIR)\time.$(SRCSUFF)
|
$(MSWDIR)\time.obj: $(COMMDIR)\time.$(SRCSUFF)
|
||||||
|
@@ -105,6 +105,7 @@ COMMONOBJS = \
|
|||||||
$(COMMDIR)\wxexpr.obj \
|
$(COMMDIR)\wxexpr.obj \
|
||||||
$(COMMDIR)\hash.obj \
|
$(COMMDIR)\hash.obj \
|
||||||
$(COMMDIR)\list.obj \
|
$(COMMDIR)\list.obj \
|
||||||
|
$(COMMDIR)\variant.obj \
|
||||||
$(COMMDIR)\string.obj \
|
$(COMMDIR)\string.obj \
|
||||||
$(COMMDIR)\time.obj \
|
$(COMMDIR)\time.obj \
|
||||||
$(COMMDIR)\y_tab.obj \
|
$(COMMDIR)\y_tab.obj \
|
||||||
@@ -817,6 +818,11 @@ $(COMMDIR)/list.obj: $*.$(SRCSUFF)
|
|||||||
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
||||||
<<
|
<<
|
||||||
|
|
||||||
|
$(COMMDIR)/variant.obj: $*.$(SRCSUFF)
|
||||||
|
cl @<<
|
||||||
|
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
||||||
|
<<
|
||||||
|
|
||||||
$(COMMDIR)/string.obj: $*.$(SRCSUFF)
|
$(COMMDIR)/string.obj: $*.$(SRCSUFF)
|
||||||
cl @<<
|
cl @<<
|
||||||
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
||||||
|
@@ -112,6 +112,7 @@ COMMONOBJS = \
|
|||||||
$(COMMDIR)/wxexpr.$(OBJSUFF) \
|
$(COMMDIR)/wxexpr.$(OBJSUFF) \
|
||||||
$(COMMDIR)/hash.$(OBJSUFF) \
|
$(COMMDIR)/hash.$(OBJSUFF) \
|
||||||
$(COMMDIR)/list.$(OBJSUFF) \
|
$(COMMDIR)/list.$(OBJSUFF) \
|
||||||
|
$(COMMDIR)/variant.$(OBJSUFF) \
|
||||||
$(COMMDIR)/string.$(OBJSUFF) \
|
$(COMMDIR)/string.$(OBJSUFF) \
|
||||||
$(COMMDIR)/time.$(OBJSUFF) \
|
$(COMMDIR)/time.$(OBJSUFF) \
|
||||||
$(COMMDIR)/tokenzr.$(OBJSUFF) \
|
$(COMMDIR)/tokenzr.$(OBJSUFF) \
|
||||||
|
@@ -131,6 +131,7 @@ COMMONOBJS = \
|
|||||||
$(COMMDIR)\stream.obj \
|
$(COMMDIR)\stream.obj \
|
||||||
$(COMMDIR)\datstrm.obj \
|
$(COMMDIR)\datstrm.obj \
|
||||||
$(COMMDIR)\objstrm.obj \
|
$(COMMDIR)\objstrm.obj \
|
||||||
|
$(COMMDIR)\variant.obj \
|
||||||
$(COMMDIR)\wincmn.obj
|
$(COMMDIR)\wincmn.obj
|
||||||
|
|
||||||
MSWOBJS = \
|
MSWOBJS = \
|
||||||
@@ -982,16 +983,6 @@ $(COMMDIR)/matrix.obj: $*.$(SRCSUFF)
|
|||||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
|
$(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)
|
$(COMMDIR)/time.obj: $*.$(SRCSUFF)
|
||||||
cl @<<
|
cl @<<
|
||||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
|
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
|
||||||
@@ -1034,12 +1025,17 @@ $(CPPFLAGS2) /c $*.c /Fo$@
|
|||||||
|
|
||||||
$(COMMDIR)/process.obj: $*.$(SRCSUFF)
|
$(COMMDIR)/process.obj: $*.$(SRCSUFF)
|
||||||
cl @<<
|
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)
|
$(COMMDIR)/wincmn.obj: $*.$(SRCSUFF)
|
||||||
cl @<<
|
cl @<<
|
||||||
$(CPPFLAGS2) /c /Tp $*.$(SRCSUFF) /Fo$@
|
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@
|
||||||
<<
|
<<
|
||||||
|
|
||||||
$(COMMDIR)/y_tab.obj: $*.c $(COMMDIR)/lex_yy.c
|
$(COMMDIR)/y_tab.obj: $*.c $(COMMDIR)/lex_yy.c
|
||||||
|
@@ -104,6 +104,6 @@ test: example.exe minigzip.exe
|
|||||||
echo hello world | minigzip | minigzip -d
|
echo hello world | minigzip | minigzip -d
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
del *.obj
|
erase *.obj
|
||||||
del *.exe
|
erase *.exe
|
||||||
del $(LIBTARGET)
|
erase $(LIBTARGET)
|
||||||
|
Reference in New Issue
Block a user