JunkBox_Win_Lib 1.5.3
Loading...
Searching...
No Matches
CContrastDLG Class Reference

#include <ContrastDLG.h>

Inheritance diagram for CContrastDLG:
Collaboration diagram for CContrastDLG:

Public Types

enum  { IDD = IDD_CNTDLG }
 

Public Member Functions

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

Public Attributes

CExView * pView
 
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.

56{ IDD = IDD_CNTDLG };
#define IDD_CNTDLG
Definition resource.h:9

Constructor & Destructor Documentation

◆ CContrastDLG()

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

Definition at line 29 of file ContrastDLG.cpp.

30 : CDialog(CContrastDLG::IDD, pParent)
31{
32 //{{AFX_DATA_INIT(CContrastDLG)
33 // メモ - ClassWizard はこの位置にマッピング用のマクロを追加または削除します.
34 //}}AFX_DATA_INIT
35
36 pView = pview;
37 render = rndr;
38
39 oMin = cMin = pView->cMin;
40 oMax = cMax = pView->cMax;
41 vMin = pView->vMin;
42 vMax = pView->vMax;
44}
CExDocument * pDoc
Definition ExView.h:76

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

Member Function Documentation

◆ DoDataExchange()

void DoDataExchange ( CDataExchange * pDX)
protectedvirtual

Definition at line 47 of file ContrastDLG.cpp.

48{
49 CDialog::DoDataExchange(pDX);
50 //{{AFX_DATA_MAP(CContrastDLG)
51 // メモ - ClassWizard はこの位置にマッピング用のマクロを追加または削除します.
52 //}}AFX_DATA_MAP
53}

◆ OnCancel()

void OnCancel ( )
protectedvirtual

Definition at line 206 of file ContrastDLG.cpp.

207{
208 CDialog::OnCancel();
209
210 pView->cMax = oMax;
211 pView->cMin = oMin;
212
213 if (render) {
214 pView->prevSBpos = -1;
216 pView->ExecRender();
217 }
218}
virtual void ExecRender()
Definition ExView.h:144
virtual BOOL SetNewSurface(int ovsbpos=0)
Definition ExView.h:141

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

Here is the call graph for this function:

◆ OnChangeCntCntMax()

void OnChangeCntCntMax ( )
protected

Definition at line 129 of file ContrastDLG.cpp.

130{
131 TCHAR buf[LNAME];
132
133 cMaxEBox->GetWindowText(buf, LNAME);
134 cMax = ttoi(buf) + base;
135
136 //if (cMax<=vMin || cMax>vMax) {
137 // if (cMax>vMax) cMax = vMax;
138 // if (cMax<=vMin) cMax = vMin + 1;
139 // if (cMax==cMin) cMax = cMin + 1;
141 if (cMax>vMax) cMax = vMax;
142 if (cMax<vMin) cMax = vMin;
143 if (cMax==cMin) cMax = cMin + 1;
144 sntprintf(buf, LNAME, _T("%d"), cMax-base);
145 cMaxEBox->SetWindowText(buf);
146 cMaxEBox->UpdateWindow();
147 }
148
149 cMaxSldr->SetPos(cMax-base);
150 pView->cMax = cMax;
151
152 if (render) {
153 pView->prevSBpos = -1;
155 pView->ExecRender();
156 }
157}
CSliderCtrl * cMaxSldr
Definition ContrastDLG.h:43

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

Here is the call graph for this function:

◆ OnChangeCntCntMin()

void OnChangeCntCntMin ( )
protected

Definition at line 97 of file ContrastDLG.cpp.

98{
99 TCHAR buf[LNAME];
100
101 cMinEBox->GetWindowText(buf, LNAME);
102 cMin = ttoi(buf) + base;
103
104// if (cMin<vMin || cMin>=vMax) {
105// if (cMin<vMin) cMin = vMin;
106// if (cMin>=vMax) cMin = vMax - 1;
107// if (cMin==cMax) cMin = cMax - 1;
109 if (cMin<vMin) cMin = vMin;
110 if (cMin>vMax) cMin = vMax;
111 if (cMin==cMax) cMin = cMax - 1;
112 sntprintf(buf, LNAME, _T("%d"), cMin-base);
113 cMinEBox->SetWindowText(buf);
114 cMinEBox->UpdateWindow();
115 }
116
117 cMinSldr->SetPos(cMin-base);
118 pView->cMin = cMin;
119
120 if (render) {
121 pView->prevSBpos = -1;
123 pView->ExecRender();
124 }
125}
CSliderCtrl * cMinSldr
Definition ContrastDLG.h:44

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

