Dreamine.UI.WinForms 1.0.1
Dreamine.UI.WinForms 사용자 인터페이스 기능과 구성 요소를 제공합니다.
로딩중...
검색중...
일치하는것 없음
Dreamine.UI.WinForms.Controls.DreamineRadioButton 클래스 참조

더 자세히 ...

Dreamine.UI.WinForms.Controls.DreamineRadioButton에 대한 상속 다이어그램 :
Dreamine.UI.WinForms.Controls.DreamineRadioButton에 대한 협력 다이어그램:

Public 멤버 함수

 DreamineRadioButton ()

Protected 멤버 함수

override void OnMouseEnter (EventArgs e)
override void OnMouseLeave (EventArgs e)
override void OnMouseUp (MouseEventArgs e)
override void OnPaint (PaintEventArgs e)

속성

bool IsChecked [get, set]
string Content [get, set]
string GroupName = string.Empty [get, set]
override Size DefaultSize [get]

이벤트

EventHandler? CheckedChanged

Private 멤버 함수

void UncheckSiblings ()

Private 속성

bool _isHover
bool _isChecked
string _content = string.Empty

정적 Private 속성

const int BulletSize = 16
const int BulletMargin = 2

상세한 설명

그룹 이름 기반 상호 배타 선택과 사용자 지정 그리기를 제공하는 WinForms 라디오 버튼입니다.

DreamineRadioButton.cs 파일의 15 번째 라인에서 정의되었습니다.

생성자 & 소멸자 문서화

◆ DreamineRadioButton()

Dreamine.UI.WinForms.Controls.DreamineRadioButton.DreamineRadioButton ( )
inline

사용자 지정 그리기 스타일과 Dreamine 테마 기본값을 구성합니다.

DreamineRadioButton.cs 파일의 127 번째 라인에서 정의되었습니다.

128 {
129 SetStyle(
130 ControlStyles.AllPaintingInWmPaint |
131 ControlStyles.UserPaint |
132 ControlStyles.DoubleBuffer |
133 ControlStyles.ResizeRedraw |
134 ControlStyles.SupportsTransparentBackColor, true);
135
136 BackColor = Color.Transparent;
137 ForeColor = DreamineTheme.TextPrimary;
138 Font = new Font("Segoe UI", 10f, FontStyle.Regular, GraphicsUnit.Point);
139 Height = 24;
140 Cursor = Cursors.Hand;
141 }

다음을 참조함 : Dreamine.UI.WinForms.DreamineTheme.TextPrimary.

다음에 의해서 참조됨 : UncheckSiblings().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

멤버 함수 문서화

◆ OnMouseEnter()

override void Dreamine.UI.WinForms.Controls.DreamineRadioButton.OnMouseEnter ( EventArgs e)
inlineprotected

포인터 진입 상태를 기록하고 다시 그리도록 요청합니다.

매개변수
e마우스 이벤트 인수입니다.

DreamineRadioButton.cs 파일의 159 번째 라인에서 정의되었습니다.

159{ base.OnMouseEnter(e); _isHover = true; Invalidate(); }

다음을 참조함 : _isHover.

◆ OnMouseLeave()

override void Dreamine.UI.WinForms.Controls.DreamineRadioButton.OnMouseLeave ( EventArgs e)
inlineprotected

포인터 진입 상태를 해제하고 다시 그리도록 요청합니다.

매개변수
e마우스 이벤트 인수입니다.

DreamineRadioButton.cs 파일의 176 번째 라인에서 정의되었습니다.

176{ base.OnMouseLeave(e); _isHover = false; Invalidate(); }

다음을 참조함 : _isHover.

◆ OnMouseUp()

override void Dreamine.UI.WinForms.Controls.DreamineRadioButton.OnMouseUp ( MouseEventArgs e)
inlineprotected

활성 컨트롤 안에서 왼쪽 버튼을 놓으면 이 항목을 선택합니다.

매개변수
e마우스 버튼 이벤트 인수입니다.

DreamineRadioButton.cs 파일의 194 번째 라인에서 정의되었습니다.

195 {
196 base.OnMouseUp(e);
197 if (Enabled && e.Button == MouseButtons.Left && ClientRectangle.Contains(e.Location))
198 IsChecked = true;
199 }

다음을 참조함 : IsChecked.

◆ OnPaint()

override void Dreamine.UI.WinForms.Controls.DreamineRadioButton.OnPaint ( PaintEventArgs e)
inlineprotected

현재 선택, 호버 및 활성 상태에 맞게 원, 점과 라벨을 그립니다.

매개변수
e컨트롤 그리기 이벤트 인수입니다.

DreamineRadioButton.cs 파일의 240 번째 라인에서 정의되었습니다.

