1. fixed bug with the accels in sub menus not working
2. fixed minor bugs in wxCmdLineParser, underscores and digits are now allows in the option names 3. made wxGetLocalTimeMillis() public, documented it and other time functions, added wxDateTime::UNow(), also "%l" format specificator in wxDateTime::Format() 4. fixed fatal bug in wxTimeSpan::Format() 5. fixed nice bug in wxDateTime::Subtract(wxDateTime) which returned the result with the wrong sign git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7664 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -32,7 +32,8 @@ enum
|
||||
wxCMD_LINE_OPTION_MANDATORY = 0x01, // this option must be given
|
||||
wxCMD_LINE_PARAM_OPTIONAL = 0x02, // the parameter may be omitted
|
||||
wxCMD_LINE_PARAM_MULTIPLE = 0x04, // the parameter may be repeated
|
||||
wxCMD_LINE_OPTION_HELP = 0x08 // this option is a help request
|
||||
wxCMD_LINE_OPTION_HELP = 0x08, // this option is a help request
|
||||
wxCMD_LINE_NEEDS_SEPARATOR = 0x10, // must have sep before the value
|
||||
};
|
||||
|
||||
// an option value or parameter may be a string (the most common case), a
|
||||
|
@@ -512,6 +512,10 @@ public:
|
||||
// return the wxDateTime object for the current time
|
||||
static inline wxDateTime Now();
|
||||
|
||||
// return the wxDateTime object for the current time with millisecond
|
||||
// precision (if available on this platform)
|
||||
static wxDateTime UNow();
|
||||
|
||||
// return the wxDateTime object for today midnight: i.e. as Now() but
|
||||
// with time set to 0
|
||||
static inline wxDateTime Today();
|
||||
@@ -1096,11 +1100,7 @@ public:
|
||||
// resulting text representation. Notice that only some of format
|
||||
// specifiers valid for wxDateTime are valid for wxTimeSpan: hours,
|
||||
// minutes and seconds make sense, but not "PM/AM" string for example.
|
||||
wxString Format(const wxChar *format = _T("%c")) const;
|
||||
// preferred date representation for the current locale
|
||||
wxString FormatDate() const { return Format(_T("%x")); }
|
||||
// preferred time representation for the current locale
|
||||
wxString FormatTime() const { return Format(_T("%X")); }
|
||||
wxString Format(const wxChar *format = _T("%H:%M:%S")) const;
|
||||
|
||||
// implementation
|
||||
// ------------------------------------------------------------------------
|
||||
|
@@ -324,7 +324,7 @@ inline wxTimeSpan wxDateTime::Subtract(const wxDateTime& datetime) const
|
||||
{
|
||||
wxASSERT_MSG( IsValid() && datetime.IsValid(), _T("invalid wxDateTime"));
|
||||
|
||||
return wxTimeSpan(datetime.GetValue() - GetValue());
|
||||
return wxTimeSpan(GetValue() - datetime.GetValue());
|
||||
}
|
||||
|
||||
inline wxDateTime wxDateTime::Add(const wxDateSpan& diff) const
|
||||
|
@@ -222,10 +222,13 @@ long WXDLLEXPORT wxGetElapsedTime(bool resetTimer = TRUE);
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Get number of seconds since local time 00:00:00 Jan 1st 1970.
|
||||
long WXDLLEXPORT wxGetLocalTime();
|
||||
extern long WXDLLEXPORT wxGetLocalTime();
|
||||
|
||||
// Get number of seconds since GMT 00:00:00, Jan 1st 1970.
|
||||
long WXDLLEXPORT wxGetUTCTime();
|
||||
extern long WXDLLEXPORT wxGetUTCTime();
|
||||
|
||||
// Get number of milliseconds since local time 00:00:00 Jan 1st 1970
|
||||
extern wxLongLong WXDLLEXPORT wxGetLocalTimeMillis();
|
||||
|
||||
#define wxGetCurrentTime() wxGetLocalTime()
|
||||
|
||||
|
Reference in New Issue
Block a user