CExTextView Class Reference

#include <ExTextView.h>

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

List of all members.

Public Member Functions

POINT SetWindowSize (int xs, int ys, BOOL first=TRUE)
POINT GetWindowSize (POINT pt)
POINT GetClientSize (POINT pt)
POINT GetWindowReSize (POINT pt)
POINT ExecWindowReSize (int xs, int ys)
void SetTitle (LPCTSTR title)
virtual POINT GetWindowDisplaySize (POINT pt)
virtual void OnInitialUpdate ()
virtual void OnDraw (CDC *pDC)
virtual ~CExTextView ()
afx_msg BOOL OnEraseBkgnd (CDC *pDC)

Public Attributes

CDocument * pDoc
CExTextFramepFrame
CAppCallBackpApp
CString Title
RECT clientRect
double sizeXYRate
double clientRate
int xsize
int ysize
int origXSize
int origYSize
int initXSize
int initYSize
int prevXSize
int prevYSize
bool cnstSize
bool cnstXSize
bool cnstYSize
bool cnstXYRate
int maxXSize
int maxYSize
bool doReSize

Protected Member Functions

 CExTextView ()
virtual void OnActivateView (BOOL bActivate, CScrollView *pActivateView, CScrollView *pDeactiveView)
afx_msg void OnSize (UINT nType, int cx, int cy)

Protected Attributes

bool activeWin

Detailed Description

Definition at line 25 of file ExTextView.h.


Constructor & Destructor Documentation

CExTextView (  )  [protected]

Definition at line 19 of file ExTextView.cpp.

00020 {
00021     pDoc        = NULL;     //(CExDocument*)GetDocument();
00022     pFrame      = NULL;
00023     pApp        = NULL;
00024 
00025     Title       = _T("");   // ウィンドウタイトル
00026 
00027     sizeXYRate  = 1.0;
00028     clientRate  = 1.0;
00029 
00030     xsize       = 0;
00031     ysize       = 0;
00032 
00033     origXSize   = 0;
00034     origYSize   = 0;
00035     initXSize   = 0;
00036     initYSize   = 0;
00037     prevXSize   = 0;
00038     prevYSize   = 0;
00039 
00040     cnstSize    = false;
00041     cnstXSize   = false;
00042     cnstYSize   = false;
00043     cnstXYRate  = false;
00044     maxXSize    = SINTMAX;
00045     maxYSize    = SINTMAX;
00046 
00047     doReSize    = false;
00048     activeWin   = false;
00049 
00050     clientRect.bottom = 0;
00051     clientRect.top    = 0;
00052     clientRect.left   = 0;
00053     clientRect.right  = 0;
00054 }

~CExTextView (  )  [virtual]

Definition at line 58 of file ExTextView.cpp.

References CExTextView::pApp, CExTextView::pDoc, CExTextView::pFrame, CExTextFrame::pView, and CAppCallBack::ViewDestructor().

00059 {
00060     DEBUG_INFO("DESTRUCTOR: CExTextView: START\n");
00061 
00062     if (pApp!=NULL) {
00063         DEBUG_INFO("Call Application ViewDestructor()\n");
00064         pApp->ViewDestructor(this);     // 上位アプリケーションに通知
00065     }
00066 
00067     if (!isNull(pFrame)) pFrame->pView = NULL;
00068     pDoc   = NULL;
00069     pFrame = NULL;
00070 
00071     DEBUG_INFO("DESTRUCTOR: CExTextView: END\n");
00072 }

Here is the call graph for this function:


Member Function Documentation

POINT ExecWindowReSize ( int  xs,
int  ys 
)

Definition at line 217 of file ExTextView.cpp.

References CExTextView::cnstSize, CExTextView::cnstXSize, CExTextView::cnstXYRate, CExTextView::cnstYSize, CExTextView::doReSize, CExTextView::GetWindowReSize(), and CExTextView::SetWindowSize().

Referenced by CExTextView::OnDraw().

00218 {
00219     POINT pt;
00220     pt.x = cxsize;
00221     pt.y = cysize;
00222 
00223     if (doReSize) {
00224         pt = GetWindowReSize(pt);
00225         if (!cnstSize && (cnstXSize || cnstYSize || cnstXYRate)) {
00226             pt = SetWindowSize(pt.x, pt.y, FALSE);
00227         }
00228     }
00229 
00230     doReSize = false;
00231     return pt;
00232 }

Here is the call graph for this function:

Here is the caller graph for this function:

POINT GetClientSize ( POINT  pt  ) 

Definition at line 162 of file ExTextView.cpp.

References CExTextView::pFrame.

Referenced by CExTextFrame::OnSizing().

00163 {
00164     RECT  frect, crect;
00165     POINT pc;
00166 
00167     pFrame->GetWindowRect(&frect);
00168     GetClientRect(&crect);
00169     
00170     pc.x = pt.x - (frect.right -frect.left) + (crect.right -crect.left);
00171     pc.y = pt.y - (frect.bottom-frect.top)  + (crect.bottom-crect.top); 
00172     return pc;
00173 }

