source: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/CheckBox.ab@ 642

Last change on this file since 642 was 642, checked in by イグトランス (egtra), 16 years ago

CheckBoxとButtonBaseクラスを追加。

File size: 1.4 KB
Line 
1#require <Classes/ActiveBasic/Windows/UI/Control.ab>
2
3Namespace ActiveBasic
4Namespace Windows
5Namespace UI
6
7/*!
8@date 2008/07/13
9@brief チェックボックスを表すクラス。
10@author Egtra
11*/
12Class CheckBox
13 Inherits ButtonBase
14Protected
15 Override Sub GetCreateStruct(ByRef cs As CREATESTRUCT)
16 Super.GetCreateStruct(cs)
17 cs.style Or= BS_AUTOCHECKBOX
18 End Sub
19Public
20 /*!
21 @brief チェックされているかどうかの取得。
22 @retval true チェックされているもしくは第3状態
23 @retval false チェックされていない
24 */
25 Const Function Checked() As Boolean
26 Checked = SendMessage(BM_GETCHECK) > 0
27 End Function
28
29 /*!
30 @brief チェックされているかどうかの設定。
31 @param[in] check チェックを入れるならtrue, 外すならfalse。
32 */
33 Sub Checked(check As Boolean)
34 SendMessage(BM_SETCHECK, check As WPARAM, 0)
35 End Sub
36
37 /*!
38 @brief クリック時に自動で状態変化するかどうかの取得。
39 @retval true 自動変化する
40 @retval false 自動変化しない
41 */
42 Function AutoCheck() As Boolean
43 AutoCheck = ((Style And BS_AUTOCHECKBOX) = BS_AUTOCHECKBOX)
44 End Function
45
46 /*!
47 @brief クリック時に自動で状態変化するどうかの設定。
48 @param[in] check 自動で変化させるならTrue、そうでないならFalse。
49 */
50 Sub AutoCheck(autoCheck As Boolean)
51 If autoCheck Then
52 Style = Style Or BS_AUTOCHECKBOX
53 Else
54 Style = (Style And (Not BS_AUTOCHECKBOX)) Or BS_CHECKBOX
55 End If
56 End Sub
57End Class
58
59End Namespace 'UI
60End Namespace 'Widnows
61End Namespace 'ActiveBasic
Note: See TracBrowser for help on using the repository browser.