Here is the call graph for this function:

◆ OnHScroll()

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

Definition at line 161 of file ContrastDLG.cpp.

162{
163 TCHAR buf[LNAME];
164
166 cMax= cMaxSldr->GetPos() + base;
167 pView->cMax = cMax;
168 sntprintf(buf, LNAME, _T("%d"), cMax-base);
169 cMaxEBox->SetWindowText(buf);
170 cMaxEBox->UpdateWindow();
171 }
172 else { //if (cMaxSldr==(CSliderCtrl*)pScrollBar) {
173 cMin = cMinSldr->GetPos() + base;
174 pView->cMin = cMin;
175 sntprintf(buf, LNAME, _T("%d"), cMin-base);
176 cMinEBox->SetWindowText(buf);
177 cMinEBox->UpdateWindow();
178 }
179
180 /*
181 if (render) {
182 pView->prevSBpos = -1;
183 pView->SetNewSurface(0);
184 pView->ExecRender();
185 }*/
186
187// CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
188}

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

◆ OnInitDialog()

BOOL OnInitDialog ( )
virtual

Definition at line 70 of file ContrastDLG.cpp.

71{
72 TCHAR buf[LNAME];
73
78
79 cMinSldr->SetRange(vMin-base, vMax-base);
80 cMaxSldr->SetRange(vMin-base, vMax-base);
81 if (cMin-base==0) cMinSldr->SetPos(1); // for スライダーバグ
82 if (cMax-base==0) cMaxSldr->SetPos(1); // 値が0の場合にスライダーの位置がおかしくなるバグ
83 cMinSldr->SetPos(cMin-base);
84 cMaxSldr->SetPos(cMax-base);
85
86 sntprintf(buf, LNAME, _T("%d"), oMin-base);
87 cMinEBox->SetWindowText(buf);
88
89 sntprintf(buf, LNAME, _T("%d"), oMax-base);
90 cMaxEBox->SetWindowText(buf);
91
92 return TRUE;
93}
#define IDC_CNT_SLIDER_CNTMAX
Definition resource.h:23
#define IDC_CNT_CNTMAX
Definition resource.h:24
#define IDC_CNT_SLIDER_CNTMIN
Definition resource.h:25
#define IDC_CNT_CNTMIN
Definition resource.h:26

References IDC_CNT_CNTMAX, IDC_CNT_CNTMIN, IDC_CNT_SLIDER_CNTMAX, and IDC_CNT_SLIDER_CNTMIN.

◆ OnOK()

void OnOK ( )
protectedvirtual

Definition at line 192 of file ContrastDLG.cpp.

193{
194 // TODO: この位置にその他の検証用のコードを追加してください
195 CDialog::OnOK();
196
197 if (render) {
198 pView->prevSBpos = -1;
200 pView->ExecRender();
201 }
202}

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

Here is the call graph for this function:

Member Data Documentation

◆ base

◆ cMax

◆ cMaxEBox

CEdit* cMaxEBox

Definition at line 40 of file ContrastDLG.h.

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

◆ cMaxSldr

CSliderCtrl* cMaxSldr

Definition at line 43 of file ContrastDLG.h.

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

◆ cMin

◆ cMinEBox

CEdit* cMinEBox

Definition at line 41 of file ContrastDLG.h.

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

◆ cMinSldr

CSliderCtrl* cMinSldr

Definition at line 44 of file ContrastDLG.h.

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

◆ oMax

int oMax

Definition at line 36 of file ContrastDLG.h.

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

◆ oMin

int oMin

Definition at line 36 of file ContrastDLG.h.

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

◆ pView

◆ render

◆ vMax

◆ vMin


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