Here is the caller graph for this function:

virtual POINT GetWindowDisplaySize ( POINT  pt  )  [inline, virtual]

Definition at line 75 of file ExTextView.h.

00075 { return pt;}    // ウィンドウが画面に収まるように大きさを再計算する

POINT GetWindowReSize ( POINT  pt  ) 

Definition at line 177 of file ExTextView.cpp.

References CExTextView::cnstSize, CExTextView::cnstXSize, CExTextView::cnstXYRate, CExTextView::cnstYSize, jbxwl::GetMouseCursorType(), CExTextView::initXSize, CExTextView::initYSize, CExTextView::maxXSize, CExTextView::maxYSize, and CExTextView::sizeXYRate.

Referenced by CExTextView::ExecWindowReSize(), and CExTextFrame::OnSizing().

00178 {
00179     int minxs = GetSystemMetrics(SM_CXMINTRACK);
00180     int minys = GetSystemMetrics(SM_CYMINTRACK);
00181 
00182     if (pt.x<minxs) pt.x = minxs; 
00183     if (pt.y<minys) pt.y = minys;
00184 
00185 
00186     if (cnstSize) {
00187         pt.x = initXSize;
00188         pt.y = initYSize;
00189     }
00190     else if (cnstXSize || cnstYSize || cnstXYRate) {
00191         if (cnstXSize && !cnstYSize) {          // Xサイズ固定
00192             pt.x = initXSize;
00193             pt.y = Min(pt.y, maxYSize);
00194         }
00195         else if (!cnstXSize && cnstYSize) {     // Yサイズ固定
00196             pt.x = Min(pt.x, maxXSize);
00197             pt.y = initYSize;
00198         }
00199         else if (cnstXYRate) {                  // 縦横比固定
00200             TCHAR* cur = GetMouseCursorType();
00201             if (cur==IDC_SIZENS) {
00202                 pt.y = Min(pt.y, maxYSize);
00203                 pt.x = (int)(pt.y/sizeXYRate + 0.5);
00204             }
00205             else {
00206                 pt.x = Min(pt.x, maxXSize);
00207                 pt.y = (int)(pt.x*sizeXYRate + 0.5);
00208             }
00209         }
00210     }
00211 
00212     return pt;
00213 }

Here is the call graph for this function:

Here is the caller graph for this function:

POINT GetWindowSize ( POINT  pt  ) 

Definition at line 145 of file ExTextView.cpp.

References CExTextView::pFrame.

Referenced by CExTextFrame::OnSizing().

00146 {
00147     RECT  frect, crect;
00148     POINT pc;
00149 
00150     pFrame->GetWindowRect(&frect);
00151     GetClientRect(&crect);
00152     
00153     pc.x = pt.x + (frect.right -frect.left) - (crect.right -crect.left);
00154     pc.y = pt.y + (frect.bottom-frect.top)  - (crect.bottom-crect.top); 
00155     return pc;
00156 }

Here is the caller graph for this function:

void OnActivateView ( BOOL  bActivate,
CScrollView *  pActivateView,
CScrollView *  pDeactiveView 
) [protected, virtual]

Definition at line 276 of file ExTextView.cpp.

References CExTextView::activeWin.

00277 {
00278     activeWin = false;
00279     if (bActivate && pActivateView==this)  {
00280         activeWin = true;
00281     }
00282 
00283     CScrollView::OnActivateView(bActivate, pActivateView, pDeactiveView);
00284 }

void OnDraw ( CDC *  pDC  )  [virtual]

Reimplemented in CLogWndView.

Definition at line 269 of file ExTextView.cpp.

References CExTextView::clientRect, and CExTextView::ExecWindowReSize().

00270 {
00271     ExecWindowReSize(clientRect.right, clientRect.bottom);
00272 }

Here is the call graph for this function:

BOOL OnEraseBkgnd ( CDC *  pDC  ) 

Reimplemented in CLogWndView.

Definition at line 298 of file ExTextView.cpp.

00299 {
00300     return CScrollView::OnEraseBkgnd(pDC);
00301 }

void OnInitialUpdate ( void   )  [virtual]

Reimplemented in CLogWndView.

Definition at line 257 of file ExTextView.cpp.

References CExTextView::cnstSize, CExTextView::cnstXSize, CExTextView::cnstXYRate, and CExTextView::cnstYSize.

00258 {
00259     CScrollView::OnInitialUpdate();
00260 
00261     if ((cnstXSize&&cnstYSize) || (cnstXSize&&cnstXYRate) || (cnstYSize&&cnstXYRate )) {
00262         cnstSize = true;
00263         cnstXSize = cnstYSize = cnstXYRate = false;
00264     }
00265 }

