Reimplemented from OglGui::WindowTimeLine. Definition at line 31 of file UnixTimeLine.h. References Impala::MakeString(), OglGui::OglWindow::mOglWnd, OglGui::ZoomShiftRuler::mTextColor, OglGui::ZoomShiftRuler::mTextShaded, OglGui::ZoomShiftRuler::mTextShadowBg, and OglGui::ZoomShiftRuler::mTextShadowFg. 00032 { 00033 DrawLine(x, y-tickLen, x, y); 00034 00035 std::string months[] = {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"}; 00036 time_t span = tickSpan; 00037 time_t timet = time; 00038 tm dateSpan = *localtime(&span); 00039 tm* dateTm = localtime(&timet); 00040 std::string txt; 00041 if(dateSpan.tm_year > 70 || dateSpan.tm_mon > 6) 00042 txt = MakeString(dateTm->tm_year+1900); 00043 else if(dateSpan.tm_yday > 20) 00044 txt = months[dateTm->tm_mon] + " " 00045 + MakeString(dateTm->tm_year+1900); 00046 else if(dateSpan.tm_yday > 0 || dateSpan.tm_hour > 3 || 00047 (dateTm->tm_hour < dateSpan.tm_hour)) 00048 txt = months[dateTm->tm_mon] + " " 00049 + MakeString(dateTm->tm_mday); 00050 else 00051 txt = MakeString(dateTm->tm_hour) + ":" 00052 + ((dateTm->tm_min < 10) ? "0" : "") 00053 + MakeString(dateTm->tm_min); 00054 00055 int txtY = y - tickLen - 10; 00056 int txtX = x - ((x<15) ? 2 : 15); 00057 00058 if (!mTextShaded) 00059 oglSys.PosColPrintf(mOglWnd, txtX, txtY, mTextColor, txt.c_str()); 00060 else 00061 oglSys.ShadowPrintf(mOglWnd, txtX, txtY, mTextShadowBg, 00062 mTextShadowFg, txt.c_str()); 00063 }
Here is the call graph for this function:
|