00001
00002
00003
00004
00005
00006 #include "stdafx.h"
00007 #include "FdmApp.h"
00008 #include "HFE_ListLog.h"
00009
00010 #ifdef _DEBUG
00011 #define new DEBUG_NEW
00012 #undef THIS_FILE
00013 static char THIS_FILE[] = __FILE__;
00014 #endif
00015
00016 CHFE_ListLog::CHFE_ListLog()
00017 {
00018 }
00019
00020 CHFE_ListLog::~CHFE_ListLog()
00021 {
00022 }
00023
00024 BEGIN_MESSAGE_MAP(CHFE_ListLog, CWnd)
00025
00026 ON_WM_CREATE()
00027 ON_WM_SIZE()
00028
00029 END_MESSAGE_MAP()
00030
00031 BOOL CHFE_ListLog::Create(CWnd *pParent)
00032 {
00033 CRect rc (0, 0, 50, 50);
00034
00035 if (FALSE == CWnd::Create (AfxRegisterWndClass (0, NULL,
00036 NULL, NULL), NULL, WS_CHILD | WS_VISIBLE, rc, pParent, 0x209121))
00037 return FALSE;
00038
00039 return TRUE;
00040 }
00041
00042 int CHFE_ListLog::OnCreate(LPCREATESTRUCT lpCreateStruct)
00043 {
00044 if (CWnd::OnCreate(lpCreateStruct) == -1)
00045 return -1;
00046
00047 m_bShowLog = _App.View_HFELog ();
00048
00049 if (!m_wndFileList.Create (this))
00050 return -1;
00051
00052 if (!m_wndLog.Create (this))
00053 return -1;
00054
00055 if (!m_wndSplitter.Create (AfxGetInstanceHandle (), m_hWnd, WST_HORIZONTAL))
00056 return -1;
00057
00058 m_wndSplitter.SetWnd1 (m_wndFileList);
00059 m_wndSplitter.SetWnd2 (m_wndLog);
00060 m_wndSplitter.SetRatio (_App.View_SplitterRatio ("HFE_FL_L"));
00061
00062 ShowLog (m_bShowLog);
00063
00064 return 0;
00065 }
00066
00067 void CHFE_ListLog::OnSize(UINT , int cx, int cy)
00068 {
00069 if (m_bShowLog)
00070 m_wndSplitter.ApplyRatio ();
00071 else
00072 m_wndFileList.MoveWindow (0, 0, cx, cy);
00073 }
00074
00075 void CHFE_ListLog::ShowLog(BOOL bShow)
00076 {
00077 UINT nShow = bShow ? SW_SHOW : SW_HIDE;
00078 m_wndLog.ShowWindow (nShow);
00079 ::ShowWindow (m_wndSplitter.m_wndSplitter, nShow);
00080
00081 m_bShowLog = bShow;
00082 _App.View_HFELog (bShow);
00083
00084 RECT rc;
00085 GetClientRect (&rc);
00086 OnSize (0, rc.right, rc.bottom);
00087 }
00088
00089 void CHFE_ListLog::SaveState()
00090 {
00091 _App.View_SplitterRatio ("HFE_FL_L", m_wndSplitter.GetRatio ());
00092 m_wndFileList.SaveState ("HFEFileList");
00093 m_wndLog.SaveState ("HFELog");
00094 }
00095
00096 void CHFE_ListLog::ApplyLanguage()
00097 {
00098 m_wndFileList.ApplyLanguage ();
00099 m_wndLog.ApplyLanguage ();
00100 }