241 {
242 var g = e.Graphics;
243 g.SmoothingMode = SmoothingMode.AntiAlias;
244
245 int x = BulletMargin, y = (Height - BulletSize) / 2;
246 var bulletRect = new Rectangle(x, y, BulletSize, BulletSize);
247
248 // Outer circle
249 var borderColor = _isChecked || _isHover ? DreamineTheme.BorderFocus : DreamineTheme.BorderNormal;
250 using var bgBrush = new SolidBrush(_isChecked ? DreamineTheme.AccentBlue : DreamineTheme.InputBackground);
251 using var borderPen = new Pen(borderColor, 1.5f);
252 g.FillEllipse(bgBrush, bulletRect);
253 g.DrawEllipse(borderPen, new Rectangle(x, y, BulletSize - 1, BulletSize - 1));
254
255 // Inner dot
256 if (_isChecked)
257 {
258 int dotSize = 6, dotX = x + (BulletSize - dotSize) / 2, dotY = y + (BulletSize - dotSize) / 2;
259 using var dotBrush = new SolidBrush(Color.White);
260 g.FillEllipse(dotBrush, dotX, dotY, dotSize, dotSize);
261 }
262
263 // Label
264 using var brush = new SolidBrush(Enabled ? ForeColor : DreamineTheme.TextSecondary);
265 int textX = BulletMargin + BulletSize + 6;
266 var sf = new StringFormat { LineAlignment = StringAlignment.Center };
267 g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
268 g.DrawString(_content, Font, brush, new Rectangle(textX, 0, Width - textX, Height), sf);
269 }

다음을 참조함 : _content, _isChecked, _isHover, Dreamine.UI.WinForms.DreamineTheme.AccentBlue, Dreamine.UI.WinForms.DreamineTheme.BorderFocus, Dreamine.UI.WinForms.DreamineTheme.BorderNormal, BulletMargin, BulletSize, Dreamine.UI.WinForms.DreamineTheme.InputBackground, Dreamine.UI.WinForms.DreamineTheme.TextSecondary.

◆ UncheckSiblings()

void Dreamine.UI.WinForms.Controls.DreamineRadioButton.UncheckSiblings ( )
inlineprivate

같은 부모와 그룹 이름을 가진 다른 선택 항목을 해제합니다.

DreamineRadioButton.cs 파일의 209 번째 라인에서 정의되었습니다.

210 {
211 if (Parent == null || string.IsNullOrEmpty(GroupName)) return;
212 foreach (Control c in Parent.Controls)
213 {
214 if (c != this && c is DreamineRadioButton rb &&
215 rb.GroupName == GroupName && rb.IsChecked)
216 {
217 rb._isChecked = false;
218 rb.Invalidate();
219 rb.CheckedChanged?.Invoke(rb, EventArgs.Empty);
220 }
221 }
222 }

다음을 참조함 : DreamineRadioButton(), GroupName.

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

멤버 데이터 문서화

◆ _content

string Dreamine.UI.WinForms.Controls.DreamineRadioButton._content = string.Empty
private

content 값을 보관합니다.

DreamineRadioButton.cs 파일의 65 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : OnPaint().

◆ _isChecked

bool Dreamine.UI.WinForms.Controls.DreamineRadioButton._isChecked
private

is Checked 값을 보관합니다.

DreamineRadioButton.cs 파일의 34 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : OnPaint().

◆ _isHover

bool Dreamine.UI.WinForms.Controls.DreamineRadioButton._isHover
private

is Hover 값을 보관합니다.

DreamineRadioButton.cs 파일의 25 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : OnMouseEnter(), OnMouseLeave(), OnPaint().

◆ BulletMargin

const int Dreamine.UI.WinForms.Controls.DreamineRadioButton.BulletMargin = 2
staticprivate

Bullet Margin 값을 보관합니다.

DreamineRadioButton.cs 파일의 117 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : OnPaint().

◆ BulletSize

const int Dreamine.UI.WinForms.Controls.DreamineRadioButton.BulletSize = 16
staticprivate

Bullet Size 값을 보관합니다.

DreamineRadioButton.cs 파일의 108 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : OnPaint().

속성 문서화

◆ Content

string Dreamine.UI.WinForms.Controls.DreamineRadioButton.Content
getset

선택 원 옆에 그릴 텍스트를 가져오거나 설정합니다.

DreamineRadioButton.cs 파일의 74 번째 라인에서 정의되었습니다.

75 {
76 get => _content;
77 set { _content = value; Invalidate(); }
78 }

◆ DefaultSize

override Size Dreamine.UI.WinForms.Controls.DreamineRadioButton.DefaultSize
getprotected

라디오 버튼의 기본 크기를 가져옵니다.

DreamineRadioButton.cs 파일의 279 번째 라인에서 정의되었습니다.

◆ GroupName

string Dreamine.UI.WinForms.Controls.DreamineRadioButton.GroupName = string.Empty
getset

상호 배타 선택에 사용할 그룹 이름을 가져오거나 설정합니다.

DreamineRadioButton.cs 파일의 88 번째 라인에서 정의되었습니다.

88{ get; set; } = string.Empty;

다음에 의해서 참조됨 : UncheckSiblings().

◆ IsChecked

bool Dreamine.UI.WinForms.Controls.DreamineRadioButton.IsChecked
getset

라디오 버튼이 선택되어 있는지 여부를 가져오거나 설정합니다.

DreamineRadioButton.cs 파일의 44 번째 라인에서 정의되었습니다.

45 {
46 get => _isChecked;
47 set
48 {
49 if (_isChecked == value) return;
50 _isChecked = value;
51 Invalidate();
52 if (value) UncheckSiblings();
53 CheckedChanged?.Invoke(this, EventArgs.Empty);
54 }
55 }

다음에 의해서 참조됨 : OnMouseUp().

이벤트 문서화

◆ CheckedChanged

EventHandler? Dreamine.UI.WinForms.Controls.DreamineRadioButton.CheckedChanged

선택 상태가 실제로 변경될 때 발생합니다.

DreamineRadioButton.cs 파일의 98 번째 라인에서 정의되었습니다.


이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: