DateTime& DateTime::operator-=(const TimeSpan& span) throw() { ATLASSERT(m_spImpl != NULL); PrepareCopy(); m_spImpl->m_dt -= span.m_spImpl->m_span; return *this; }
TimeSpan& TimeSpan::operator/=(int iFactor) throw() { ATLASSERT(m_spImpl != NULL); PrepareCopy(); m_spImpl->m_span /= iFactor; return *this; }
TimeSpan& TimeSpan::operator-=(const TimeSpan span) throw() { ATLASSERT(m_spImpl != NULL); ATLASSERT(span.m_spImpl != NULL); PrepareCopy(); m_spImpl->m_span -= span.m_spImpl->m_span; return *this; }
void DateTime::SetDateTime(unsigned int uiYear, unsigned int uiMonth, unsigned int uiDay, unsigned int uiHour, unsigned int uiMinute, unsigned int uiSecond, unsigned int uiMillisecond) throw() { PrepareCopy(); try { m_spImpl->m_dt = boost::posix_time::ptime( boost::gregorian::date(USHORT(uiYear), USHORT(uiMonth), USHORT(uiDay)), boost::posix_time::time_duration(uiHour, uiMinute, uiSecond, uiMillisecond*1000)); } catch(...) { // illegal date/time span value m_spImpl->m_dt = boost::date_time::not_a_date_time; } }
void TimeSpan::SetDateTimeSpan(int iHours, int iMins, int iSecs, int iMillisecs) throw() { ATLASSERT(m_spImpl != NULL); PrepareCopy(); try { // note: multiplying milliseconds with 1000 here, since resolution is in microsecs m_spImpl->m_span = boost::posix_time::time_duration(iHours, iMins, iSecs, iMillisecs*1000); } catch(...) { // illegal date/time span value m_spImpl->m_span = boost::date_time::not_a_date_time; } }
void GenesisCopyWindow::MessageReceived(BMessage* message) //////////////////////////////////////////////////////////////////////// { switch(message->what) { /* case COPY_MORE: if (m_MoreCB->Value()) ResizeTo(320,180); else ResizeTo(320,140); break; */ case COPYNAME_CHANGED: if (m_SingleCopy) // Csak egy file van es akkor mind a ket mezot figyelni kell... { if (strlen(m_DirName->Text())>0 && strlen(m_FileAsName->Text())>0) m_CopyButton->SetEnabled(true); else m_CopyButton->SetEnabled(false); } else { if (strlen(m_DirName->Text())>0) m_CopyButton->SetEnabled(true); else m_CopyButton->SetEnabled(false); } break; case BUTTON_MSG_CANCELCOPY: if (find_thread("CopyThread")!=B_NAME_NOT_FOUND) // Ha mar megy a masolas... { BAlert *myAlert = new BAlert("Copy","Do you really want to abort?","No","Yes",NULL,B_WIDTH_AS_USUAL,B_OFFSET_SPACING,B_WARNING_ALERT); myAlert->SetShortcut(0, B_ESCAPE); if (myAlert->Go()==1) { kill_thread(m_CopyThread); Close(); } } else Close(); break; case BUTTON_MSG_COPY: PrepareCopy(); break; case BUTTON_MSG_PAUSECOPY: if (m_Paused) { if (resume_thread(m_CopyThread)==B_OK) { m_PauseButton->SetLabel("Pause"); m_Paused = false; } } else { if (suspend_thread(m_CopyThread)==B_OK) { m_PauseButton->SetLabel("Resume"); m_Paused = true; } } break; case BUTTON_MSG_ABORTCOPY: { BAlert *myAlert = new BAlert("Copy","Do you really want to abort?","No","Yes",NULL,B_WIDTH_AS_USUAL,B_OFFSET_SPACING,B_WARNING_ALERT); myAlert->SetShortcut(0, B_ESCAPE); if (myAlert->Go()==1) { kill_thread(m_CopyThread); Close(); } } break; default: BWindow::MessageReceived(message); } }