일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
- tiktak
- 서태지
- 간헐적 단식
- 세계 문화 유산
- 안성 나드리 추천
- 티스토리 초대권
- 2009년 서울 모터쇼
- 메모리
- 평택시
- 안성
- 평택 가볼만한 곳
- 화성
- 한국 문화유산
- 탈모 치료
- 서태지 8집
- 용인 남곡
- 티스토리 초대장
- 안성 가볼만한 곳
- 서울 모터쇼
- 혈압
- 모아이
- 수원성
- round button
- 단식
- 세계 문화유산
- 틱탁
- 유네스코
- 차크닉
- Ram
- 올바른 자세
- Today
- Total
Value of Life
codeprject round slider control 본문
I needed a round slider control to let my users enter an angle. I thought this could be useful to others, so I wrote a general class for it using some of the functions from Chris Maunder's CRoundButton class.
To use, simply add a slider to your dialog. Enlarge it until it covers an approximately square area.
In your dialog class, associate a control variable (say m_rscMySlider
), with the slider. If you have told class wizard about CRoundSliderCtrl
, you will be able to select it when you define the control variable. If not, just go for CSliderCtrl
and manually edit the definition in your dialog header file, changing CSliderCtrl
to CRoundSliderCtrl
. If you do not like using DDX then you can just subclass the control.
In OnInitDialog()
you would call SetRange()
, SetPos()
, etc. to customize the look and feel of the round slider control. The full API of the control is as follows:
// You may use '%ld' to show the slider value. Default: "%ld°" virtual void SetText(const CString& strNewText); virtual CString GetText() const; // Default: 7, Minimum: 5 virtual void SetKnobRadius(const int nNewKnobRadius); virtual int GetKnobRadius() const; virtual void SetDragByKnobOnly(const bool bDragByKnobOnly); virtual bool GetDragByKnobOnly() const; // 0-359, 0 = Top, 90 = Right, 180 = Bottom, 270 = Left virtual void SetZero(const int nZero); virtual int GetZero() const; // CW/CCW virtual void SetInverted(const bool bNewInverted = true); virtual bool GetInverted() const; virtual void SetRadioButtonStyle(const bool bNewRadioButtonStyle = true); virtual bool GetRadioButtonStyle() const; virtual void SetDialColor(const COLORREF crBkgnd); virtual void SetKnobColor(const COLORREF crBkgnd); virtual void SetTextColor(const COLORREF crText); virtual void SetFontBold(const bool bSet = true); virtual void SetFontUnderline(const bool bSet = true); virtual void SetFontItalic(const bool bSet = true); virtual void SetFontSize(const int nSize); virtual void SetFontName(const CString& strFont);
'IT > MFC' 카테고리의 다른 글
AquaButton: A sample custom button control with a Mac OS X look (0) | 2008.08.12 |
---|---|
CxSkinbutton (0) | 2008.08.11 |
codeproject round button (0) | 2008.08.10 |
Round Button Control - mfc 아님 (0) | 2008.08.10 |
MFC 버튼에 BMP넣는 두가지 방법 (1) | 2008.08.10 |