BCheckBox: Add tri-state support
* Add possible control state B_CONTROL_PARTIALLY_ON and support it in BCheckBox and BControlLook. * BCheckBox: Add partialStateToOff property defining whether the partial state should transition to off. Defaults to false (i.e. partial to on).
This commit is contained in:
@@ -69,6 +69,9 @@ public:
|
||||
|
||||
virtual status_t Perform(perform_code code, void* data);
|
||||
|
||||
bool IsPartialStateToOff() const;
|
||||
void SetPartialStateToOff(bool partialToOff);
|
||||
|
||||
protected:
|
||||
virtual void LayoutInvalidated(bool descendants = false);
|
||||
|
||||
@@ -81,6 +84,7 @@ private:
|
||||
private:
|
||||
BRect _CheckBoxFrame() const;
|
||||
BSize _ValidatePreferredSize();
|
||||
int32 _NextState() const;
|
||||
|
||||
private:
|
||||
// Forbidden
|
||||
@@ -89,6 +93,7 @@ private:
|
||||
private:
|
||||
BSize fPreferredSize;
|
||||
bool fOutlined;
|
||||
bool fPartialToOff;
|
||||
};
|
||||
|
||||
#endif // _CHECK_BOX_H
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
|
||||
enum {
|
||||
B_CONTROL_OFF = 0,
|
||||
B_CONTROL_ON = 1
|
||||
B_CONTROL_ON = 1,
|
||||
B_CONTROL_PARTIALLY_ON = 2
|
||||
};
|
||||
|
||||
class BWindow;
|
||||
|
||||
@@ -69,13 +69,14 @@ public:
|
||||
};
|
||||
|
||||
enum {
|
||||
B_FOCUSED = 1 << 0,
|
||||
B_CLICKED = 1 << 1, // some controls activate on mouse up
|
||||
B_ACTIVATED = 1 << 2,
|
||||
B_HOVER = 1 << 3,
|
||||
B_DISABLED = 1 << 4,
|
||||
B_DEFAULT_BUTTON = 1 << 5,
|
||||
B_IGNORE_OUTLINE = 1 << 6,
|
||||
B_FOCUSED = 1 << 0,
|
||||
B_CLICKED = 1 << 1, // some controls activate on mouse up
|
||||
B_ACTIVATED = 1 << 2,
|
||||
B_HOVER = 1 << 3,
|
||||
B_DISABLED = 1 << 4,
|
||||
B_DEFAULT_BUTTON = 1 << 5,
|
||||
B_IGNORE_OUTLINE = 1 << 6,
|
||||
B_PARTIALLY_ACTIVATED = 1 << 7, // like B_ACTIVATED, but for tri-state
|
||||
|
||||
B_BLEND_FRAME = 1 << 16
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user