(parent Container)
| 28 | } |
| 29 | |
| 30 | func NewCheckBox(parent Container) (*CheckBox, error) { |
| 31 | cb := new(CheckBox) |
| 32 | |
| 33 | if err := InitWidget( |
| 34 | cb, |
| 35 | parent, |
| 36 | "BUTTON", |
| 37 | win.WS_TABSTOP|win.WS_VISIBLE|win.BS_AUTOCHECKBOX, |
| 38 | 0); err != nil { |
| 39 | return nil, err |
| 40 | } |
| 41 | |
| 42 | cb.Button.init() |
| 43 | |
| 44 | cb.SetBackground(nullBrushSingleton) |
| 45 | |
| 46 | cb.GraphicsEffects().Add(InteractionEffect) |
| 47 | cb.GraphicsEffects().Add(FocusEffect) |
| 48 | |
| 49 | cb.MustRegisterProperty("CheckState", NewProperty( |
| 50 | func() interface{} { |
| 51 | return cb.CheckState() |
| 52 | }, |
| 53 | func(v interface{}) error { |
| 54 | cb.SetCheckState(CheckState(assertIntOr(v, 0))) |
| 55 | |
| 56 | return nil |
| 57 | }, |
| 58 | cb.CheckStateChanged())) |
| 59 | |
| 60 | return cb, nil |
| 61 | } |
| 62 | |
| 63 | func (cb *CheckBox) TextOnLeftSide() bool { |
| 64 | return cb.hasStyleBits(win.BS_LEFTTEXT) |
no test coverage detected
searching dependent graphs…