本文整理汇总了C++中wxDateTime::GetMinute方法的典型用法代码示例。如果您正苦于以下问题:C++ wxDateTime::GetMinute方法的具体用法?C++ wxDateTime::GetMinute怎么用?C++ wxDateTime::GetMinute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxDateTime
的用法示例。
在下文中一共展示了wxDateTime::GetMinute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getRangeOfData
long CVSCPTable::getRangeOfData( wxDateTime& wxStart, wxDateTime& wxEnd, void *buf, uint16_t size )
{
uint64_t from, to;
time_t rawtime;
struct tm *timeStart;
struct tm *timeEnd;
time ( &rawtime );
timeStart = localtime( &rawtime );
timeStart->tm_hour = wxStart.GetHour();
timeStart->tm_min = wxStart.GetMinute();
timeStart->tm_sec = wxStart.GetSecond();
timeStart->tm_mday = wxStart.GetDay();
timeStart->tm_mon = wxStart.GetDay();
timeStart->tm_year = wxStart.GetYear();
from = mktime ( timeStart );
timeEnd = localtime( &rawtime );
timeEnd->tm_hour = wxEnd.GetHour();
timeEnd->tm_min = wxEnd.GetMinute();
timeEnd->tm_sec = wxEnd.GetSecond();
timeEnd->tm_mday = wxEnd.GetDay();
timeEnd->tm_mon = wxEnd.GetDay();
timeEnd->tm_year = wxEnd.GetYear();
to = mktime ( timeEnd );
return getRangeOfData( from, to, buf, size );
}
示例2: switch
// Decrement or increment the value of the current field (wrapping if
// necessary).
void ChangeCurrentFieldBy1(Direction dir)
{
switch ( m_currentField )
{
case Field_Hour:
m_time.SetHour((m_time.GetHour() + 24 + dir) % 24);
break;
case Field_Min:
m_time.SetMinute((m_time.GetMinute() + 60 + dir) % 60);
break;
case Field_Sec:
m_time.SetSecond((m_time.GetSecond() + 60 + dir) % 60);
break;
case Field_AMPM:
m_time.SetHour((m_time.GetHour() + 12) % 24);
break;
case Field_Max:
wxFAIL_MSG( "Invalid field" );
return;
}
UpdateText();
}
示例3: GetDate
bool DateChooserWidget::GetDate(wxDateTime &date)
{
int ret = wxID_OK;
date_control->SetDate(date);
hour_control->SetValue(date.GetHour());
minute_control->SetValue(date.GetMinute());
current_minute = date.GetMinute();
current_second = date.GetSecond();
while( (ret = ShowModal()) == wxID_OK){
date = date_control->GetDate();
// ustawiamy godzine
date.SetHour(hour_control->GetValue());
date.SetMinute(minute_control->GetValue());
if (second_control)
date.SetSecond(second_control->GetValue());
wxDateTime tmin(time_t(0));
wxDateTime tmax(MAX_TIME_T_FOR_WX_DATE_TIME);
if (date <= tmin || date >= tmax) {
wxMessageBox(_("Invalid (too large/small) date"), _("Error!"), wxOK);
return false;
}
if (min_date == -1 && max_date == -1)
return true;
if(date.GetTicks() >= min_date && date.GetTicks() <= max_date)
return true;
else {
wxString buf;
buf = _("Please choose the date from between: ");
buf += wxDateTime(min_date).Format(_T("%Y-%m-%d %H:%M "));
buf += _("and");
buf += wxDateTime(max_date).Format(_T(" %Y-%m-%d %H:%M\n"));
wxMessageDialog *mesg = new wxMessageDialog(this, buf, _("Incorrect date range"), wxOK);
mesg->ShowModal();
delete mesg;
}
}
return false;
}
示例4: MakeDateTimeLabel
wxString otcurrentUIDialog::MakeDateTimeLabel(wxDateTime myDateTime)
{
const wxString dateLabel(myDateTime.Format( _T( "%a") ));
m_staticTextDatetime->SetLabel(dateLabel);
m_datePickerDate->SetValue(myDateTime.GetDateOnly());
m_timePickerTime->SetTime(myDateTime.GetHour(),myDateTime.GetMinute(), myDateTime.GetSecond());
return dateLabel;
}
示例5: ComputeDayTime
/* this is not actually all that accurate (no oblate earth, refraction etc...
but it's at least simple, could fix and optimize to only compute if
there are possible plans which need this */
static bool ComputeDayTime(const wxDateTime &gribtime, double lat, double lon, int &daytime)
{
if(daytime != -1)
return daytime != 0;
double yearpos = 2*M_PI*(gribtime.GetDay()-186)/365.24;
double gha = 2*M_PI*(lon/15 - gribtime.GetHour() - gribtime.GetMinute()/60)/24;
double suninc = 90*cos(deg2rad(lat))*sin(gha) + 23.45*cos(yearpos);
return (daytime = (suninc > 0)) != 0; /* sun above horizon */
}
示例6: SetStartDateTime
void ConfigurationDialog::SetStartDateTime(wxDateTime datetime)
{
if(datetime.IsValid()) {
m_dpStartDate->SetValue(datetime);
m_tStartHour->SetValue(wxString::Format(_T("%.3f"), datetime.GetHour()
+datetime.GetMinute() / 60.0));
} else {
wxMessageDialog mdlg(this, _("Invalid Date Time."),
wxString(_("Weather Routing"), wxOK | wxICON_WARNING));
mdlg.ShowModal();
}
}
示例7: SetDate
void wxMysqlPreparedStatementParameter::SetDate(const wxDateTime& dateValue)
{
m_Data.dateValue.year = dateValue.GetYear();
m_Data.dateValue.month = dateValue.GetMonth();
m_Data.dateValue.day = dateValue.GetDay();
m_Data.dateValue.hour = dateValue.GetHour();
m_Data.dateValue.minute = dateValue.GetMinute();
m_Data.dateValue.second = dateValue.GetSecond();
m_pBind->buffer_type = MYSQL_TYPE_DATETIME;
m_pBind->buffer = (void*)&m_Data.dateValue;
}
示例8:
static inline std::tm to_tm(const wxDateTime& datetime)
{
std::tm result;
result.tm_sec = datetime.GetSecond();
result.tm_min = datetime.GetMinute();
result.tm_hour = datetime.GetHour();
result.tm_mday = datetime.GetDay();
result.tm_mon = datetime.GetMonth();
result.tm_year = datetime.GetYear();
result.tm_wday = datetime.GetWeekDay();
result.tm_yday = datetime.GetDayOfYear();
result.tm_isdst= datetime.IsDST();
return result;
}
示例9:
wxOdbcParameter::wxOdbcParameter(const wxDateTime& dateValue)
{
m_nParameterType = wxOdbcParameter::PARAM_DATETIME;
m_DateValue.year = dateValue.GetYear();
m_DateValue.month = dateValue.GetMonth()+1;
m_DateValue.day = dateValue.GetDay();
m_DateValue.hour = dateValue.GetHour();
m_DateValue.minute = dateValue.GetMinute();
m_DateValue.second = dateValue.GetSecond();
m_DateValue.fraction = dateValue.GetMillisecond();
m_nBufferLength = 0;
}
示例10: memset
MysqlParameter::MysqlParameter(const wxDateTime& dateValue)
{
m_nParameterType = MysqlParameter::PARAM_DATETIME;
m_pDate = new MYSQL_TIME();
memset(m_pDate, 0, sizeof(MYSQL_TIME));
m_pDate->year = dateValue.GetYear();
m_pDate->month = dateValue.GetMonth()+1;
m_pDate->day = dateValue.GetDay();
m_pDate->hour = dateValue.GetHour();
m_pDate->minute = dateValue.GetMinute();
m_pDate->second = dateValue.GetSecond();
m_pDate->neg = 0;
m_nBufferLength = sizeof(MYSQL_TIME);
}
示例11: SendTimelineMessage
// -------------------------------------------------------
// GRIBMELINE is a misnomer
void climatology_pi::SendTimelineMessage(wxDateTime time)
{
Json::Value v;
if (time.IsValid()) {
v["Day"] = time.GetDay();
v["Month"] = time.GetMonth();
v["Year"] = time.GetYear();
v["Hour"] = time.GetHour();
v["Minute"] = time.GetMinute();
v["Second"] = time.GetSecond();
} else {
v["Day"] = -1;
v["Month"] = -1;
v["Year"] = -1;
v["Hour"] = -1;
v["Minute"] = -1;
v["Second"] = -1;
}
Json::FastWriter writer;
SendPluginMessage("GRIB_TIMELINE", writer.write( v ));
}
示例12: ConvertWxToFileTime
static void ConvertWxToFileTime(FILETIME *ft, const wxDateTime& dt)
{
SYSTEMTIME st;
st.wDay = dt.GetDay();
st.wMonth = (WORD)(dt.GetMonth() + 1);
st.wYear = (WORD)dt.GetYear();
st.wHour = dt.GetHour();
st.wMinute = dt.GetMinute();
st.wSecond = dt.GetSecond();
st.wMilliseconds = dt.GetMillisecond();
FILETIME ftLocal;
if ( !::SystemTimeToFileTime(&st, &ftLocal) )
{
wxLogLastError(_T("SystemTimeToFileTime"));
}
if ( !::LocalFileTimeToFileTime(&ftLocal, ft) )
{
wxLogLastError(_T("LocalFileTimeToFileTime"));
}
}
示例13: wxDateTime_to_AudacityTime
static double wxDateTime_to_AudacityTime(wxDateTime& dateTime)
{
return (dateTime.GetHour() * 3600.0) + (dateTime.GetMinute() * 60.0) + dateTime.GetSecond();
};
示例14: AppendDigitToCurrentField
// Append the given digit (from 0 to 9) to the current value of the current
// field.
void AppendDigitToCurrentField(int n)
{
bool moveToNextField = false;
if ( !m_isFirstDigit )
{
// The first digit simply replaces the existing field contents,
// but the second one should be combined with the previous one,
// otherwise entering 2-digit numbers would be impossible.
int currentValue = 0,
maxValue = 0;
switch ( m_currentField )
{
case Field_Hour:
currentValue = m_time.GetHour();
maxValue = 23;
break;
case Field_Min:
currentValue = m_time.GetMinute();
maxValue = 59;
break;
case Field_Sec:
currentValue = m_time.GetSecond();
maxValue = 59;
break;
case Field_AMPM:
case Field_Max:
wxFAIL_MSG( "Invalid field" );
return;
}
// Check if the new value is acceptable. If not, we just handle
// this digit as if it were the first one.
int newValue = currentValue*10 + n;
if ( newValue < maxValue )
{
n = newValue;
// If we're not on the seconds field, advance to the next one.
// This makes it more convenient to enter times as you can just
// press all digits one after one without touching the cursor
// arrow keys at all.
//
// Notice that MSW native control doesn't do this but it seems
// so useful that we intentionally diverge from it here.
moveToNextField = true;
// We entered both digits so the next one will be "first" again.
m_isFirstDigit = true;
}
}
else // First digit entered.
{
// The next one won't be first any more.
m_isFirstDigit = false;
}
switch ( m_currentField )
{
case Field_Hour:
m_time.SetHour(n);
break;
case Field_Min:
m_time.SetMinute(n);
break;
case Field_Sec:
m_time.SetSecond(n);
break;
case Field_AMPM:
case Field_Max:
wxFAIL_MSG( "Invalid field" );
return;
}
if ( moveToNextField && m_currentField < Field_Sec )
CycleCurrentField(Dir_Up);
UpdateText();
}
示例15: addTime
INLINE void wxeReturn::addTime(wxDateTime dateTime) {
addInt(dateTime.GetHour());
addInt(dateTime.GetMinute());
addInt(dateTime.GetSecond());
addTupleCount(3);
}