CLogWndFrame Class Reference

#include <LogWndFrame.h>

Inheritance diagram for CLogWndFrame:
Inheritance graph
[legend]
Collaboration diagram for CLogWndFrame:
Collaboration graph
[legend]

List of all members.

Public Attributes

CLogWndDocpDoc
CLogWndViewpView

Protected Member Functions

 CLogWndFrame ()
virtual ~CLogWndFrame ()
afx_msg int OnCreate (LPCREATESTRUCT lpCreateStruct)
afx_msg void OnLogCopy ()
afx_msg void OnLogSave ()
afx_msg void OnLogClear ()

Detailed Description

Definition at line 24 of file LogWndFrame.h.


Constructor & Destructor Documentation

CLogWndFrame (  )  [protected]

Definition at line 26 of file LogWndFrame.cpp.

00027 {
00028     //"DEBUG_INFO("CONSTRUCTOR: CLogWndFrame\n");
00029 
00030     pDoc  = NULL;
00031     pView = NULL;
00032     pApp  = NULL;
00033 }

~CLogWndFrame (  )  [protected, virtual]

Definition at line 37 of file LogWndFrame.cpp.

00038 {
00039     DEBUG_INFO("DESTRUCTOR: CLogWndFrame: START\n");
00040 
00041     DEBUG_INFO("DESTRUCTOR: CLogWndFrame: END\n");
00042 }


Member Function Documentation

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:


Member Data Documentation

Reimplemented from CExTextFrame.

Definition at line 32 of file LogWndFrame.h.

Referenced by jbxwl::ExecLogWnd(), and CLogWndFrame::OnLogSave().


The documentation for this class was generated from the following files:

Generated on 15 Nov 2023 for JunkBox_Win_Lib by  doxygen 1.6.1