00001 
00002 
00003 
00004 
00005 #include  "ExTextFrame.h"
00006 
00007 
00008 using namespace jbxwl;
00009 
00010 
00012 
00013 
00014 IMPLEMENT_DYNCREATE(CExTextFrame, CMDIChildWnd)
00015 
00016 CExTextFrame::CExTextFrame()
00017 {
00018     
00019 
00020     pDoc        = NULL;
00021     pView       = NULL;
00022     pApp        = NULL;
00023     pTempl      = NULL;
00024 
00025     toolBar     = NULL;
00026 
00027     Title       = _T("");
00028     preTitle    = _T("");
00029 
00030     cancelOperation  = false;
00031     doneErrorMessage = false;
00032 
00033     reSizeMoving     = false;
00034 }
00035 
00036 
00037 
00038 CExTextFrame::~CExTextFrame()
00039 {
00040     DEBUG_INFO("DESTRUCTOR: CExTextFrame: START\n");
00041 
00042     if (pApp!=NULL) {
00043         DEBUG_INFO("Call Application FrameDestructor()\n");
00044         pApp->FrameDestructor(this);    
00045     }
00046 
00047     if (!isNull(pView)) pView->pFrame = NULL;
00048     pView = NULL;
00049     pDoc  = NULL;
00050 
00051     DEBUG_INFO("DESTRUCTOR: CExTextFrame: END\n");
00052 }
00053 
00054 
00055 
00056 
00057 
00058 
00059 BEGIN_MESSAGE_MAP(CExTextFrame, CMDIChildWnd)
00060     
00061     
00062 
00063 #ifdef ON_WM_ENTERSIZEMOVE
00064     ON_WM_ENTERSIZEMOVE()
00065     ON_WM_EXITSIZEMOVE()
00066 #else
00067     ON_MESSAGE(WM_ENTERSIZEMOVE, OnEnterSizeMove)
00068     ON_MESSAGE(WM_EXITSIZEMOVE,  OnExitSizeMove)
00069 #endif
00070     ON_WM_ERASEBKGND()
00071     ON_WM_SIZING()
00072     ON_WM_MOVE()
00073 END_MESSAGE_MAP()
00074 
00075 
00076 
00078 
00079 
00080 BOOL  CExTextFrame::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CMDIFrameWnd* pParentWnd, CCreateContext* pContext) 
00081 {
00082     dwStyle = dwStyle | WS_CLIPCHILDREN;
00083     dwStyle = dwStyle & (~WS_MAXIMIZEBOX);  
00084     return CMDIChildWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, pContext);
00085 }
00086 
00087 
00088 
00089 #ifdef ON_WM_ENTERSIZEMOVE
00090 
00091 void  CExTextFrame::OnEnterSizeMove()
00092 {
00093     CMDIChildWnd::OnEnterSizeMove();
00094     reSizeMoving = true;
00095 }
00096 
00097 
00098 void  CExTextFrame::OnExitSizeMove()
00099 {
00100     CMDIChildWnd::OnExitSizeMove();
00101     reSizeMoving = false;
00102 }
00103 
00104 
00105 #else
00106 
00107 
00108 LRESULT CExTextFrame::OnEnterSizeMove(WPARAM wParam, LPARAM lParam)
00109 {
00110     reSizeMoving = true;
00111     return 0;
00112 }
00113 
00114 
00115 LRESULT CExTextFrame::OnExitSizeMove(WPARAM wParam, LPARAM lParam)
00116 {
00117     reSizeMoving = false;
00118     return 0;
00119 }
00120 
00121 #endif
00122 
00123 
00124 
00125 BOOL  CExTextFrame::OnEraseBkgnd(CDC* pDC)
00126 {
00127     
00128     return CMDIChildWnd::OnEraseBkgnd(pDC);
00129 }
00130 
00131 
00132 
00133 void  CExTextFrame::OnSizing(UINT fwSide, LPRECT pRect)
00134 {
00135     POINT pt;
00136     pt.x = pRect->right - pRect->left;
00137     pt.y = pRect->bottom - pRect->top;
00138 
00139     pt = pView->GetClientSize(pt);
00140     pt = pView->GetWindowReSize(pt);
00141     pt = pView->GetWindowSize(pt);
00142 
00143     pRect->right  = pRect->left + pt.x;
00144     pRect->bottom = pRect->top  + pt.y;
00145     CMDIChildWnd::OnSizing(fwSide, pRect);
00146 
00147     pView->doReSize = true;
00148 }
00149 
00150 
00151 
00152 void  CExTextFrame::OnMove(int x, int y)
00153 {
00154     CMDIChildWnd::OnMove(x, y);
00155 
00156     
00157     this->OnPaint();
00158 }
00159