CContrastDLG Class Reference

#include <ContrastDLG.h>

Collaboration diagram for CContrastDLG:
Collaboration graph
[legend]

List of all members.

Public Types

enum  { IDD = IDD_CNTDLG }

Public Member Functions

 CContrastDLG (CExView *pview, BOOL rndr=TRUE, CWnd *pParent=NULL)
virtual BOOL OnInitDialog ()

Public Attributes

CExViewpView
BOOL render
int vMin
int vMax
int oMin
int oMax
int cMin
int cMax
int base
CEdit * cMaxEBox
CEdit * cMinEBox
CSliderCtrl * cMaxSldr
CSliderCtrl * cMinSldr

Protected Member Functions

virtual void DoDataExchange (CDataExchange *pDX)
afx_msg void OnChangeCntCntMin ()
afx_msg void OnChangeCntCntMax ()
virtual void OnOK ()
afx_msg void OnHScroll (UINT nSBCode, UINT nPos, CScrollBar *pScrollBar)
virtual void OnCancel ()

Detailed Description

Definition at line 29 of file ContrastDLG.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
IDD 

Definition at line 56 of file ContrastDLG.h.

00056 { IDD = IDD_CNTDLG };


Constructor & Destructor Documentation

CContrastDLG ( CExView pview,
BOOL  rndr = TRUE,
CWnd *  pParent = NULL 
)

Definition at line 29 of file ContrastDLG.cpp.

References CExDocument::base, CContrastDLG::base, CExView::cMax, CContrastDLG::cMax, CExView::cMin, CContrastDLG::cMin, CContrastDLG::oMax, CContrastDLG::oMin, CExView::pDoc, CContrastDLG::pView, CContrastDLG::render, CExView::vMax, CContrastDLG::vMax, CExView::vMin, and CContrastDLG::vMin.

00030     : CDialog(CContrastDLG::IDD, pParent)
00031 {
00032     //{{AFX_DATA_INIT(CContrastDLG)
00033         // メモ - ClassWizard はこの位置にマッピング用のマクロを追加または削除します.
00034     //}}AFX_DATA_INIT
00035 
00036     pView  = pview;
00037     render = rndr;
00038 
00039     oMin = cMin = pView->cMin;
00040     oMax = cMax = pView->cMax;
00041     vMin = pView->vMin;
00042     vMax = pView->vMax;
00043     base = pView->pDoc->base + TempBase;
00044 }


Member Function Documentation

void DoDataExchange ( CDataExchange *  pDX  )  [protected, virtual]

Definition at line 47 of file ContrastDLG.cpp.

00048 {
00049     CDialog::DoDataExchange(pDX);
00050     //{{AFX_DATA_MAP(CContrastDLG)
00051         // メモ - ClassWizard はこの位置にマッピング用のマクロを追加または削除します.
00052     //}}AFX_DATA_MAP
00053 }

void OnCancel (  )  [protected, virtual]

Definition at line 206 of file ContrastDLG.cpp.

References CExView::cMax, CExView::cMin, CExView::ExecRender(), CContrastDLG::oMax, CContrastDLG::oMin, CExView::prevSBpos, CContrastDLG::pView, CContrastDLG::render, and CExView::SetNewSurface().

00207 {
00208     CDialog::OnCancel();
00209 
00210     pView->cMax = oMax;
00211     pView->cMin = oMin;
00212 
00213     if (render) {
00214         pView->prevSBpos = -1;
00215         pView->SetNewSurface(0);
00216         pView->ExecRender();
00217     }
00218 }

Here is the call graph for this function:

void OnChangeCntCntMax (  )  [protected]

Definition at line 129 of file ContrastDLG.cpp.

References CContrastDLG::base, CExView::cMax, CContrastDLG::cMax, CContrastDLG::cMaxEBox, CContrastDLG::cMaxSldr, CContrastDLG::cMin, CExView::ExecRender(), CExView::prevSBpos, CContrastDLG::pView, CContrastDLG::render, CExView::SetNewSurface(), CContrastDLG::vMax, and CContrastDLG::vMin.