void OnSize ( UINT  nType,
int  cx,
int  cy 
) [protected]

Reimplemented in CLogWndView.

Definition at line 288 of file ExTextView.cpp.

References CExTextView::clientRect, CExTextView::doReSize, and CExTextView::pFrame.

00289 {
00290     CScrollView::OnSize(nType, cx, cy);
00291 
00292     doReSize = true;
00293     if (pFrame!=NULL) GetClientRect(&clientRect);
00294 }

void SetTitle ( LPCTSTR  title  ) 

Reimplemented in CLogWndView.

Definition at line 240 of file ExTextView.cpp.

References CExTextView::pDoc, CExTextView::pFrame, CExTextFrame::Title, and CExTextView::Title.

00241 {
00242     this->Title   = title;
00243     pFrame->Title = title;
00244     pFrame->SetTitle(title);        // ルート&カレントウィンドウ
00245     pFrame->SetWindowText(title);   // カレントウィンドウ
00246     pDoc->SetTitle(title);          // ?
00247 
00248     return;
00249 }

POINT SetWindowSize ( int  xs,
int  ys,
BOOL  first = TRUE 
)

Definition at line 96 of file ExTextView.cpp.

Referenced by CExTextView::ExecWindowReSize().

00097 {
00098     POINT  pc = {-1, -1};
00099 
00100     if (cxs<0 || cys<0) return pc;
00101     pc.x = cxs;
00102     pc.y = cys;
00103 
00104     POINT pt = GetWindowSize(pc);
00105     pFrame->SetWindowPos((CWnd*)&wndTop, 0, 0, pt.x, pt.y, SWP_NOMOVE);
00106     GetClientRect(&clientRect);
00107 
00108     // サイズが合わない場合
00109     if (clientRect.right!=pc.x || clientRect.bottom!=pc.y) {
00110         if (first) {
00111             double srate = (double)clientRect.bottom/(double)clientRect.right;
00112             if (sizeXYRate<srate) {
00113                 pc.x = clientRect.right;
00114                 pc.y = (int)(pc.x*sizeXYRate+0.5);
00115             }
00116             else {
00117                 pc.y = clientRect.bottom;
00118                 pc.x = (int)(pc.y/sizeXYRate+0.5);
00119             }
00120         }
00121         else {
00122             pc.x = prevXSize;
00123             pc.y = prevYSize;
00124         }
00125         pt = GetWindowSize(pc);
00126         pFrame->SetWindowPos((CWnd*)&wndTop, 0, 0, pt.x, pt.y, SWP_NOMOVE);
00127         GetClientRect(&clientRect);
00128     }
00129             
00130     pc.x = prevXSize  = clientRect.right;
00131     pc.y = prevYSize  = clientRect.bottom;
00132     clientRate = (double)clientRect.right/(double)origXSize;
00133 
00134     if (first) {
00135         initXSize = clientRect.right;
00136         initYSize = clientRect.bottom;
00137     }
00138     return pc;
00139 }

Here is the caller graph for this function:


Member Data Documentation

bool activeWin [protected]

Definition at line 64 of file ExTextView.h.

Referenced by CExTextView::OnActivateView().

double clientRate

Definition at line 42 of file ExTextView.h.

RECT clientRect

Definition at line 40 of file ExTextView.h.

Referenced by CExTextView::OnDraw(), and CExTextView::OnSize().

bool cnstSize
bool cnstXSize
bool cnstXYRate
bool cnstYSize
bool doReSize
int initXSize

Definition at line 49 of file ExTextView.h.

Referenced by CExTextView::GetWindowReSize().

int initYSize

Definition at line 50 of file ExTextView.h.

Referenced by CExTextView::GetWindowReSize().

int maxXSize

Definition at line 58 of file ExTextView.h.

Referenced by CExTextView::GetWindowReSize().

int maxYSize

Definition at line 59 of file ExTextView.h.

Referenced by CExTextView::GetWindowReSize().

int origXSize

Definition at line 47 of file ExTextView.h.

int origYSize

Definition at line 48 of file ExTextView.h.

Definition at line 36 of file ExTextView.h.

Referenced by jbxwl::ExecLogWnd(), and CExTextView::~CExTextView().

CDocument* pDoc

Reimplemented in CLogWndView.

Definition at line 34 of file ExTextView.h.

Referenced by CExTextView::SetTitle(), and CExTextView::~CExTextView().

int prevXSize

Definition at line 51 of file ExTextView.h.

int prevYSize

Definition at line 52 of file ExTextView.h.

double sizeXYRate

Definition at line 41 of file ExTextView.h.

Referenced by CExTextView::GetWindowReSize().

CString Title

Reimplemented in CLogWndView.

Definition at line 38 of file ExTextView.h.

Referenced by CExTextView::SetTitle().

int xsize

Definition at line 44 of file ExTextView.h.

int ysize

Definition at line 45 of file ExTextView.h.


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