Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Button.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Button.ab	(revision 638)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Button.ab	(revision 642)
@@ -1,5 +1,5 @@
 'Classes/ActiveBasic/Windows/UI/Button.ab
 
-#require <Classes/ActiveBasic/Windows/UI/Control.ab>
+#require <Classes/ActiveBasic/Windows/UI/ButtonBase.ab>
 
 Namespace ActiveBasic
@@ -13,32 +13,11 @@
 */
 Class Button
-	Inherits WmCommandControl
+	Inherits ButtonBase
 Protected
 	Override Sub GetCreateStruct(ByRef cs As CREATESTRUCT)
-		With cs
-			.lpszClass = "BUTTON"
-			.style Or= BS_PUSHBUTTON
-		End With
+		Super.GetCreateStruct(cs)
+		cs.style Or= BS_PUSHBUTTON
 	End Sub
 Public
-	Sub RaiseClick()
-		OnClick(Args.Empty)
-	End Sub
-
-	Override Function RaiseCommandEvent(notificationCode As Word) As Boolean
-		Dim lr As LRESULT
-		RaiseCommandEvent = False
-		Select Case notificationCode
-			Case BN_CLICKED
-				RaiseCommandEvent = OnClick(Args.Empty)
-			Case BN_DBLCLK
-				RaiseCommandEvent = OnDoubleClick(Args.Empty)
-			Case BN_SETFOCUS
-				RaiseCommandEvent = ProcessMessage(WM_SETFOCUS, 0, 0, lr)
-			Case BN_KILLFOCUS
-				RaiseCommandEvent = ProcessMessage(WM_KILLFOCUS, 0, 0, lr)
-			'ここに挙げられなかったBNメッセージは、16ビットWindowsとの互換性のためとされているもの。
-		End Select
-	End Function
 
 End Class
Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/ButtonBase.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/ButtonBase.ab	(revision 642)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/ButtonBase.ab	(revision 642)
@@ -0,0 +1,46 @@
+#require <Classes/ActiveBasic/Windows/UI/Control.ab>
+
+Namespace ActiveBasic
+Namespace Windows
+Namespace UI
+
+/*!
+@date 2008/10/16
+@brief	ウィンドウクラス"BUTTON"用基底クラス。
+@author Egtra
+*/
+Class ButtonBase
+	Inherits WmCommandControl
+Protected
+	Override Sub GetCreateStruct(ByRef cs As CREATESTRUCT)
+		cs.lpszClass = "BUTTON"
+	End Sub
+
+	Sub ButtonBase()
+	End Sub
+Public
+	Sub RaiseClick()
+		OnClick(Args.Empty)
+	End Sub
+
+	Override Function RaiseCommandEvent(notificationCode As Word) As Boolean
+		Dim lr As LRESULT
+		RaiseCommandEvent = False
+		Select Case notificationCode
+			Case BN_CLICKED
+				RaiseCommandEvent = OnClick(Args.Empty)
+			Case BN_DBLCLK
+				RaiseCommandEvent = OnDoubleClick(Args.Empty)
+			Case BN_SETFOCUS
+				RaiseCommandEvent = ProcessMessage(WM_SETFOCUS, 0, 0, lr)
+			Case BN_KILLFOCUS
+				RaiseCommandEvent = ProcessMessage(WM_KILLFOCUS, 0, 0, lr)
+			'ここに挙げられなかったBNメッセージは、16ビットWindowsとの互換性のためとされているもの。
+		End Select
+	End Function
+
+End Class
+
+End Namespace 'UI
+End Namespace 'Widnows
+End Namespace 'ActiveBasic
Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/CheckBox.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/CheckBox.ab	(revision 642)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/CheckBox.ab	(revision 642)
@@ -0,0 +1,61 @@
+#require <Classes/ActiveBasic/Windows/UI/Control.ab>
+
+Namespace ActiveBasic
+Namespace Windows
+Namespace UI
+
+/*!
+@date 2008/07/13
+@brief	チェックボックスを表すクラス。
+@author Egtra
+*/
+Class CheckBox
+	Inherits ButtonBase
+Protected
+	Override Sub GetCreateStruct(ByRef cs As CREATESTRUCT)
+		Super.GetCreateStruct(cs)
+		cs.style Or= BS_AUTOCHECKBOX
+	End Sub
+Public
+	/*!
+	@brief チェックされているかどうかの取得。
+	@retval true チェックされているもしくは第3状態
+	@retval false チェックされていない
+	*/
+	Const Function Checked() As Boolean
+		Checked = SendMessage(BM_GETCHECK) > 0
+	End Function
+
+	/*!
+	@brief チェックされているかどうかの設定。
+	@param[in] check チェックを入れるならtrue, 外すならfalse。
+	*/
+	Sub Checked(check As Boolean)
+		SendMessage(BM_SETCHECK, check As WPARAM, 0)
+	End Sub
+
+	/*!
+	@brief クリック時に自動で状態変化するかどうかの取得。
+	@retval true 自動変化する
+	@retval false 自動変化しない
+	*/
+	Function AutoCheck() As Boolean
+		AutoCheck = ((Style And BS_AUTOCHECKBOX) = BS_AUTOCHECKBOX)
+	End Function
+
+	/*!
+	@brief クリック時に自動で状態変化するどうかの設定。
+	@param[in] check 自動で変化させるならTrue、そうでないならFalse。
+	*/
+	Sub AutoCheck(autoCheck As Boolean)
+		If autoCheck Then
+			Style = Style Or BS_AUTOCHECKBOX
+		Else
+			Style = (Style And (Not BS_AUTOCHECKBOX)) Or BS_CHECKBOX
+		End If
+	End Sub
+End Class
+
+End Namespace 'UI
+End Namespace 'Widnows
+End Namespace 'ActiveBasic