00130 {
00131     TCHAR buf[LNAME];
00132 
00133     cMaxEBox->GetWindowText(buf, LNAME);
00134     cMax = ttoi(buf) + base;
00135 
00136     //if (cMax<=vMin || cMax>vMax) {
00137     //  if (cMax>vMax)  cMax = vMax;
00138     //  if (cMax<=vMin) cMax = vMin + 1;
00139     //  if (cMax==cMin) cMax = cMin + 1;
00140     if (cMax<vMin || cMax>vMax) {
00141         if (cMax>vMax)  cMax = vMax;
00142         if (cMax<vMin)  cMax = vMin;
00143         if (cMax==cMin) cMax = cMin + 1;
00144         sntprintf(buf, LNAME, _T("%d"), cMax-base);
00145         cMaxEBox->SetWindowText(buf);
00146         cMaxEBox->UpdateWindow();
00147     }
00148 
00149     cMaxSldr->SetPos(cMax-base);
00150     pView->cMax = cMax;
00151     
00152     if (render) {
00153         pView->prevSBpos = -1;
00154         pView->SetNewSurface(0);
00155         pView->ExecRender();
00156     }
00157 }

Here is the call graph for this function:

void OnChangeCntCntMin (  )  [protected]

Definition at line 97 of file ContrastDLG.cpp.

References CContrastDLG::base, CContrastDLG::cMax, CExView::cMin, CContrastDLG::cMin, CContrastDLG::cMinEBox, CContrastDLG::cMinSldr, CExView::ExecRender(), CExView::prevSBpos, CContrastDLG::pView, CContrastDLG::render, CExView::SetNewSurface(), CContrastDLG::vMax, and CContrastDLG::vMin.

00098 {
00099     TCHAR buf[LNAME];
00100 
00101     cMinEBox->GetWindowText(buf, LNAME);
00102     cMin = ttoi(buf) + base;
00103 
00104 //  if (cMin<vMin || cMin>=vMax) {
00105 //      if (cMin<vMin)  cMin = vMin;
00106 //      if (cMin>=vMax) cMin = vMax - 1;
00107 //      if (cMin==cMax) cMin = cMax - 1;
00108     if (cMin<vMin || cMin>vMax) {
00109         if (cMin<vMin)  cMin = vMin;
00110         if (cMin>vMax)  cMin = vMax;
00111         if (cMin==cMax) cMin = cMax - 1;
00112         sntprintf(buf, LNAME, _T("%d"), cMin-base);
00113         cMinEBox->SetWindowText(buf);
00114         cMinEBox->UpdateWindow();
00115     }
00116 
00117     cMinSldr->SetPos(cMin-base);
00118     pView->cMin = cMin;
00119 
00120     if (render) {
00121         pView->prevSBpos = -1;
00122         pView->SetNewSurface(0);
00123         pView->ExecRender();
00124     }
00125 }

Here is the call graph for this function:

void OnHScroll ( UINT  nSBCode,
UINT  nPos,
CScrollBar *  pScrollBar 
) [protected]

Definition at line 161 of file ContrastDLG.cpp.

References CContrastDLG::base, CExView::cMax, CContrastDLG::cMax, CContrastDLG::cMaxEBox, CContrastDLG::cMaxSldr, CExView::cMin, CContrastDLG::cMin, CContrastDLG::cMinEBox, CContrastDLG::cMinSldr, and CContrastDLG::pView.

