00001
00020 #ifndef INC_MGUI_DLGVIEWLOG_H
00021 #define INC_MGUI_DLGVIEWLOG_H
00022
00023 #ifndef INC_MGUI_DLGSHELL_H
00024 #include <mgui/dlgshell.h>
00025 #endif
00026
00027 #ifndef INC_MGUI_GRID_H
00028 #include <mgui/grid.h>
00029 #endif
00030
00031 #ifndef INC_MGUI_FORMBTXT_H
00032 #include <mgui/formbtxt.h>
00033 #endif
00034
00035 #ifndef INC_MI32_FILEPATH_H
00036 #include <mi32/filepath.h>
00037 #endif
00038
00039 #include <vector>
00040
00041 namespace MGUI {
00042
00045 class DLG_VIEWLOG : public MGUI::DLGSHELL {
00046 public:
00048 DLG_VIEWLOG (
00049 );
00050
00052 DLG_VIEWLOG (
00053 const MISTRING &title
00054 );
00055
00057 ERRVALUE SetLogPath(
00058 const FILEPATH &logfile
00059 );
00060
00061 #ifndef GENERATING_DOXYGEN_OUTPUT
00062 private:
00063 typedef DLG_VIEWLOG THISCLASS;
00064
00065 struct LOGRECORD {
00066 MISTRING date;
00067 MISTRING runtime;
00068 MISTRING pid;
00069 MISTRING process;
00070 MISTRING description;
00071 int recnum;
00072 bool highlighted;
00073 };
00074
00075 CTRL_GRID m_LogGrid;
00076 CTRL_PUSHBUTTON m_SysInfoButton;
00077 FORM_BUTTONTEXT m_FormSelectFile;
00078
00079 std::vector<LOGRECORD> m_records;
00080 FILEPATH m_CurrLogPath;
00081 MISTRING m_SysInfo;
00082 int m_OrderedColumn;
00083 bool m_OrderAscending;
00084
00085 void OnClickItem(int itemnum, int column, KEYSTATE state);
00086 void OnColumnClick(int row, int column, KEYSTATE keystate);
00087 bool OnCustomDraw(CTRL_GRID::CUSTOMDRAW &draw);
00088 int OnItemCompare(UINT32 row1, UINT32 row2, int col, bool Ascending);
00089 void OnSelectLogFile();
00090 void OnShowSysInfo();
00091 ERRVALUE ReadLogFile(MISTRING &longestdesc);
00092 ERRVALUE UpdateGrid();
00093 void UpdateHighlighted(bool force = 0, int itemnumselected=-1);
00094 ERRVALUE v_CreateContent();
00095 #endif
00096 };
00097
00098 }
00099 #endif