Removed obsolete wxDate and wxTime classes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19738 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -344,7 +344,6 @@ if test $DEBUG_CONFIGURE = 1; then
|
||||
DEFAULT_wxUSE_STD_IOSTREAM=no
|
||||
DEFAULT_wxUSE_CMDLINE_PARSER=no
|
||||
DEFAULT_wxUSE_DATETIME=no
|
||||
DEFAULT_wxUSE_TIMEDATE=no
|
||||
DEFAULT_wxUSE_TIMER=no
|
||||
DEFAULT_wxUSE_STOPWATCH=no
|
||||
DEFAULT_wxUSE_FILE=no
|
||||
@@ -520,7 +519,6 @@ else
|
||||
DEFAULT_wxUSE_STD_IOSTREAM=no
|
||||
DEFAULT_wxUSE_CMDLINE_PARSER=yes
|
||||
DEFAULT_wxUSE_DATETIME=yes
|
||||
DEFAULT_wxUSE_TIMEDATE=no
|
||||
DEFAULT_wxUSE_TIMER=yes
|
||||
DEFAULT_wxUSE_STOPWATCH=yes
|
||||
DEFAULT_wxUSE_FILE=yes
|
||||
@@ -774,7 +772,6 @@ WX_ARG_ENABLE(ipc, [ --enable-ipc use interprocess communi
|
||||
|
||||
WX_ARG_ENABLE(cmdline, [ --enable-cmdline use wxCmdLineParser class], wxUSE_CMDLINE_PARSER)
|
||||
WX_ARG_ENABLE(datetime, [ --enable-datetime use wxDateTime class], wxUSE_DATETIME)
|
||||
WX_ARG_ENABLE(timedate, [ --enable-timedate use obsolete wxDate/wxTime classes], wxUSE_TIMEDATE)
|
||||
WX_ARG_ENABLE(stopwatch, [ --enable-stopwatch use wxStopWatch class], wxUSE_STOPWATCH)
|
||||
WX_ARG_ENABLE(dialupman, [ --enable-dialupman use dialup network classes], wxUSE_DIALUP_MANAGER)
|
||||
WX_ARG_ENABLE(apple_ieee, [ --enable-apple_ieee use the Apple IEEE codec], wxUSE_APPLE_IEEE)
|
||||
@@ -4107,10 +4104,6 @@ if test "$wxUSE_DATETIME" = "yes"; then
|
||||
AC_DEFINE(wxUSE_DATETIME)
|
||||
fi
|
||||
|
||||
if test "$wxUSE_TIMEDATE" = "yes"; then
|
||||
AC_DEFINE(wxUSE_TIMEDATE)
|
||||
fi
|
||||
|
||||
if test "$wxUSE_FILE" = "yes"; then
|
||||
AC_DEFINE(wxUSE_FILE)
|
||||
fi
|
||||
@@ -4354,7 +4347,6 @@ if test "$wxUSE_DATETIME" = "yes"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_DEFINE(wxUSE_TIMEDATE)
|
||||
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS typetest"
|
||||
fi
|
||||
|
||||
|
@@ -5,8 +5,6 @@
|
||||
//---------------------------------------------------------------------------
|
||||
#include <wx/config.h> // to let wxWindows choose a wxConfig class for your platform
|
||||
#include <wx/confbase.h> // base config class
|
||||
// #include <wx/event.h>
|
||||
// #include <wx/date.h>
|
||||
#include <wx/dbtable.h>
|
||||
#include <wx/generic/grid.h>
|
||||
#include <wx/file.h>
|
||||
@@ -21,11 +19,6 @@
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/toolbar.h>
|
||||
#include <wx/treectrl.h>
|
||||
/*
|
||||
#ifdef __WXMSW__
|
||||
#include <wx/xpmhand.h>
|
||||
#endif
|
||||
*/
|
||||
//---------------------------
|
||||
#include "tabpgwin.h" // Original name : "controlarea.h"
|
||||
//---------------------------
|
||||
|
@@ -843,7 +843,6 @@ cshelp.h WXH
|
||||
ctrlsub.h WXH
|
||||
cursor.h WXH
|
||||
dataobj.h WXH
|
||||
date.h WXH Base
|
||||
datetime.h WXH Base
|
||||
datetime.inl WXH Base
|
||||
datstrm.h WXH Base
|
||||
@@ -1020,7 +1019,6 @@ textfile.h WXH Base
|
||||
tglbtn.h WXH
|
||||
thread.h WXH Base
|
||||
thrimpl.cpp WXH Base
|
||||
time.h WXH Base
|
||||
timer.h WXH Base
|
||||
tipdlg.h WXH
|
||||
tipwin.h WXH
|
||||
|
@@ -264,7 +264,6 @@ These are the data structure classes supported by wxWindows.
|
||||
\twocolwidtha{6cm}
|
||||
\begin{twocollist}\itemsep=0pt
|
||||
\twocolitem{\helpref{wxCmdLineParser}{wxcmdlineparser}}{Command line parser class}
|
||||
\twocolitem{\helpref{wxDate}{wxdate}}{A class for date manipulation (deprecated in favour of wxDateTime)}
|
||||
\twocolitem{\helpref{wxDateSpan}{wxdatespan}}{A logical time interval.}
|
||||
\twocolitem{\helpref{wxDateTime}{wxdatetime}}{A class for date/time manipulations}
|
||||
\twocolitem{\helpref{wxExpr}{wxexpr}}{A class for flexible I/O}
|
||||
@@ -286,7 +285,6 @@ These are the data structure classes supported by wxWindows.
|
||||
\twocolitem{\helpref{wxStringTokenizer}{wxstringtokenizer}}{A class for interpreting a string as a list of tokens or words}
|
||||
\twocolitem{\helpref{wxRealPoint}{wxrealpoint}}{Representation of a point using floating point numbers}
|
||||
\twocolitem{\helpref{wxSize}{wxsize}}{Representation of a size}
|
||||
\twocolitem{\helpref{wxTime}{wxtime}}{A class for time manipulation (deprecated in favour of wxDateTime)}
|
||||
\twocolitem{\helpref{wxTimeSpan}{wxtimespan}}{A time interval.}
|
||||
\twocolitem{\helpref{wxVariant}{wxvariant}}{A class for storing arbitrary types that may change at run-time}
|
||||
\end{twocollist}
|
||||
|
@@ -60,7 +60,6 @@
|
||||
\input dobjcomp.tex
|
||||
\input dobjsmpl.tex
|
||||
\input datostrm.tex
|
||||
\input date.tex
|
||||
\input datespan.tex
|
||||
\input datetime.tex
|
||||
\input db.tex
|
||||
@@ -296,7 +295,6 @@
|
||||
\input txtstrm.tex
|
||||
\input valtext.tex
|
||||
\input thread.tex
|
||||
\input time.tex
|
||||
\input timer.tex
|
||||
\input timespan.tex
|
||||
\input tipprov.tex
|
||||
|
@@ -1,356 +0,0 @@
|
||||
\section{\class{wxDate}}\label{wxdate}
|
||||
|
||||
A class for manipulating dates.
|
||||
|
||||
{\bf NOTE:} this class is retained only for compatibility,
|
||||
and has been replaced by \helpref{wxDateTime}{wxdatetime}. wxDate
|
||||
may be withdrawn in future versions of wxWindows.
|
||||
|
||||
\wxheading{Derived from}
|
||||
|
||||
\helpref{wxObject}{wxobject}
|
||||
|
||||
\wxheading{Include files}
|
||||
|
||||
<wx/date.h>
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{wxTime}{wxtime}
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
|
||||
\membersection{wxDate::wxDate}\label{wxdateconstr}
|
||||
|
||||
\func{}{wxDate}{\void}
|
||||
|
||||
Default constructor.
|
||||
|
||||
\func{}{wxDate}{\param{const wxDate\&}{ date}}
|
||||
|
||||
Copy constructor.
|
||||
|
||||
\func{}{wxDate}{\param{int}{ month}, \param{int}{ day}, \param{int}{ year}}
|
||||
|
||||
Constructor taking month, day and year.
|
||||
|
||||
\func{}{wxDate}{\param{long}{ julian}}
|
||||
|
||||
Constructor taking an integer representing the Julian date. This is the number of days since
|
||||
1st January 4713 B.C., so to convert from the number of days since 1st January 1901,
|
||||
construct a date for 1/1/1901, and add the number of days.
|
||||
|
||||
\func{}{wxDate}{\param{const wxString\& }{dateString}}
|
||||
|
||||
Constructor taking a string representing a date. This must be either the string TODAY, or of the
|
||||
form {\tt MM/DD/YYYY} or {\tt MM-DD-YYYY}. For example:
|
||||
|
||||
\begin{verbatim}
|
||||
wxDate date("11/26/1966");
|
||||
\end{verbatim}
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{date}{Date to copy.}
|
||||
|
||||
\docparam{month}{Month: a number between 1 and 12.}
|
||||
|
||||
\docparam{day}{Day: a number between 1 and 31.}
|
||||
|
||||
\docparam{year}{Year, such as 1995, 2005.}
|
||||
|
||||
\membersection{wxDate::\destruct{wxDate}}
|
||||
|
||||
\func{void}{\destruct{wxDate}}{\void}
|
||||
|
||||
Destructor.
|
||||
|
||||
\membersection{wxDate::AddMonths}\label{wxdateaddmonths}
|
||||
|
||||
\func{wxDate\&}{AddMonths}{\param{int}{ months=1}}
|
||||
|
||||
Adds the given number of months to the date, returning a reference to `this'.
|
||||
|
||||
\membersection{wxDate::AddWeeks}\label{wxdateaddweeks}
|
||||
|
||||
\func{wxDate\&}{AddWeeks}{\param{int}{ weeks=1}}
|
||||
|
||||
Adds the given number of weeks to the date, returning a reference to `this'.
|
||||
|
||||
\membersection{wxDate::AddYears}\label{wxdateaddyears}
|
||||
|
||||
\func{wxDate\&}{AddYears}{\param{int}{ years=1}}
|
||||
|
||||
Adds the given number of months to the date, returning a reference to `this'.
|
||||
|
||||
\membersection{wxDate::FormatDate}\label{wxdateformatdate}
|
||||
|
||||
\constfunc{wxString}{FormatDate}{\param{int}{ type=-1}}
|
||||
|
||||
Formats the date according to {\it type} if not -1, or according
|
||||
to the current display type if -1.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{type}{-1 or one of:
|
||||
|
||||
\begin{twocollist}\itemsep=0pt
|
||||
\twocolitem{wxDAY}{Format day only.}
|
||||
\twocolitem{wxMONTH}{Format month only.}
|
||||
\twocolitem{wxMDY}{Format MONTH, DAY, YEAR.}
|
||||
\twocolitem{wxFULL}{Format day, month and year in US style: DAYOFWEEK, MONTH, DAY, YEAR.}
|
||||
\twocolitem{wxEUROPEAN}{Format day, month and year in European style: DAY, MONTH, YEAR.}
|
||||
\end{twocollist}}
|
||||
|
||||
\membersection{wxDate::GetDay}\label{wxdategetday}
|
||||
|
||||
\constfunc{int}{GetDay}{\void}
|
||||
|
||||
Returns the numeric day (in the range 1 to 31).
|
||||
|
||||
\membersection{wxDate::GetDayOfWeek}\label{wxdategetdayofweek}
|
||||
|
||||
\constfunc{int}{GetDayOfWeek}{\void}
|
||||
|
||||
Returns the integer day of the week (in the range 1 to 7).
|
||||
|
||||
\membersection{wxDate::GetDayOfWeekName}\label{wxdategetdayofweekname}
|
||||
|
||||
\constfunc{wxString}{GetDayOfWeekName}{\void}
|
||||
|
||||
Returns the name of the day of week.
|
||||
|
||||
\membersection{wxDate::GetDayOfYear}\label{wxdategetdayofyear}
|
||||
|
||||
\constfunc{long}{GetDayOfYear}{\void}
|
||||
|
||||
Returns the day of the year (from 1 to 365).
|
||||
|
||||
\membersection{wxDate::GetDaysInMonth}\label{wxdategetdaysinmonth}
|
||||
|
||||
\constfunc{int}{GetDaysInMonth}{\void}
|
||||
|
||||
Returns the number of days in the month (in the range 1 to 31).
|
||||
|
||||
\membersection{wxDate::GetFirstDayOfMonth}\label{wxdategetfirstdayofmonth}
|
||||
|
||||
\constfunc{int}{GetFirstDayOfMonth}{\void}
|
||||
|
||||
Returns the day of week that is first in the month (in the range 1 to 7).
|
||||
|
||||
\membersection{wxDate::GetJulianDate}\label{wxdategetjuliandate}
|
||||
|
||||
\constfunc{long}{GetJulianDate}{\void}
|
||||
|
||||
Returns the Julian date.
|
||||
|
||||
\membersection{wxDate::GetMonth}\label{wxdategetmonth}
|
||||
|
||||
\constfunc{int}{GetMonth}{\void}
|
||||
|
||||
Returns the month number (in the range 1 to 12).
|
||||
|
||||
\membersection{wxDate::GetMonthEnd}
|
||||
|
||||
\func{wxDate}{GetMonthEnd}{\void}
|
||||
|
||||
Returns the date representing the last day of the month.
|
||||
|
||||
\membersection{wxDate::GetMonthName}\label{wxdategetmonthname}
|
||||
|
||||
\constfunc{wxString}{GetMonthName}{\void}
|
||||
|
||||
Returns the name of the month. Do not delete the returned storage.
|
||||
|
||||
\membersection{wxDate::GetMonthStart}\label{wxdategetmonthstart}
|
||||
|
||||
\constfunc{wxDate}{GetMonthStart}{\void}
|
||||
|
||||
Returns the date representing the first day of the month.
|
||||
|
||||
\membersection{wxDate::GetWeekOfMonth}\label{wxdategetweekofmonth}
|
||||
|
||||
\constfunc{int}{GetWeekOfMonth}{\void}
|
||||
|
||||
Returns the week of month (in the range 1 to 6).
|
||||
|
||||
\membersection{wxDate::GetWeekOfYear}\label{wxdategetweekofyear}
|
||||
|
||||
\constfunc{int}{GetWeekOfYear}{\void}
|
||||
|
||||
Returns the week of year (in the range 1 to 52).
|
||||
|
||||
\membersection{wxDate::GetYear}\label{wxdategetyear}
|
||||
|
||||
\constfunc{int}{GetYear}{\void}
|
||||
|
||||
Returns the year as an integer (such as `1995').
|
||||
|
||||
\membersection{wxDate::GetYearEnd}\label{wxdategetyearend}
|
||||
|
||||
\constfunc{wxDate}{GetYearEnd}{\void}
|
||||
|
||||
Returns the date representing the last day of the year.
|
||||
|
||||
\membersection{wxDate::GetYearStart}\label{wxdategetyearstart}
|
||||
|
||||
\constfunc{wxDate}{GetYearStart}{\void}
|
||||
|
||||
Returns the date representing the first day of the year.
|
||||
|
||||
\membersection{wxDate::IsLeapYear}\label{wxdateisleapyear}
|
||||
|
||||
\constfunc{bool}{IsLeapYear}{\void}
|
||||
|
||||
Returns true if the year of this date is a leap year.
|
||||
|
||||
\membersection{wxDate::Set}\label{wxdateset}
|
||||
|
||||
\func{wxDate\&}{Set}{\void}
|
||||
|
||||
Sets the date to current system date, returning a reference to `this'.
|
||||
|
||||
\func{wxDate\&}{Set}{\param{long}{ julian}}
|
||||
|
||||
Sets the date to the given Julian date, returning a reference to `this'.
|
||||
|
||||
\func{wxDate\&}{Set}{\param{int}{ month}, \param{int}{ day}, \param{int}{ year}}
|
||||
|
||||
Sets the date to the given date, returning a reference to `this'.
|
||||
|
||||
{\it month} is a number from 1 to 12.
|
||||
|
||||
{\it day} is a number from 1 to 31.
|
||||
|
||||
{\it year} is a year, such as 1995, 2005.
|
||||
|
||||
\membersection{wxDate::SetFormat}\label{wxdatesetformat}
|
||||
|
||||
\func{void}{SetFormat}{\param{int}{ format}}
|
||||
|
||||
Sets the current format type.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{format}{-1 or one of:
|
||||
|
||||
\twocolwidtha{5cm}
|
||||
\begin{twocollist}\itemsep=0pt
|
||||
\twocolitem{{\bf wxDAY}}{Format day only.}
|
||||
\twocolitem{{\bf wxMONTH}}{Format month only.}
|
||||
\twocolitem{{\bf wxMDY}}{Format MONTH, DAY, YEAR.}
|
||||
\twocolitem{{\bf wxFULL}}{Format day, month and year in US style: DAYOFWEEK, MONTH, DAY, YEAR.}
|
||||
\twocolitem{{\bf wxEUROPEAN}}{Format day, month and year in European style: DAY, MONTH, YEAR.}
|
||||
\end{twocollist}}
|
||||
|
||||
\membersection{wxDate::SetOption}\label{wxdatesetoption}
|
||||
|
||||
\func{int}{SetOption}{\param{int}{ option}, \param{const bool}{ enable=true}}
|
||||
|
||||
Enables or disables an option for formatting.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{option}{May be one of:
|
||||
|
||||
\twocolwidtha{5cm}
|
||||
\begin{twocollist}\itemsep=0pt
|
||||
\twocolitem{{\bf wxNO\_CENTURY}}{The century is not formatted.}
|
||||
\twocolitem{{\bf wxDATE\_ABBR}}{Month and day names are abbreviated to 3 characters when formatting.}
|
||||
\end{twocollist}}
|
||||
|
||||
\membersection{wxDate::operator wxString}\label{wxdatewxstring}
|
||||
|
||||
\func{}{operator wxString}{\void}
|
||||
|
||||
Conversion operator, to convert wxDate to wxString by calling FormatDate.
|
||||
|
||||
\membersection{wxDate::operator $+$}\label{wxdateplus}
|
||||
|
||||
\func{wxDate}{operator $+$}{\param{long}{ i}}
|
||||
|
||||
\func{wxDate}{operator $+$}{\param{int}{ i}}
|
||||
|
||||
Adds an integer number of days to the date, returning a date.
|
||||
|
||||
\membersection{wxDate::operator $-$}\label{wxdateminus}
|
||||
|
||||
\func{wxDate}{operator $-$}{\param{long}{ i}}
|
||||
|
||||
\func{wxDate}{operator $-$}{\param{int}{ i}}
|
||||
|
||||
Subtracts an integer number of days from the date, returning a date.
|
||||
|
||||
\func{long}{operator $-$}{\param{const wxDate\&}{ date}}
|
||||
|
||||
Subtracts one date from another, return the number of intervening days.
|
||||
|
||||
\membersection{wxDate::operator $+=$}\label{wxdateplusequals}
|
||||
|
||||
\func{wxDate\&}{operator $+=$}{\param{long}{ i}}
|
||||
|
||||
Postfix operator: adds an integer number of days to the date, returning
|
||||
a reference to `this' date.
|
||||
|
||||
\membersection{wxDate::operator $-=$}\label{wxdateminusequals}
|
||||
|
||||
\func{wxDate\&}{operator $-=$}{\param{long}{ i}}
|
||||
|
||||
Postfix operator: subtracts an integer number of days from the date, returning
|
||||
a reference to `this' date.
|
||||
|
||||
\membersection{wxDate::operator $++$}\label{wxdateplusplus}
|
||||
|
||||
\func{wxDate\&}{operator $++$}{\void}
|
||||
|
||||
Increments the date (postfix or prefix).
|
||||
|
||||
\membersection{wxDate::operator $--$}\label{wxdateminusminus}
|
||||
|
||||
\func{wxDate\&}{operator $--$}{\void}
|
||||
|
||||
Decrements the date (postfix or prefix).
|
||||
|
||||
\membersection{wxDate::operator $<$}\label{wxdatelessthan}
|
||||
|
||||
\func{friend bool}{operator $<$}{\param{const wxDate\&}{ date1}, \param{const wxDate\&}{ date2}}
|
||||
|
||||
Function to compare two dates, returning true if {\it date1} is earlier than {\it date2}.
|
||||
|
||||
\membersection{wxDate::operator $<=$}\label{wxdatelessthaneq}
|
||||
|
||||
\func{friend bool}{operator $<=$}{\param{const wxDate\&}{ date1}, \param{const wxDate\&}{ date2}}
|
||||
|
||||
Function to compare two dates, returning true if {\it date1} is earlier than or equal to {\it date2}.
|
||||
|
||||
\membersection{wxDate::operator $>$}\label{wxdategreaterthan}
|
||||
|
||||
\func{friend bool}{operator $>$}{\param{const wxDate\&}{ date1}, \param{const wxDate\&}{ date2}}
|
||||
|
||||
Function to compare two dates, returning true if {\it date1} is later than {\it date2}.
|
||||
|
||||
\membersection{wxDate::operator $>=$}\label{wxdategreaterthaneq}
|
||||
|
||||
\func{friend bool}{operator $>=$}{\param{const wxDate\&}{ date1}, \param{const wxDate\&}{ date2}}
|
||||
|
||||
Function to compare two dates, returning true if {\it date1} is later than or equal to {\it date2}.
|
||||
|
||||
\membersection{wxDate::operator $==$}\label{wxdateequals}
|
||||
|
||||
\func{friend bool}{operator $==$}{\param{const wxDate\&}{ date1}, \param{const wxDate\&}{ date2}}
|
||||
|
||||
Function to compare two dates, returning true if {\it date1} is equal to {\it date2}.
|
||||
|
||||
\membersection{wxDate::operator $!=$}\label{wxdatenotequals}
|
||||
|
||||
\func{friend bool}{operator $!=$}{\param{const wxDate\&}{ date1}, \param{const wxDate\&}{ date2}}
|
||||
|
||||
Function to compare two dates, returning true if {\it date1} is not equal to {\it date2}.
|
||||
|
||||
\membersection{wxDate::operator \cinsert}\label{wxdateinsert}
|
||||
|
||||
\func{friend ostream\&}{operator \cinsert}{\param{ostream\&}{ os}, \param{const wxDate\&}{ date}}
|
||||
|
||||
Function to output a wxDate to an ostream.
|
||||
|
||||
|
@@ -1,230 +0,0 @@
|
||||
\section{\class{wxTime}}\label{wxtime}
|
||||
|
||||
Representation of time and date.
|
||||
|
||||
{\bf NOTE:} this class is retained only for compatibility,
|
||||
and has been replaced by \helpref{wxDateTime}{wxdatetime}. wxTime
|
||||
may be withdrawn in future versions of wxWindows.
|
||||
|
||||
\wxheading{Derived from}
|
||||
|
||||
\helpref{wxObject}{wxobject}
|
||||
|
||||
\wxheading{Include files}
|
||||
|
||||
<wx/time.h>
|
||||
|
||||
\wxheading{Data structures}
|
||||
|
||||
\begin{verbatim}
|
||||
typedef unsigned short hourTy;
|
||||
typedef unsigned short minuteTy;
|
||||
typedef unsigned short secondTy;
|
||||
typedef unsigned long clockTy;
|
||||
enum tFormat { wx12h, wx24h };
|
||||
enum tPrecision { wxStdMinSec, wxStdMin };
|
||||
\end{verbatim}
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{wxDate}{wxdate}
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
|
||||
\membersection{wxTime::wxTime}\label{wxtimewxtime}
|
||||
|
||||
\func{}{wxTime}{\void}
|
||||
|
||||
Initialize the object using the current time.
|
||||
|
||||
\func{}{wxTime}{\param{clockTy }{s}}
|
||||
|
||||
Initialize the object using the number of seconds that have elapsed since ???.
|
||||
|
||||
\func{}{wxTime}{\param{const wxTime\&}{ time}}
|
||||
|
||||
Copy constructor.
|
||||
|
||||
\func{}{wxTime}{\param{hourTy }{h}, \param{minuteTy }{m}, \param{secondTy }{s = 0}, \param{bool }{dst = false}}
|
||||
|
||||
Initialize using hours, minutes, seconds, and whether DST time.
|
||||
|
||||
\func{}{wxTime}{\param{const wxDate\&}{ date}, \param{hourTy }{h = 0}, \param{minuteTy }{m = 0}, \param{secondTy }{s = 0}, \param{bool }{dst = false}}
|
||||
|
||||
Initialize using a \helpref{wxDate}{wxdate} object, hours, minutes, seconds, and whether DST time.
|
||||
|
||||
\membersection{wxTime::GetDay}\label{wxtimegetday}
|
||||
|
||||
\constfunc{int}{GetDay}{\void}
|
||||
|
||||
Returns the day of the month.
|
||||
|
||||
\membersection{wxTime::GetDayOfWeek}\label{wxtimegetdatofweek}
|
||||
|
||||
\constfunc{int}{GetDayOfWeek}{\void}
|
||||
|
||||
Returns the day of the week, a number from 0 to 6 where 0 is Sunday and 6 is Saturday.
|
||||
|
||||
\membersection{wxTime::GetHour}\label{wxtimegethour}
|
||||
|
||||
\constfunc{hourTy}{GetHour}{\void}
|
||||
|
||||
Returns the hour in local time.
|
||||
|
||||
\membersection{wxTime::GetHourGMT}\label{wxtimegethourgmt}
|
||||
|
||||
\constfunc{hourTy}{GetHourGMT}{\void}
|
||||
|
||||
Returns the hour in GMT.
|
||||
|
||||
\membersection{wxTime::GetMinute}\label{wxtimegetminute}
|
||||
|
||||
\constfunc{minuteTy}{GetMinute}{\void}
|
||||
|
||||
Returns the minute in local time.
|
||||
|
||||
\membersection{wxTime::GetMinuteGMT}\label{wxtimegetminutegmt}
|
||||
|
||||
\constfunc{minuteTy}{GetMinuteGMT}{\void}
|
||||
|
||||
Returns the minute in GMT.
|
||||
|
||||
\membersection{wxTime::GetMonth}\label{wxtimegetmonth}
|
||||
|
||||
\constfunc{int}{GetMonth}{\void}
|
||||
|
||||
Returns the month.
|
||||
|
||||
\membersection{wxTime::GetSecond}\label{wxtimegetsecond}
|
||||
|
||||
\constfunc{secondTy}{GetSecond}{\void}
|
||||
|
||||
Returns the second in local time or GMT.
|
||||
|
||||
\membersection{wxTime::GetSecondGMT}\label{wxtimegetsecondgmt}
|
||||
|
||||
\constfunc{secondTy}{GetSecondGMT}{\void}
|
||||
|
||||
Returns the second in GMT.
|
||||
|
||||
\membersection{wxTime::GetSeconds}\label{wxtimegetseconds}
|
||||
|
||||
\constfunc{clockTy}{GetSeconds}{\void}
|
||||
|
||||
Returns the number of seconds since ???.
|
||||
|
||||
\membersection{wxTime::GetYear}\label{wxtimegetyear}
|
||||
|
||||
\constfunc{int}{GetYear}{\void}
|
||||
|
||||
Returns the year.
|
||||
|
||||
\membersection{wxTime::FormatTime}\label{wxtimeformattime}
|
||||
|
||||
\constfunc{char*}{FormatTime}{\void}
|
||||
|
||||
Formats the time according to the current formatting options: see \helpref{wxTime::SetFormat}{wxtimesetformat}.
|
||||
|
||||
\membersection{wxTime::IsBetween}\label{wxtimeisbetween}
|
||||
|
||||
\constfunc{bool}{IsBetween}{\param{const wxTime\& }{a}, \param{const wxTime\& }{b}}
|
||||
|
||||
Returns true if this time is between the two given times.
|
||||
|
||||
\membersection{wxTime::Max}\label{wxtimemax}
|
||||
|
||||
\constfunc{wxTime}{Max}{\param{const wxTime\& }{time}}
|
||||
|
||||
Returns the maximum of the two times.
|
||||
|
||||
\membersection{wxTime::Min}\label{wxtimemin}
|
||||
|
||||
\constfunc{wxTime}{Min}{\param{const wxTime\& }{time}}
|
||||
|
||||
Returns the minimum of the two times.
|
||||
|
||||
\membersection{wxTime::SetFormat}\label{wxtimesetformat}
|
||||
|
||||
\func{static void}{SetFormat}{\param{const tFormat}{ format = wx12h},
|
||||
\param{const tPrecision}{ precision = wxStdMinSec}}
|
||||
|
||||
Sets the format and precision.
|
||||
|
||||
\membersection{wxTime::operator char*}\label{wxtimestring}
|
||||
|
||||
\func{operator}{char*}{\void}
|
||||
|
||||
Returns a pointer to a static char* containing the formatted time.
|
||||
|
||||
\membersection{wxTime::operator wxDate}\label{wxtimewxdate}
|
||||
|
||||
\constfunc{operator}{wxDate}{\void}
|
||||
|
||||
Converts the wxTime into a wxDate.
|
||||
|
||||
\membersection{wxTime::operator $=$}\label{wxtimeoperator}
|
||||
|
||||
\func{void}{operator $=$}{\param{const wxTime\& }{t}}
|
||||
|
||||
Assignment operator.
|
||||
|
||||
\membersection{wxTime::operator $<$}\label{wxtimeoperatorle}
|
||||
|
||||
\constfunc{bool}{operator $<$}{\param{const wxTime\& }{t}}
|
||||
|
||||
Less than operator.
|
||||
|
||||
\membersection{wxTime::operator $<=$}\label{wxtimeoperatorleq}
|
||||
|
||||
\constfunc{bool}{operator $<=$}{\param{const wxTime\& }{t}}
|
||||
|
||||
Less than or equal to operator.
|
||||
|
||||
\membersection{wxTime::operator $>$}\label{wxtimeoperatorge}
|
||||
|
||||
\constfunc{bool}{operator $>$}{\param{const wxTime\& }{t}}
|
||||
|
||||
Greater than operator.
|
||||
|
||||
\membersection{wxTime::operator $>=$}\label{wxtimeoperatorgeq}
|
||||
|
||||
\constfunc{bool}{operator $>=$}{\param{const wxTime\& }{t}}
|
||||
|
||||
Greater than or equal to operator.
|
||||
|
||||
\membersection{wxTime::operator $==$}\label{wxtimeoperatoreq}
|
||||
|
||||
\constfunc{bool}{operator $==$}{\param{const wxTime\& }{t}}
|
||||
|
||||
Equality operator.
|
||||
|
||||
\membersection{wxTime::operator $!=$}\label{wxtimeoperatorneq}
|
||||
|
||||
\constfunc{bool}{operator $!=$}{\param{const wxTime\& }{t}}
|
||||
|
||||
Inequality operator.
|
||||
|
||||
\membersection{wxTime::operator $+$}\label{wxtimeoperatorplus}
|
||||
|
||||
\constfunc{bool}{operator $+$}{\param{long }{sec}}
|
||||
|
||||
Addition operator.
|
||||
|
||||
\membersection{wxTime::operator $-$}\label{wxtimeoperatorminus}
|
||||
|
||||
\constfunc{bool}{operator $-$}{\param{long }{sec}}
|
||||
|
||||
Subtraction operator.
|
||||
|
||||
\membersection{wxTime::operator $+=$}\label{wxtimeoperatorpluseq}
|
||||
|
||||
\constfunc{bool}{operator $+=$}{\param{long }{sec}}
|
||||
|
||||
Increment operator.
|
||||
|
||||
\membersection{wxTime::operator $-=$}\label{wxtimeoperatorminuseq}
|
||||
|
||||
\constfunc{bool}{operator $-=$}{\param{long }{sec}}
|
||||
|
||||
Decrement operator.
|
||||
|
@@ -82,14 +82,6 @@ deleting {\it value} and its contents.
|
||||
|
||||
%Note: this constructor is currently disabled because it causes a C++ ambiguity.
|
||||
|
||||
\func{}{wxVariant}{\param{const wxTime\&}{ value}, \param{const wxString\& }{name = ``"}}
|
||||
|
||||
Construction from a time.
|
||||
|
||||
\func{}{wxVariant}{\param{const wxDate\&}{ value}, \param{const wxString\& }{name = ``"}}
|
||||
|
||||
Construction from a date.
|
||||
|
||||
\func{}{wxVariant}{\param{void*}{ value}, \param{const wxString\& }{name = ``"}}
|
||||
|
||||
Construction from a void pointer.
|
||||
@@ -146,12 +138,6 @@ Returns the character value.
|
||||
|
||||
Returns a pointer to the internal variant data.
|
||||
|
||||
\membersection{wxVariant::GetDate}\label{wxvariantgetdate}
|
||||
|
||||
\constfunc{wxDate}{GetDate}{\void}
|
||||
|
||||
Gets the date value.
|
||||
|
||||
\membersection{wxVariant::GetDouble}\label{wxvariantgetdouble}
|
||||
|
||||
\constfunc{double}{GetDouble}{\void}
|
||||
@@ -176,12 +162,6 @@ Returns a constant reference to the variant name.
|
||||
|
||||
Gets the string value.
|
||||
|
||||
\membersection{wxVariant::GetTime}\label{wxvariantgettime}
|
||||
|
||||
\constfunc{wxTime}{GetTime}{\void}
|
||||
|
||||
Gets the time value.
|
||||
|
||||
\membersection{wxVariant::GetType}\label{wxvariantgettype}
|
||||
|
||||
\constfunc{wxString}{GetType}{\void}
|
||||
@@ -263,10 +243,6 @@ Sets the internal variant data, deleting the existing data if there is any.
|
||||
|
||||
\func{void}{operator $=$}{\param{const double }{value}}
|
||||
|
||||
\func{void}{operator $=$}{\param{const wxDate\& }{value}}
|
||||
|
||||
\func{void}{operator $=$}{\param{const wxTime\& }{value}}
|
||||
|
||||
\func{void}{operator $=$}{\param{void* }{value}}
|
||||
|
||||
\func{void}{operator $=$}{\param{const wxList\& }{value}}
|
||||
@@ -291,10 +267,6 @@ Assignment operators.
|
||||
|
||||
\func{bool}{operator $==$}{\param{const double }{value}}
|
||||
|
||||
\func{bool}{operator $==$}{\param{const wxDate\& }{value}}
|
||||
|
||||
\func{bool}{operator $==$}{\param{const wxTime\& }{value}}
|
||||
|
||||
\func{bool}{operator $==$}{\param{void* }{value}}
|
||||
|
||||
\func{bool}{operator $==$}{\param{const wxList\& }{value}}
|
||||
@@ -319,10 +291,6 @@ Equality test operators.
|
||||
|
||||
\func{bool}{operator $!=$}{\param{const double }{value}}
|
||||
|
||||
\func{bool}{operator $!=$}{\param{const wxDate\& }{value}}
|
||||
|
||||
\func{bool}{operator $!=$}{\param{const wxTime\& }{value}}
|
||||
|
||||
\func{bool}{operator $!=$}{\param{void* }{value}}
|
||||
|
||||
\func{bool}{operator $!=$}{\param{const wxList\& }{value}}
|
||||
@@ -358,24 +326,12 @@ Operator for implicit conversion to a double, using \helpref{wxVariant::GetDoubl
|
||||
|
||||
Operator for implicit conversion to a long, using \helpref{wxVariant::GetLong}{wxvariantgetlong}.
|
||||
|
||||
\membersection{wxVariant::operator wxDate}\label{wxvariantwxdate}
|
||||
|
||||
\constfunc{wxDate}{operator wxDate}{\void}
|
||||
|
||||
Operator for implicit conversion to a wxDate, using \helpref{wxVariant::GetDate}{wxvariantgetdate}.
|
||||
|
||||
\membersection{wxVariant::operator wxString}\label{wxvariantwxstring}
|
||||
|
||||
\constfunc{wxString}{operator wxString}{\void}
|
||||
|
||||
Operator for implicit conversion to a string, using \helpref{wxVariant::MakeString}{wxvariantmakestring}.
|
||||
|
||||
\membersection{wxVariant::operator wxTime}\label{wxvariantwxtime}
|
||||
|
||||
\constfunc{wxTime}{operator wxTime}{\void}
|
||||
|
||||
Operator for implicit conversion to a wxTime, using \helpref{wxVariant::GetTime}{wxvariantgettime}.
|
||||
|
||||
\membersection{wxVariant::operator void*}\label{wxvariantvoid}
|
||||
|
||||
\constfunc{void*}{operator void*}{\void}
|
||||
|
@@ -1,257 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/date.h
|
||||
// Purpose: wxDate class: this class is deprecated, use wxDateTime instead!
|
||||
// Author: Julian Smart, Steve Marcus, Eric Simon, Chris Hill,
|
||||
// Charles D. Price
|
||||
// Modified by: 18.12.99 by VZ to use the new wxDateTime class
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: Julian Smart, Steve Marcus, Eric Simon, Chris Hill,
|
||||
// Charles D. Price
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DATE_H_
|
||||
#define _WX_DATE_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(__APPLE__)
|
||||
#pragma interface "date.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_TIMEDATE
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/datetime.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
enum wxdate_format_type
|
||||
{
|
||||
wxMDY,
|
||||
wxDAY,
|
||||
wxMONTH,
|
||||
wxFULL,
|
||||
wxEUROPEAN
|
||||
};
|
||||
|
||||
enum // wxdate_format_flags
|
||||
{
|
||||
wxNO_CENTURY = 0x02,
|
||||
wxDATE_ABBR = 0x04
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDate
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxDate : public wxObject
|
||||
{
|
||||
public:
|
||||
wxDate() { Init(); }
|
||||
wxDate(long j) : m_date((double)(j + 0.5)) { Init(); }
|
||||
wxDate(int m, int d, int y) : m_date(d, (wxDateTime::Month)m, y) { Init(); }
|
||||
wxDate(const wxString& dat) { Init(); (void)m_date.ParseDate(dat); }
|
||||
wxDate(const wxDate &date) : wxObject() { *this = date; }
|
||||
|
||||
wxDate(const wxDateTime& dt) { Init(); m_date = dt; }
|
||||
|
||||
#ifndef __SALFORDC__
|
||||
operator wxString() const { return FormatDate(); }
|
||||
#endif
|
||||
|
||||
void operator=(const wxDate& date)
|
||||
{
|
||||
m_date = date.m_date;
|
||||
m_displayFormat = date.m_displayFormat;
|
||||
m_displayOptions = date.m_displayOptions;
|
||||
}
|
||||
|
||||
void operator=(const wxString& dat) { (void)m_date.ParseDate(dat); }
|
||||
|
||||
wxDate operator+(long i) { return wxDate(GetJulianDate() + i); }
|
||||
wxDate operator+(int i) { return wxDate(GetJulianDate() + (long)i); }
|
||||
|
||||
wxDate operator-(long i) { return wxDate(GetJulianDate() - i); }
|
||||
wxDate operator-(int i) { return wxDate(GetJulianDate() - (long)i); }
|
||||
|
||||
long operator-(const wxDate &dt) const
|
||||
{ return GetJulianDate() - dt.GetJulianDate(); }
|
||||
|
||||
wxDate &operator+=(long i) { m_date += wxTimeSpan::Days((int)i); return *this; }
|
||||
wxDate &operator-=(long i) { m_date -= wxTimeSpan::Days((int)i); return *this; }
|
||||
|
||||
wxDate &operator++() { return *this += 1; }
|
||||
wxDate &operator++(int) { return *this += 1; }
|
||||
wxDate &operator--() { return *this -= 1; }
|
||||
wxDate &operator--(int) { return *this -= 1; }
|
||||
|
||||
#if wxUSE_STD_IOSTREAM
|
||||
friend wxSTD ostream WXDLLEXPORT & operator <<(wxSTD ostream &os, const wxDate &dt)
|
||||
{ return os << dt.FormatDate().mb_str(); }
|
||||
#endif
|
||||
|
||||
void SetFormat(int format) { m_displayFormat = format; }
|
||||
int SetOption(int option, bool enable = TRUE)
|
||||
{
|
||||
if ( enable )
|
||||
m_displayOptions |= option;
|
||||
else
|
||||
m_displayOptions &= ~option;
|
||||
|
||||
return 1; // (VZ: whatever it means)
|
||||
}
|
||||
|
||||
// returns julian date (VZ: the integral part of Julian Day Number)
|
||||
long GetJulianDate() const
|
||||
{ return (long)(m_date.GetJulianDayNumber() - 0.5); }
|
||||
|
||||
// returns relative date since Jan. 1
|
||||
int GetDayOfYear() const
|
||||
{ return m_date.GetDayOfYear(); }
|
||||
|
||||
// returns TRUE if leap year, FALSE if not
|
||||
bool IsLeapYear() const
|
||||
{ return wxDateTime::IsLeapYear(m_date.GetYear()); }
|
||||
|
||||
// Sets to current system date
|
||||
wxDate &Set()
|
||||
{ m_date = wxDateTime::Today(); return (wxDate&)*this; }
|
||||
wxDate &Set(long lJulian)
|
||||
{ m_date.Set((double)(lJulian + 0.5)); return (wxDate&)*this; }
|
||||
wxDate &Set(int nMonth, int nDay, int nYear)
|
||||
{ m_date.Set(nDay, (wxDateTime::Month)nMonth, nYear); return *this; }
|
||||
|
||||
// May also pass neg# to decrement
|
||||
wxDate &AddWeeks(int nCount = 1)
|
||||
{ m_date += wxDateSpan::Weeks(nCount); return *this; }
|
||||
wxDate &AddMonths(int nCount = 1)
|
||||
{ m_date += wxDateSpan::Months(nCount); return *this; }
|
||||
wxDate &AddYears(int nCount = 1)
|
||||
{ m_date += wxDateSpan::Years(nCount); return *this; }
|
||||
|
||||
// Numeric Day of date object
|
||||
int GetDay() const { return m_date.GetDay(); }
|
||||
// Number of days in month(1..31)
|
||||
int GetDaysInMonth() const
|
||||
{
|
||||
return wxDateTime::GetNumberOfDays((wxDateTime::Month)m_date.GetMonth(),
|
||||
m_date.GetYear());
|
||||
}
|
||||
|
||||
// First Day Of Month(1..7)
|
||||
int GetFirstDayOfMonth() const
|
||||
{ return wxDate(GetMonth(), 1, GetYear()).GetDayOfWeek(); }
|
||||
|
||||
// Character Day Of Week('Sunday'..'Saturday')
|
||||
wxString GetDayOfWeekName() const { return FormatDate(wxDAY); }
|
||||
int GetDayOfWeek() const { return (int)m_date.GetWeekDay() + 1; }
|
||||
|
||||
// Numeric Week Of Month(1..6) (VZ: I'd love to see a month with 6 weeks)
|
||||
int GetWeekOfMonth() const { return m_date.GetWeekOfMonth(); }
|
||||
// Numeric Week Of Year(1..52) (VZ: but there are years with 53 weeks)
|
||||
int GetWeekOfYear() const { return m_date.GetWeekOfYear(); }
|
||||
|
||||
// Character Month name
|
||||
wxString GetMonthName() { return FormatDate(wxMONTH); }
|
||||
// Month Number(1..12)
|
||||
int GetMonth() const { return m_date.GetMonth() + 1; }
|
||||
|
||||
// First Date Of Month
|
||||
wxDate GetMonthStart() const { return(wxDate(GetMonth()-1, 1, GetYear())); }
|
||||
// Last Date Of Month
|
||||
wxDate GetMonthEnd() const { return wxDate(GetMonth(), 1, GetYear())-1; }
|
||||
|
||||
// eg. 1992
|
||||
int GetYear() const { return m_date.GetYear(); }
|
||||
// First Date Of Year
|
||||
wxDate GetYearStart() const { return wxDate(0, 1, GetYear()); }
|
||||
// Last Date Of Year
|
||||
wxDate GetYearEnd() const { return wxDate(0, 1, GetYear()+1) - 1; }
|
||||
|
||||
bool IsBetween(const wxDate& first, const wxDate& second) const
|
||||
{
|
||||
return m_date.IsBetween(first.m_date, second.m_date);
|
||||
}
|
||||
|
||||
wxDate Previous(int dayOfWeek) const
|
||||
{
|
||||
wxDate prev = *this;
|
||||
int dow = GetDayOfWeek();
|
||||
prev -= dayOfWeek > dow ? 7 - (dayOfWeek - dow) : dow - dayOfWeek;
|
||||
|
||||
return prev;
|
||||
}
|
||||
|
||||
wxString FormatDate(int type = -1) const
|
||||
{
|
||||
static const wxChar *formats[] =
|
||||
{
|
||||
// MDY (week)DAY MONTH FULL EUROPEAN
|
||||
_T("%m/%d/%Y"), _T("%A"), _T("%B"), _T("%A, %B %d, %Y"), _T("%d %B %Y")
|
||||
};
|
||||
|
||||
wxString fmt = formats[type == -1 ? m_displayFormat : type];
|
||||
|
||||
if ( m_displayOptions & wxDATE_ABBR )
|
||||
{
|
||||
fmt.Replace(_T("A"), _T("a"));
|
||||
fmt.Replace(_T("B"), _T("b"));
|
||||
}
|
||||
if ( m_displayOptions & wxNO_CENTURY )
|
||||
{
|
||||
fmt.Replace(_T("Y"), _T("y"));
|
||||
}
|
||||
|
||||
return m_date.Format(fmt);
|
||||
}
|
||||
|
||||
protected:
|
||||
void Init() { m_displayFormat = wxMDY; m_displayOptions = 0; }
|
||||
|
||||
#if 0 // the old wxDate members - unused any more
|
||||
unsigned long julian; // see julDate(); days since 1/1/4713 B.C.
|
||||
int month; // see NMonth()
|
||||
int day; // see Day()
|
||||
int year; // see NYear4()
|
||||
int day_of_week; // see NDOW(); 1 = Sunday, ... 7 = Saturday
|
||||
|
||||
void julian_to_mdy(); // convert julian day to mdy
|
||||
void julian_to_wday(); // convert julian day to day_of_week
|
||||
void mdy_to_julian(); // convert mdy to julian day
|
||||
#endif // 0
|
||||
|
||||
private:
|
||||
wxDateTime m_date;
|
||||
|
||||
int m_displayFormat;
|
||||
int m_displayOptions;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxDate)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// global functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
inline bool WXDLLEXPORT operator <(const wxDate &dt1, const wxDate &dt2)
|
||||
{ return dt1.GetJulianDate() < dt2.GetJulianDate(); }
|
||||
inline bool WXDLLEXPORT operator <=(const wxDate &dt1, const wxDate &dt2)
|
||||
{ return dt1.GetJulianDate() <= dt2.GetJulianDate(); }
|
||||
inline bool WXDLLEXPORT operator >(const wxDate &dt1, const wxDate &dt2)
|
||||
{ return dt1.GetJulianDate() > dt2.GetJulianDate(); }
|
||||
inline bool WXDLLEXPORT operator >=(const wxDate &dt1, const wxDate &dt2)
|
||||
{ return dt1.GetJulianDate() >= dt2.GetJulianDate(); }
|
||||
inline bool WXDLLEXPORT operator ==(const wxDate &dt1, const wxDate &dt2)
|
||||
{ return dt1.GetJulianDate() == dt2.GetJulianDate(); }
|
||||
inline bool WXDLLEXPORT operator !=(const wxDate &dt1, const wxDate &dt2)
|
||||
{ return dt1.GetJulianDate() != dt2.GetJulianDate(); }
|
||||
|
||||
#endif // wxUSE_TIMEDATE
|
||||
#endif
|
||||
// _WX_DATE_H_
|
@@ -305,15 +305,6 @@
|
||||
// Recommended setting: 1
|
||||
#define wxUSE_DATETIME 1
|
||||
|
||||
// wxUSE_TIMEDATE enables compilation of the old wxDate and wxTime classes (not
|
||||
// the same as wxDateTime!). These classes are obsolete and shouldn't be used
|
||||
// in new code
|
||||
//
|
||||
// Default is 0
|
||||
//
|
||||
// Recommended setting: 0 unless you have legacy code which uses these classes
|
||||
#define wxUSE_TIMEDATE 0
|
||||
|
||||
// Set wxUSE_TIMER to 1 to compile wxTimer class
|
||||
//
|
||||
// Default is 1
|
||||
|
@@ -304,15 +304,6 @@
|
||||
// Recommended setting: 1
|
||||
#define wxUSE_DATETIME 1
|
||||
|
||||
// wxUSE_TIMEDATE enables compilation of the old wxDate and wxTime classes (not
|
||||
// the same as wxDateTime!). These classes are obsolete and shouldn't be used
|
||||
// in new code
|
||||
//
|
||||
// Default is 0
|
||||
//
|
||||
// Recommended setting: 0 unless you have legacy code which uses these classes
|
||||
#define wxUSE_TIMEDATE 0
|
||||
|
||||
// Set wxUSE_TIMER to 1 to compile wxTimer class
|
||||
//
|
||||
// Default is 1
|
||||
|
@@ -299,15 +299,6 @@
|
||||
// Recommended setting: 1
|
||||
#define wxUSE_DATETIME 1
|
||||
|
||||
// wxUSE_TIMEDATE enables compilation of the old wxDate and wxTime classes (not
|
||||
// the same as wxDateTime!). These classes are obsolete and shouldn't be used
|
||||
// in new code
|
||||
//
|
||||
// Default is 0
|
||||
//
|
||||
// Recommended setting: 0 unless you have legacy code which uses these classes
|
||||
#define wxUSE_TIMEDATE 0
|
||||
|
||||
// Set wxUSE_TIMER to 1 to compile wxTimer class
|
||||
//
|
||||
// Default is 1
|
||||
|
@@ -1,158 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/time.h
|
||||
// Purpose: wxTime class, from NIHCL: this class is deprecated, use
|
||||
// wxDateTime instead
|
||||
// Author: Julian Smart, after K. E. Gorlen
|
||||
// Modified by: 18.12.99 by VZ to use the new wxDateTime class
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_TIMEH__
|
||||
#define _WX_TIMEH__
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_TIMEDATE
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/datetime.h"
|
||||
#include "wx/date.h"
|
||||
|
||||
#if defined(__GNUG__) && !defined(__APPLE__)
|
||||
#pragma interface "time.h"
|
||||
#endif
|
||||
|
||||
class WXDLLEXPORT wxDate;
|
||||
|
||||
typedef unsigned short hourTy;
|
||||
typedef unsigned short minuteTy;
|
||||
typedef unsigned short secondTy;
|
||||
typedef unsigned long clockTy;
|
||||
|
||||
// seconds from 1/1/01 to 1/1/70
|
||||
#define wxTIME_EPOCH_DIFF 2177452800UL
|
||||
|
||||
class WXDLLEXPORT wxTime : public wxObject
|
||||
{
|
||||
public:
|
||||
// type definitions
|
||||
enum tFormat { wx12h, wx24h };
|
||||
enum tPrecision { wxStdMinSec, wxStdMin };
|
||||
|
||||
public:
|
||||
// current time
|
||||
wxTime() : m_time(wxDateTime::Now()) { }
|
||||
wxTime(clockTy s) : m_time((time_t)(s - wxTIME_EPOCH_DIFF)) { }
|
||||
void operator=(const wxTime& t) { m_time = t.m_time; }
|
||||
wxTime(const wxTime& t) : wxObject() { *this = t; }
|
||||
wxTime(hourTy h, minuteTy m, secondTy s = 0, bool WXUNUSED(dst) = FALSE)
|
||||
: m_time(h, m, s) { }
|
||||
|
||||
wxTime(const wxDate& d, hourTy h = 0, minuteTy m = 0, secondTy s = 0,
|
||||
bool WXUNUSED(dst) = FALSE)
|
||||
: m_time(d.GetDay(), (wxDateTime::Month)d.GetMonth(), d.GetYear(),
|
||||
h, m, s) { }
|
||||
|
||||
wxTime(const wxDateTime& time) : m_time(time) { }
|
||||
|
||||
// Convert to string
|
||||
#ifndef __SALFORDC__
|
||||
operator wxChar *() const { return FormatTime(); }
|
||||
operator wxDate() const { return wxDate(m_time); }
|
||||
#endif
|
||||
|
||||
bool operator< (const wxTime& t) const { return m_time < t.m_time; }
|
||||
bool operator<=(const wxTime& t) const { return m_time <= t.m_time; }
|
||||
bool operator> (const wxTime& t) const { return m_time > t.m_time; }
|
||||
bool operator>=(const wxTime& t) const { return m_time >= t.m_time; }
|
||||
bool operator==(const wxTime& t) const { return m_time == t.m_time; }
|
||||
bool operator!=(const wxTime& t) const { return m_time != t.m_time; }
|
||||
|
||||
friend wxTime WXDLLEXPORT operator+(const wxTime& t, long s)
|
||||
{ return wxTime(t.m_time + wxTimeSpan::Seconds((int)s)); }
|
||||
friend wxTime WXDLLEXPORT operator+(long s, const wxTime& t)
|
||||
{ return wxTime(t.m_time + wxTimeSpan::Seconds((int)s)); }
|
||||
|
||||
long operator-(const wxTime& t) const
|
||||
{ return (m_time - t.m_time).GetValue().ToLong(); }
|
||||
wxTime operator-(long s) const
|
||||
{ return wxTime(m_time - wxTimeSpan::Seconds((int)s)); }
|
||||
void operator+=(long s) { m_time += wxTimeSpan::Seconds((int)s); }
|
||||
void operator-=(long s) { m_time -= wxTimeSpan::Seconds((int)s); }
|
||||
bool IsBetween(const wxTime& a, const wxTime& b) const
|
||||
{ return *this >= a && *this <= b; }
|
||||
|
||||
// Get day
|
||||
int GetDay() const { return m_time.GetDay(); }
|
||||
// Get month
|
||||
int GetMonth() const { return m_time.GetMonth(); }
|
||||
// Get year
|
||||
int GetYear() const { return m_time.GetYear(); }
|
||||
// Get day of week (0=Sunday 6=Saturday)
|
||||
int GetDayOfWeek() const { return m_time.GetWeekDay(); }
|
||||
|
||||
hourTy GetHour() const { return (hourTy)m_time.GetHour(); }
|
||||
hourTy GetHourGMT() const { return (hourTy)m_time.GetHour(wxDateTime::GMT0); }
|
||||
minuteTy GetMinute() const { return (hourTy)m_time.GetMinute(); }
|
||||
minuteTy GetMinuteGMT() const { return (hourTy)m_time.GetMinute(wxDateTime::GMT0); }
|
||||
secondTy GetSecond() const { return (hourTy)m_time.GetSecond(); }
|
||||
secondTy GetSecondGMT() const { return (hourTy)m_time.GetSecond(wxDateTime::GMT0); }
|
||||
|
||||
clockTy GetSeconds() const { return (clockTy)m_time.GetValue().ToLong(); }
|
||||
|
||||
wxTime Max(const wxTime& t) const { return (t < *this) ? *this : t; }
|
||||
wxTime Min(const wxTime& t) const { return (t > *this) ? *this : t; }
|
||||
|
||||
static void SetFormat(const tFormat lFormat = wx12h,
|
||||
const tPrecision lPrecision = wxStdMinSec)
|
||||
{
|
||||
ms_Format = lFormat;
|
||||
ms_Precision = lPrecision;
|
||||
}
|
||||
|
||||
// (VZ: DANGER: returns pointer to static buffer)
|
||||
wxChar *FormatTime() const
|
||||
{
|
||||
static const wxChar *formats[2][2] =
|
||||
{
|
||||
// wxStdMinSec wxStdMin
|
||||
{ _T("%I:%M:%S %p"), _T("%I:%M %p") }, // wx12h
|
||||
{ _T("%H:%M:%S"), _T("%H:%M") } // wx24h
|
||||
};
|
||||
|
||||
wxStrncpy(ms_bufTime, m_time.Format(formats[ms_Format][ms_Precision]),
|
||||
WXSIZEOF(ms_bufTime));
|
||||
|
||||
return ms_bufTime;
|
||||
}
|
||||
|
||||
private:
|
||||
static tFormat ms_Format;
|
||||
static tPrecision ms_Precision;
|
||||
static wxChar ms_bufTime[128];
|
||||
|
||||
#if 0 // old wxTime members unused any more
|
||||
clockTy sec; /* seconds since 1/1/1901 */
|
||||
|
||||
bool IsDST() const;
|
||||
wxTime GetLocalTime() const;
|
||||
|
||||
// static member functions
|
||||
static wxTime GetLocalTime(const wxDate& date, hourTy h=0, minuteTy m=0, secondTy s=0);
|
||||
static wxTime GetBeginDST(unsigned year);
|
||||
static wxTime GetEndDST(unsigned year);
|
||||
#endif // 0
|
||||
|
||||
wxDateTime m_time;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxTime)
|
||||
};
|
||||
|
||||
#endif
|
||||
// wxUSE_TIMEDATE
|
||||
#endif
|
||||
// _WX_TIMEH__
|
||||
|
@@ -21,11 +21,6 @@
|
||||
#include "wx/string.h"
|
||||
#include "wx/list.h"
|
||||
|
||||
#if wxUSE_TIMEDATE
|
||||
#include "wx/time.h"
|
||||
#include "wx/date.h"
|
||||
#endif // time/date
|
||||
|
||||
#if wxUSE_DATETIME
|
||||
#include "wx/datetime.h"
|
||||
#endif // wxUSE_DATETIME
|
||||
@@ -99,11 +94,6 @@ public:
|
||||
wxVariant(const wxChar* val, const wxString& name = wxEmptyString); // Necessary or VC++ assumes bool!
|
||||
wxVariant(const wxStringList& val, const wxString& name = wxEmptyString);
|
||||
wxVariant(const wxList& val, const wxString& name = wxEmptyString); // List of variants
|
||||
// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
|
||||
#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
|
||||
wxVariant(const wxTime& val, const wxString& name = wxEmptyString); // Time
|
||||
wxVariant(const wxDate& val, const wxString& name = wxEmptyString); // Date
|
||||
#endif
|
||||
wxVariant(void* ptr, const wxString& name = wxEmptyString); // void* (general purpose)
|
||||
wxVariant(wxVariantData* data, const wxString& name = wxEmptyString); // User-defined data
|
||||
//TODO: Need to document
|
||||
@@ -173,15 +163,6 @@ public:
|
||||
bool operator== (const wxList& value) const;
|
||||
bool operator!= (const wxList& value) const;
|
||||
void operator= (const wxList& value) ;
|
||||
// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
|
||||
#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
|
||||
bool operator== (const wxTime& value) const;
|
||||
bool operator!= (const wxTime& value) const;
|
||||
void operator= (const wxTime& value) ;
|
||||
bool operator== (const wxDate& value) const;
|
||||
bool operator!= (const wxDate& value) const;
|
||||
void operator= (const wxDate& value) ;
|
||||
#endif
|
||||
bool operator== (void* value) const;
|
||||
bool operator!= (void* value) const;
|
||||
void operator= (void* value) ;
|
||||
@@ -199,11 +180,6 @@ public:
|
||||
inline operator char () const { return GetChar(); }
|
||||
inline operator long () const { return GetLong(); }
|
||||
inline operator bool () const { return GetBool(); }
|
||||
// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
|
||||
#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
|
||||
inline operator wxTime () const { return GetTime(); }
|
||||
inline operator wxDate () const { return GetDate(); }
|
||||
#endif
|
||||
inline operator void* () const { return GetVoidPtr(); }
|
||||
//TODO: Need to document
|
||||
#if wxUSE_DATETIME
|
||||
@@ -242,11 +218,6 @@ public:
|
||||
wxList& GetList() const ;
|
||||
wxStringList& GetStringList() const ;
|
||||
|
||||
// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
|
||||
#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
|
||||
wxTime GetTime() const ;
|
||||
wxDate GetDate() const ;
|
||||
#endif
|
||||
void* GetVoidPtr() const ;
|
||||
//TODO: Need to document
|
||||
#if wxUSE_DATETIME
|
||||
@@ -285,11 +256,6 @@ public:
|
||||
bool Convert(double* value) const;
|
||||
bool Convert(wxString* value) const;
|
||||
bool Convert(char* value) const;
|
||||
// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
|
||||
#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
|
||||
bool Convert(wxTime* value) const;
|
||||
bool Convert(wxDate* value) const;
|
||||
#endif
|
||||
//TODO: Need to document
|
||||
#if wxUSE_DATETIME
|
||||
bool Convert(wxDateTime* value) const;
|
||||
|
@@ -4156,7 +4156,6 @@ static void TestZlibStreamRead()
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "wx/date.h"
|
||||
#include "wx/datetime.h"
|
||||
|
||||
// the test data
|
||||
@@ -5156,38 +5155,6 @@ static void TestTimeSpanFormat()
|
||||
wxPuts(_T(""));
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
// test compatibility with the old wxDate/wxTime classes
|
||||
static void TestTimeCompatibility()
|
||||
{
|
||||
wxPuts(_T("\n*** wxDateTime compatibility test ***"));
|
||||
|
||||
wxPrintf(_T("wxDate for JDN 0: %s\n"), wxDate(0l).FormatDate().c_str());
|
||||
wxPrintf(_T("wxDate for MJD 0: %s\n"), wxDate(2400000).FormatDate().c_str());
|
||||
|
||||
double jdnNow = wxDateTime::Now().GetJDN();
|
||||
long jdnMidnight = (long)(jdnNow - 0.5);
|
||||
wxPrintf(_T("wxDate for today: %s\n"), wxDate(jdnMidnight).FormatDate().c_str());
|
||||
|
||||
jdnMidnight = wxDate().Set().GetJulianDate();
|
||||
wxPrintf(_T("wxDateTime for today: %s\n"),
|
||||
wxDateTime((double)(jdnMidnight + 0.5)).Format("%c", wxDateTime::GMT0).c_str());
|
||||
|
||||
int flags = wxEUROPEAN;//wxFULL;
|
||||
wxDate date;
|
||||
date.Set();
|
||||
wxPrintf(_T("Today is %s\n"), date.FormatDate(flags).c_str());
|
||||
for ( int n = 0; n < 7; n++ )
|
||||
{
|
||||
wxPrintf(_T("Previous %s is %s\n"),
|
||||
wxDateTime::GetWeekDayName((wxDateTime::WeekDay)n),
|
||||
date.Previous(n + 1).FormatDate(flags).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
#endif // 0
|
||||
|
||||
#endif // TEST_DATETIME
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -26,7 +26,6 @@
|
||||
|
||||
#include "wx/thread.h"
|
||||
#include "wx/dynarray.h"
|
||||
#include "wx/time.h"
|
||||
|
||||
#include "wx/progdlg.h"
|
||||
|
||||
|
@@ -24,8 +24,6 @@
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
#include "wx/time.h"
|
||||
#include "wx/date.h"
|
||||
#include "wx/variant.h"
|
||||
#include "wx/mimetype.h"
|
||||
|
||||
@@ -58,10 +56,6 @@ IMPLEMENT_APP (MyApp)
|
||||
IMPLEMENT_DYNAMIC_CLASS (MyApp, wxApp)
|
||||
|
||||
BEGIN_EVENT_TABLE(MyApp, wxApp)
|
||||
#if wxUSE_TIMEDATE
|
||||
EVT_MENU(TYPES_DATE, MyApp::DoDateDemo)
|
||||
EVT_MENU(TYPES_TIME, MyApp::DoTimeDemo)
|
||||
#endif // wxUSE_TIMEDATE
|
||||
EVT_MENU(TYPES_VARIANT, MyApp::DoVariantDemo)
|
||||
EVT_MENU(TYPES_BYTEORDER, MyApp::DoByteOrderDemo)
|
||||
#if wxUSE_UNICODE
|
||||
@@ -94,10 +88,6 @@ bool MyApp::OnInit()
|
||||
file_menu->Append(TYPES_QUIT, _T("E&xit\tAlt-X"));
|
||||
|
||||
wxMenu *test_menu = new wxMenu;
|
||||
#if wxUSE_TIMEDATE
|
||||
test_menu->Append(TYPES_DATE, _T("&Date test"));
|
||||
test_menu->Append(TYPES_TIME, _T("&Time test"));
|
||||
#endif // wxUSE_TIMEDATE
|
||||
test_menu->Append(TYPES_VARIANT, _T("&Variant test"));
|
||||
test_menu->Append(TYPES_BYTEORDER, _T("&Byteorder test"));
|
||||
#if wxUSE_UNICODE
|
||||
@@ -1016,161 +1006,6 @@ void MyApp::DoByteOrderDemo(wxCommandEvent& WXUNUSED(event))
|
||||
textCtrl.WriteText( text );
|
||||
}
|
||||
|
||||
#if wxUSE_TIMEDATE
|
||||
|
||||
void MyApp::DoTimeDemo(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxTextCtrl& textCtrl = * GetTextCtrl();
|
||||
|
||||
textCtrl.Clear();
|
||||
textCtrl << _T("\nTest class wxTime:\n");
|
||||
wxTime now;
|
||||
textCtrl << _T("It is now ") << (wxString) now << _T("\n");
|
||||
}
|
||||
|
||||
void MyApp::DoDateDemo(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxTextCtrl& textCtrl = * GetTextCtrl();
|
||||
|
||||
textCtrl.Clear();
|
||||
textCtrl << _T("\nTest class wxDate") << _T("\n");
|
||||
|
||||
// Various versions of the constructors
|
||||
// and various output
|
||||
|
||||
wxDate x(10,20,1962);
|
||||
|
||||
textCtrl << x.FormatDate(wxFULL) << _T(" (full)\n");
|
||||
|
||||
// constuctor with a string, just printing the day of the week
|
||||
wxDate y(_T("8/8/1988"));
|
||||
|
||||
textCtrl << y.FormatDate(wxDAY) << _T(" (just day)\n");
|
||||
|
||||
// constructor with a julian
|
||||
wxDate z( 2450000L );
|
||||
textCtrl << z.FormatDate(wxFULL) << _T(" (full)\n");
|
||||
|
||||
// using date addition and subtraction
|
||||
wxDate a = x + 10;
|
||||
textCtrl << a.FormatDate(wxFULL) << _T(" (full)\n");
|
||||
a = a - 25;
|
||||
textCtrl << a.FormatDate(wxEUROPEAN) << _T(" (European)\n");
|
||||
|
||||
// Using subtraction of two date objects
|
||||
wxDate a1 = wxString(_T("7/13/1991"));
|
||||
wxDate a2 = a1 + 14;
|
||||
textCtrl << (a1-a2) << _T("\n");
|
||||
textCtrl << (a2+=10) << _T("\n");
|
||||
|
||||
a1++;
|
||||
textCtrl << _T("Tomorrow= ") << a1.FormatDate(wxFULL) << _T("\n");
|
||||
|
||||
wxDate tmpDate1(_T("08/01/1991"));
|
||||
wxDate tmpDate2(_T("07/14/1991"));
|
||||
textCtrl << _T("a1 (7-14-91) < 8-01-91 ? ==> ") << ((a1 < tmpDate1) ? _T("TRUE") : _T("FALSE")) << _T("\n");
|
||||
textCtrl << _T("a1 (7-14-91) > 8-01-91 ? ==> ") << ((a1 > tmpDate1) ? _T("TRUE") : _T("FALSE")) << _T("\n");
|
||||
textCtrl << _T("a1 (7-14-91)== 7-14-91 ? ==> ") << ((a1==tmpDate2) ? _T("TRUE") : _T("FALSE")) << _T("\n");
|
||||
|
||||
wxDate a3 = a1;
|
||||
textCtrl << _T("a1 (7-14-91)== a3 (7-14-91) ? ==> ") << ((a1==a3) ? _T("TRUE") : _T("FALSE")) << _T("\n");
|
||||
wxDate a4 = a1;
|
||||
textCtrl << _T("a1 (7-14-91)== a4 (7-15-91) ? ==> ") << ((a1==++a4) ? _T("TRUE") : _T("FALSE")) << _T("\n");
|
||||
|
||||
wxDate a5 = wxString(_T("today"));
|
||||
textCtrl << _T("Today is: ") << a5 << _T("\n");
|
||||
a4 = _T("TODAY");
|
||||
textCtrl << _T("Today (a4) is: ") << a4 << _T("\n");
|
||||
|
||||
textCtrl << _T("Today + 4 is: ") << (a4+=4) << _T("\n");
|
||||
a4 = _T("TODAY");
|
||||
textCtrl << _T("Today - 4 is: ") << (a4-=4) << _T("\n");
|
||||
|
||||
textCtrl << _T("=========== Leap Year Test ===========\n");
|
||||
a1 = _T("1/15/1992");
|
||||
textCtrl << a1.FormatDate(wxFULL) << _T(" ") << ((a1.IsLeapYear()) ? _T("Leap") : _T("non-Leap"));
|
||||
textCtrl << _T(" ") << _T("day of year: ") << a1.GetDayOfYear() << _T("\n");
|
||||
|
||||
a1 = _T("2/16/1993");
|
||||
textCtrl << a1.FormatDate(wxFULL) << _T(" ") << ((a1.IsLeapYear()) ? _T("Leap") : _T("non-Leap"));
|
||||
textCtrl << _T(" ") << _T("day of year: ") << a1.GetDayOfYear() << _T("\n");
|
||||
|
||||
textCtrl << _T("================== string assignment test ====================\n");
|
||||
wxString date_string=a1;
|
||||
textCtrl << _T("a1 as a string (s/b 2/16/1993) ==> ") << date_string << _T("\n");
|
||||
|
||||
textCtrl << _T("================== SetFormat test ============================\n");
|
||||
a1.SetFormat(wxFULL);
|
||||
textCtrl << _T("a1 (s/b FULL format) ==> ") << a1 << _T("\n");
|
||||
a1.SetFormat(wxEUROPEAN);
|
||||
textCtrl << _T("a1 (s/b EUROPEAN format) ==> ") << a1 << _T("\n");
|
||||
|
||||
textCtrl << _T("================== SetOption test ============================\n");
|
||||
textCtrl << _T("Date abbreviation ON\n");
|
||||
|
||||
a1.SetOption(wxDATE_ABBR);
|
||||
a1.SetFormat(wxMONTH);
|
||||
textCtrl << _T("a1 (s/b MONTH format) ==> ") << a1 << _T("\n");
|
||||
a1.SetFormat(wxDAY);
|
||||
textCtrl << _T("a1 (s/b DAY format) ==> ") << a1 << _T("\n");
|
||||
a1.SetFormat(wxFULL);
|
||||
textCtrl << _T("a1 (s/b FULL format) ==> ") << a1 << _T("\n");
|
||||
a1.SetFormat(wxEUROPEAN);
|
||||
textCtrl << _T("a1 (s/b EUROPEAN format) ==> ") << a1 << _T("\n");
|
||||
textCtrl << _T("Century suppression ON\n");
|
||||
a1.SetOption(wxNO_CENTURY);
|
||||
a1.SetFormat(wxMDY);
|
||||
textCtrl << _T("a1 (s/b MDY format) ==> ") << a1 << _T("\n");
|
||||
textCtrl << _T("Century suppression OFF\n");
|
||||
a1.SetOption(wxNO_CENTURY,FALSE);
|
||||
textCtrl << _T("a1 (s/b MDY format) ==> ") << a1 << _T("\n");
|
||||
textCtrl << _T("Century suppression ON\n");
|
||||
a1.SetOption(wxNO_CENTURY);
|
||||
textCtrl << _T("a1 (s/b MDY format) ==> ") << a1 << _T("\n");
|
||||
a1.SetFormat(wxFULL);
|
||||
textCtrl << _T("a1 (s/b FULL format) ==> ") << a1 << _T("\n");
|
||||
|
||||
textCtrl << _T("\n=============== Version 4.0 Enhancement Test =================\n");
|
||||
|
||||
wxDate v4(_T("11/26/1966"));
|
||||
textCtrl << _T("\n---------- Set Stuff -----------\n");
|
||||
textCtrl << _T("First, 'Set' to today...") << _T("\n");
|
||||
textCtrl << _T("Before 'Set' => ") << v4 << _T("\n");
|
||||
textCtrl << _T("After 'Set' => ") << v4.Set() << _T("\n\n");
|
||||
|
||||
textCtrl << _T("Set to 11/26/66 => ") << v4.Set(11,26,1966) << _T("\n");
|
||||
textCtrl << _T("Current Julian => ") << v4.GetJulianDate() << _T("\n");
|
||||
textCtrl << _T("Set to Julian 2450000L => ") << v4.Set(2450000L) << _T("\n");
|
||||
textCtrl << _T("See! => ") << v4.GetJulianDate() << _T("\n");
|
||||
|
||||
textCtrl << _T("---------- Add Stuff -----------\n");
|
||||
textCtrl << _T("Start => ") << v4 << _T("\n");
|
||||
textCtrl << _T("Add 4 Weeks => ") << v4.AddWeeks(4) << _T("\n");
|
||||
textCtrl << _T("Sub 1 Month => ") << v4.AddMonths(-1) << _T("\n");
|
||||
textCtrl << _T("Add 2 Years => ") << v4.AddYears(2) << _T("\n");
|
||||
|
||||
textCtrl << _T("---------- Misc Stuff -----------\n");
|
||||
textCtrl << _T("The date aboves' day of the month is => ") << v4.GetDay() << _T("\n");
|
||||
textCtrl << _T("There are ") << v4.GetDaysInMonth() << _T(" days in this month.\n");
|
||||
textCtrl << _T("The first day of this month lands on ") << v4.GetFirstDayOfMonth() << _T("\n");
|
||||
textCtrl << _T("This day happens to be ") << v4.GetDayOfWeekName() << _T("\n");
|
||||
textCtrl << _T("the ") << v4.GetDayOfWeek() << _T(" day of the week,") << _T("\n");
|
||||
textCtrl << _T("on the ") << v4.GetWeekOfYear() << _T(" week of the year,") << _T("\n");
|
||||
textCtrl << _T("on the ") << v4.GetWeekOfMonth() << _T(" week of the month, ") << _T("\n");
|
||||
textCtrl << _T("(which is ") << v4.GetMonthName() << _T(")\n");
|
||||
textCtrl << _T("the ")<< v4.GetMonth() << _T("th month in the year.\n");
|
||||
textCtrl << _T("The year alone is ") << v4.GetYear() << _T("\n");
|
||||
|
||||
textCtrl << _T("---------- First and Last Stuff -----------\n");
|
||||
v4.Set();
|
||||
textCtrl << _T("The first date of this month is ") << v4.GetMonthStart() << _T("\n");
|
||||
textCtrl << _T("The last date of this month is ") << v4.GetMonthEnd() << _T("\n");
|
||||
textCtrl << _T("The first date of this year is ") << v4.GetYearStart() << _T("\n");
|
||||
textCtrl << _T("The last date of this year is ") << v4.GetYearEnd() << _T("\n");
|
||||
}
|
||||
|
||||
#endif // wxUSE_TIMEDATE
|
||||
|
||||
void MyApp::DoVariantDemo(wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxTextCtrl& textCtrl = * GetTextCtrl();
|
||||
|
@@ -25,10 +25,6 @@ public:
|
||||
bool OnInit();
|
||||
int OnExit() { delete m_mimeDatabase; return wxApp::OnExit(); }
|
||||
|
||||
#if wxUSE_TIMEDATE
|
||||
void DoDateDemo(wxCommandEvent& event);
|
||||
#endif // wxUSE_TIMEDATE
|
||||
void DoTimeDemo(wxCommandEvent& event);
|
||||
void DoVariantDemo(wxCommandEvent& event);
|
||||
void DoByteOrderDemo(wxCommandEvent& event);
|
||||
void DoStreamDemo(wxCommandEvent& event);
|
||||
|
@@ -11,8 +11,6 @@
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "variant.h"
|
||||
#pragma implementation "time.h"
|
||||
#pragma implementation "date.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
@@ -40,15 +38,6 @@
|
||||
|
||||
#include "wx/variant.h"
|
||||
|
||||
#if wxUSE_TIMEDATE
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxDate, wxObject)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxTime, wxObject)
|
||||
|
||||
wxTime::tFormat wxTime::ms_Format = wxTime::wx12h;
|
||||
wxTime::tPrecision wxTime::ms_Precision = wxTime::wxStdMinSec;
|
||||
wxChar wxTime::ms_bufTime[128];
|
||||
#endif
|
||||
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxVariantData, wxObject)
|
||||
|
||||
wxVariant WXDLLEXPORT wxNullVariant;
|
||||
@@ -829,174 +818,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxVariantStringData, wxVariantData)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxVariantDataString, wxVariantData)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wxVariantDataTime
|
||||
*/
|
||||
|
||||
// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
|
||||
#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
|
||||
|
||||
class wxVariantDataTime: public wxVariantData
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxVariantDataTime)
|
||||
public:
|
||||
wxVariantDataTime() { }
|
||||
wxVariantDataTime(const wxTime& value) { m_value = value; }
|
||||
|
||||
inline wxTime GetValue() const { return m_value; }
|
||||
inline void SetValue(const wxTime& value) { m_value = value; }
|
||||
|
||||
virtual void Copy(wxVariantData& data);
|
||||
virtual bool Eq(wxVariantData& data) const;
|
||||
#if wxUSE_STD_IOSTREAM
|
||||
virtual bool Write(wxSTD ostream& str) const;
|
||||
#endif
|
||||
virtual bool Write(wxString& str) const;
|
||||
#if wxUSE_STD_IOSTREAM
|
||||
virtual bool Read(wxSTD istream& str);
|
||||
#endif
|
||||
virtual bool Read(wxString& str);
|
||||
virtual wxString GetType() const { return wxT("time"); };
|
||||
virtual wxVariantData* Clone() { return new wxVariantDataTime; }
|
||||
|
||||
protected:
|
||||
wxTime m_value;
|
||||
};
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxVariantDataTime, wxVariantData)
|
||||
|
||||
void wxVariantDataTime::Copy(wxVariantData& data)
|
||||
{
|
||||
wxASSERT_MSG( (data.GetType() == wxT("time")), wxT("wxVariantDataTime::Copy: Can't copy to this type of data") );
|
||||
|
||||
wxVariantDataTime& otherData = (wxVariantDataTime&) data;
|
||||
|
||||
otherData.m_value = m_value;
|
||||
}
|
||||
|
||||
bool wxVariantDataTime::Eq(wxVariantData& data) const
|
||||
{
|
||||
wxASSERT_MSG( (data.GetType() == wxT("time")), wxT("wxVariantDataTime::Eq: argument mismatch") );
|
||||
|
||||
wxVariantDataTime& otherData = (wxVariantDataTime&) data;
|
||||
|
||||
return (otherData.m_value == m_value);
|
||||
}
|
||||
|
||||
#if wxUSE_STD_IOSTREAM
|
||||
bool wxVariantDataTime::Write(wxSTD ostream& str) const
|
||||
{
|
||||
wxString s;
|
||||
Write(s);
|
||||
str << (const char*) s.mb_str();
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool wxVariantDataTime::Write(wxString& str) const
|
||||
{
|
||||
wxChar*s = m_value.FormatTime();
|
||||
str = s;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#if wxUSE_STD_IOSTREAM
|
||||
bool wxVariantDataTime::Read(wxSTD istream& WXUNUSED(str))
|
||||
{
|
||||
// Not implemented
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool wxVariantDataTime::Read(wxString& WXUNUSED(str))
|
||||
{
|
||||
// Not implemented
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* wxVariantDataDate
|
||||
*/
|
||||
|
||||
class wxVariantDataDate: public wxVariantData
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxVariantDataDate)
|
||||
public:
|
||||
wxVariantDataDate() { }
|
||||
wxVariantDataDate(const wxDate& value) { m_value = value; }
|
||||
|
||||
inline wxDate GetValue() const { return m_value; }
|
||||
inline void SetValue(const wxDate& value) { m_value = value; }
|
||||
|
||||
virtual void Copy(wxVariantData& data);
|
||||
virtual bool Eq(wxVariantData& data) const;
|
||||
#if wxUSE_STD_IOSTREAM
|
||||
virtual bool Write(wxSTD ostream& str) const;
|
||||
#endif
|
||||
virtual bool Write(wxString& str) const;
|
||||
#if wxUSE_STD_IOSTREAM
|
||||
virtual bool Read(wxSTD istream& str);
|
||||
#endif
|
||||
virtual bool Read(wxString& str);
|
||||
virtual wxString GetType() const { return wxT("date"); };
|
||||
virtual wxVariantData* Clone() { return new wxVariantDataDate; }
|
||||
|
||||
protected:
|
||||
wxDate m_value;
|
||||
};
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxVariantDataDate, wxVariantData)
|
||||
|
||||
void wxVariantDataDate::Copy(wxVariantData& data)
|
||||
{
|
||||
wxASSERT_MSG( (data.GetType() == wxT("date")), wxT("wxVariantDataDate::Copy: Can't copy to this type of data") );
|
||||
|
||||
wxVariantDataDate& otherData = (wxVariantDataDate&) data;
|
||||
|
||||
otherData.m_value = m_value;
|
||||
}
|
||||
|
||||
bool wxVariantDataDate::Eq(wxVariantData& data) const
|
||||
{
|
||||
wxASSERT_MSG( (data.GetType() == wxT("date")), wxT("wxVariantDataDate::Eq: argument mismatch") );
|
||||
|
||||
wxVariantDataDate& otherData = (wxVariantDataDate&) data;
|
||||
|
||||
return (otherData.m_value == m_value);
|
||||
}
|
||||
|
||||
#if wxUSE_STD_IOSTREAM
|
||||
bool wxVariantDataDate::Write(wxSTD ostream& str) const
|
||||
{
|
||||
wxString s;
|
||||
Write(s);
|
||||
str << (const char*) s.mb_str();
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool wxVariantDataDate::Write(wxString& str) const
|
||||
{
|
||||
str = m_value.FormatDate();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#if wxUSE_STD_IOSTREAM
|
||||
bool wxVariantDataDate::Read(wxSTD istream& WXUNUSED(str))
|
||||
{
|
||||
// Not implemented
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool wxVariantDataDate::Read(wxString& WXUNUSED(str))
|
||||
{
|
||||
// Not implemented
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
// wxUSE_TIMEDATE
|
||||
|
||||
/*
|
||||
* wxVariantDataVoidPtr
|
||||
*/
|
||||
@@ -1342,35 +1163,6 @@ wxVariant::wxVariant(const wxList& val, const wxString& name) // List of variant
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
|
||||
#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
|
||||
wxVariant::wxVariant(const wxTime& val, const wxString& name) // Time
|
||||
{
|
||||
m_data = new wxVariantDataTime(val);
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
wxVariant::wxVariant(const wxDate& val, const wxString& name) // Date
|
||||
{
|
||||
m_data = new wxVariantDataDate(val);
|
||||
m_name = name;
|
||||
}
|
||||
#endif
|
||||
|
||||
wxVariant::wxVariant(void* val, const wxString& name) // Void ptr
|
||||
{
|
||||
m_data = new wxVariantDataVoidPtr(val);
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
#if wxUSE_DATETIME
|
||||
wxVariant::wxVariant(const wxDateTime& val, const wxString& name) // Date
|
||||
{
|
||||
m_data = new wxVariantDataDateTime(val);
|
||||
m_name = name;
|
||||
}
|
||||
#endif // wxUSE_DATETIME
|
||||
|
||||
#if wxUSE_ODBC
|
||||
wxVariant::wxVariant(const TIME_STRUCT* valptr, const wxString& name) // Date
|
||||
{
|
||||
@@ -1684,65 +1476,6 @@ void wxVariant::operator= (const wxList& value)
|
||||
}
|
||||
}
|
||||
|
||||
// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
|
||||
#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
|
||||
bool wxVariant::operator== (const wxTime& value) const
|
||||
{
|
||||
wxTime thisValue;
|
||||
if (!Convert(&thisValue))
|
||||
return FALSE;
|
||||
|
||||
return value == thisValue;
|
||||
}
|
||||
|
||||
bool wxVariant::operator!= (const wxTime& value) const
|
||||
{
|
||||
return (!((*this) == value));
|
||||
}
|
||||
|
||||
void wxVariant::operator= (const wxTime& value)
|
||||
{
|
||||
if (GetType() == wxT("time"))
|
||||
{
|
||||
((wxVariantDataTime*)GetData())->SetValue(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_data)
|
||||
delete m_data;
|
||||
m_data = new wxVariantDataTime(value);
|
||||
}
|
||||
}
|
||||
|
||||
bool wxVariant::operator== (const wxDate& value) const
|
||||
{
|
||||
wxDate thisValue;
|
||||
if (!Convert(&thisValue))
|
||||
return FALSE;
|
||||
|
||||
return (value == thisValue);
|
||||
}
|
||||
|
||||
bool wxVariant::operator!= (const wxDate& value) const
|
||||
{
|
||||
return (!((*this) == value));
|
||||
}
|
||||
|
||||
void wxVariant::operator= (const wxDate& value)
|
||||
{
|
||||
if (GetType() == wxT("date"))
|
||||
{
|
||||
((wxVariantDataTime*)GetData())->SetValue(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_data)
|
||||
delete m_data;
|
||||
m_data = new wxVariantDataDate(value);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
bool wxVariant::operator== (void* value) const
|
||||
{
|
||||
return (value == ((wxVariantDataVoidPtr*)GetData())->GetValue());
|
||||
@@ -2007,31 +1740,6 @@ wxString wxVariant::GetString() const
|
||||
return value;
|
||||
}
|
||||
|
||||
// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
|
||||
#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
|
||||
wxTime wxVariant::GetTime() const
|
||||
{
|
||||
wxTime value;
|
||||
if (!Convert(& value))
|
||||
{
|
||||
wxFAIL_MSG(wxT("Could not convert to a time"));
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
wxDate wxVariant::GetDate() const
|
||||
{
|
||||
wxDate value;
|
||||
if (!Convert(& value))
|
||||
{
|
||||
wxFAIL_MSG(wxT("Could not convert to a date"));
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
#endif // wxUSE_TIMEDATE
|
||||
|
||||
void* wxVariant::GetVoidPtr() const
|
||||
{
|
||||
wxASSERT( (GetType() == wxT("void*")) );
|
||||
@@ -2225,33 +1933,6 @@ bool wxVariant::Convert(wxString* value) const
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
|
||||
#if wxUSE_TIMEDATE && !defined(__WATCOMC__)
|
||||
bool wxVariant::Convert(wxTime* value) const
|
||||
{
|
||||
wxString type(GetType());
|
||||
if (type == wxT("time"))
|
||||
*value = ((wxVariantDataTime*)GetData())->GetValue();
|
||||
else if (type == wxT("date"))
|
||||
*value = wxTime(((wxVariantDataDate*)GetData())->GetValue());
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxVariant::Convert(wxDate* value) const
|
||||
{
|
||||
wxString type(GetType());
|
||||
if (type == wxT("date"))
|
||||
*value = ((wxVariantDataDate*)GetData())->GetValue();
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif // wxUSE_TIMEDATE
|
||||
|
||||
#if wxUSE_DATETIME
|
||||
bool wxVariant::Convert(wxDateTime* value) const
|
||||
{
|
||||
|
@@ -1674,10 +1674,6 @@ SOURCE=..\include\wx\dataobj.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\include\wx\date.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\include\wx\datetime.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -2366,10 +2362,6 @@ SOURCE=..\include\wx\thread.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\include\wx\time.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\include\wx\timer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
Reference in New Issue
Block a user