00162 {
00163     TCHAR buf[LNAME];
00164 
00165     if (cMaxSldr==(CSliderCtrl*)pScrollBar) {
00166         cMax= cMaxSldr->GetPos() + base;
00167         pView->cMax = cMax;
00168         sntprintf(buf, LNAME, _T("%d"), cMax-base);
00169         cMaxEBox->SetWindowText(buf);
00170         cMaxEBox->UpdateWindow();
00171     }
00172     else {  //if (cMaxSldr==(CSliderCtrl*)pScrollBar) {
00173         cMin = cMinSldr->GetPos() + base;
00174         pView->cMin = cMin;
00175         sntprintf(buf, LNAME, _T("%d"), cMin-base);
00176         cMinEBox->SetWindowText(buf);
00177         cMinEBox->UpdateWindow();
00178     }
00179 
00180     /*
00181     if (render) {
00182         pView->prevSBpos = -1;
00183         pView->SetNewSurface(0);
00184         pView->ExecRender();
00185     }*/
00186     
00187 //  CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
00188 }

BOOL OnInitDialog (  )  [virtual]

Definition at line 70 of file ContrastDLG.cpp.

References IDC_CNT_SLIDER_CNTMAX, and IDC_CNT_SLIDER_CNTMIN.

00071 {
00072     TCHAR buf[LNAME];
00073 
00074     cMinEBox = (CEdit*)GetDlgItem(IDC_CNT_CNTMIN);
00075     cMaxEBox = (CEdit*)GetDlgItem(IDC_CNT_CNTMAX);
00076     cMinSldr = (CSliderCtrl*)GetDlgItem(IDC_CNT_SLIDER_CNTMIN);
00077     cMaxSldr = (CSliderCtrl*)GetDlgItem(IDC_CNT_SLIDER_CNTMAX);
00078 
00079     cMinSldr->SetRange(vMin-base, vMax-base);
00080     cMaxSldr->SetRange(vMin-base, vMax-base);
00081     if (cMin-base==0) cMinSldr->SetPos(1);  // for スライダーバグ
00082     if (cMax-base==0) cMaxSldr->SetPos(1);  //     値が0の場合にスライダーの位置がおかしくなるバグ
00083     cMinSldr->SetPos(cMin-base);
00084     cMaxSldr->SetPos(cMax-base);
00085 
00086     sntprintf(buf, LNAME, _T("%d"), oMin-base);
00087     cMinEBox->SetWindowText(buf);
00088 
00089     sntprintf(buf, LNAME, _T("%d"), oMax-base);
00090     cMaxEBox->SetWindowText(buf);
00091 
00092     return TRUE;
00093 }

void OnOK (  )  [protected, virtual]

Definition at line 192 of file ContrastDLG.cpp.

References CExView::ExecRender(), CExView::prevSBpos, CContrastDLG::pView, CContrastDLG::render, and CExView::SetNewSurface().

00193 {
00194     // TODO: この位置にその他の検証用のコードを追加してください
00195     CDialog::OnOK();
00196 
00197     if (render) {
00198         pView->prevSBpos = -1;
00199         pView->SetNewSurface(0);
00200         pView->ExecRender();
00201     }
00202 }

Here is the call graph for this function:


Member Data Documentation

int base
int cMax
CEdit* cMaxEBox

Definition at line 40 of file ContrastDLG.h.

Referenced by CContrastDLG::OnChangeCntCntMax(), and CContrastDLG::OnHScroll().

CSliderCtrl* cMaxSldr

Definition at line 43 of file ContrastDLG.h.

Referenced by CContrastDLG::OnChangeCntCntMax(), and CContrastDLG::OnHScroll().

int cMin
CEdit* cMinEBox

Definition at line 41 of file ContrastDLG.h.

Referenced by CContrastDLG::OnChangeCntCntMin(), and CContrastDLG::OnHScroll().

CSliderCtrl* cMinSldr

Definition at line 44 of file ContrastDLG.h.

Referenced by CContrastDLG::OnChangeCntCntMin(), and CContrastDLG::OnHScroll().

int oMax

Definition at line 36 of file ContrastDLG.h.

Referenced by CContrastDLG::CContrastDLG(), and CContrastDLG::OnCancel().

int oMin

Definition at line 36 of file ContrastDLG.h.

Referenced by CContrastDLG::CContrastDLG(), and CContrastDLG::OnCancel().

BOOL render
int vMax
int vMin

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