#include <LogWndFrame.h>
Public Attributes | |
CLogWndDoc * | pDoc |
CLogWndView * | pView |
Protected Member Functions | |
CLogWndFrame () | |
virtual | ~CLogWndFrame () |
afx_msg int | OnCreate (LPCREATESTRUCT lpCreateStruct) |
afx_msg void | OnLogCopy () |
afx_msg void | OnLogSave () |
afx_msg void | OnLogClear () |
Definition at line 24 of file LogWndFrame.h.
CLogWndFrame | ( | ) | [protected] |
Definition at line 26 of file LogWndFrame.cpp.
~CLogWndFrame | ( | ) | [protected, virtual] |
Definition at line 37 of file LogWndFrame.cpp.
int OnCreate | ( | LPCREATESTRUCT | lpCreateStruct | ) | [protected] |
Definition at line 60 of file LogWndFrame.cpp.
References IDR_LOG_WND_TOOLBAR.
00061 { 00062 if (CExTextFrame::OnCreate(lpCreateStruct) == -1) return -1; 00063 00064 // ツールバーの作成 00065 // toolBar = new CExToolBar(this); 00066 toolBar = new CExToolBar(); 00067 if (!toolBar->CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP 00068 | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC | WS_CLIPCHILDREN) || 00069 !toolBar->LoadToolBar(IDR_LOG_WND_TOOLBAR)) 00070 { 00071 TRACE0("Failed to create toolbar\n"); 00072 return -1; // 作成に失敗 00073 } 00074 00075 // TODO: ツール バーをドッキング可能にしない場合は以下の3行を削除してください. 00076 toolBar->EnableDocking(CBRS_ALIGN_ANY); 00077 EnableDocking(CBRS_ALIGN_ANY); 00078 DockControlBar(toolBar); 00079 00080 return 0; 00081 }
void OnLogClear | ( | ) | [protected] |
Definition at line 133 of file LogWndFrame.cpp.
References CLogWndView::clearViewDoc(), IDS_STR_ASK_LOG_CLEAR, IDS_STR_CNFRM, and CLogWndFrame::pView.
00134 { 00135 CString mesg, noti; 00136 mesg.LoadString(IDS_STR_ASK_LOG_CLEAR); // ログをクリアしますか? 00137 noti.LoadString(IDS_STR_CNFRM); // 確認 00138 int ret = MessageBox(mesg, noti, MB_YESNO | MB_ICONQUESTION); 00139 if (ret==IDYES) pView->clearViewDoc(); 00140 }
void OnLogCopy | ( | ) | [protected] |
Definition at line 85 of file LogWndFrame.cpp.
References CLogWndView::getCopyData(), CLogWndFrame::pView, and jbxwl::ts2mbs().
00086 { 00087 CString data = pView->getCopyData(); 00088 00089 char* mbstr = ts2mbs((LPCTSTR)data); 00090 int size = (int)strlen(mbstr); 00091 if (size<=0) { 00092 ::free(mbstr); 00093 return; 00094 } 00095 00096 HGLOBAL hMem = ::GlobalAlloc(GHND, size+1); 00097 char* pszptr = (char*)::GlobalLock(hMem); 00098 memcpy(pszptr, mbstr, size+1); 00099 ::GlobalUnlock(hMem); 00100 ::free(mbstr); 00101 00102 if (!OpenClipboard()) { 00103 ::GlobalFree(hMem); 00104 DEBUG_ERROR("CLogWndFrame::OnLogCopy(): ERROR: Clipboad open error!!\n"); 00105 return; 00106 } 00107 00108 EmptyClipboard(); 00109 SetClipboardData(CF_TEXT, hMem); 00110 CloseClipboard(); 00111 ::GlobalFree(hMem); 00112 00113 return; 00114 }
void OnLogSave | ( | ) | [protected] |
Definition at line 118 of file LogWndFrame.cpp.
References CLogWndDoc::easyGetSaveFileName(), IDS_STR_ERR_WRITE_FILE, IDS_STR_ERROR, IDS_STR_SPECIFY_SAVE_FILE, jbxwl::MessageBoxDLG(), CLogWndFrame::pDoc, CLogWndFrame::pView, CLogWndDoc::save_fname, and CLogWndDoc::writeLogFile().
00119 { 00120 if (pDoc->save_fname==_T("")) { 00121 CString mesg; 00122 mesg.LoadString(IDS_STR_SPECIFY_SAVE_FILE); // 保存用ファイルを指定する 00123 pDoc->save_fname = pDoc->easyGetSaveFileName(mesg, pView->m_hWnd); 00124 } 00125 if (pDoc->save_fname==_T("")) return; 00126 int ret = pDoc->writeLogFile(); 00127 00128 if (ret<0) MessageBoxDLG(IDS_STR_ERROR, IDS_STR_ERR_WRITE_FILE, MB_OK, NULL); // ファイルの書き込みに失敗しました 00129 }
Reimplemented from CExTextFrame.
Definition at line 32 of file LogWndFrame.h.
Referenced by jbxwl::ExecLogWnd(), and CLogWndFrame::OnLogSave().
Reimplemented from CExTextFrame.
Definition at line 33 of file LogWndFrame.h.
Referenced by jbxwl::ExecLogWnd(), CLogWndFrame::OnLogClear(), CLogWndFrame::OnLogCopy(), and CLogWndFrame::OnLogSave().