History log of /haiku/src/kits/interface/RadioButton.cpp
Revision Date Author Comments
# 8b902d94 22-Mar-2016 John Scipione <jscipione@gmail.com>

IK: Use panel text color for select control labels

NOTE: This should have no effect on the colors of these labels unless
you have changed the panel text color and control text colors to be
different. Both are black by default.

In the case of the menu field, spinner, check box, radio button,
slider, and text control labels we want to draw these labels using
the panel text color instead of the control text color because they
are drawn on top of the panel color. (the menu field label color was
changed in a previous commit in this push).

In all cases except the menu field the label color is specified by
temporarily unsetting the B_IS_CONTROL flag while drawing the label.
All use control look to draw the label.

The control text color is meant to be used for text INSIDE the control,
not the label text that accompanies the control -- at least that's the
way I understand it.


# 1f424632 11-Jun-2014 John Scipione <jscipione@gmail.com>

Style fixes to IK, focus on docs


# b29d84a8 28-May-2014 John Scipione <jscipione@gmail.com>

BRadioButton style fixes for docs.


# 5e815cf3 22-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BRadioButton: Add icon support

* Fix off-by-one issue in Draw() and GetPreferredSize(). The label was
too close to the knob.
* GetPreferredSize(): Remove empty space to the right, when no label
and no icon was specified. Like with BCheckBox there's still two rows
of empty pixels above and below the knob.
* Draw(), GetPreferredSize(): Add icon support.


# 36e15662 22-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BRadioButton: Remove non-BControlLook code


# be436742 21-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BControl subclasses: Override SetIcon()

... and implement Perform() action for potential later use.


# 57973ac9 20-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BRadioButton: Fix spurious Invoke()

MouseUp(): Don't call SetValue() and Invoke() when the button was
already the selected one.


# 46d6e9d9 29-Jun-2013 Rene Gollent <anevilyak@gmail.com>

Interface Kit: Adjust max size and default alignment...

...on controls where it makes sense:
- BRadioButton and BCheckBox now return their preferred size as their
maximum.
- BRadioButton, BCheckBox and BTextControl now use left alignment by
default, as this is the most common use case for them.


# 57c5b09e 05-Aug-2012 Ryan Leavengood <leavengood@gmail.com>

Use be_control_look != NULL everywhere in the Interface Kit.

Should not be a functional change. It is not in the Haiku Coding Guidelines but
I feel like 'if (object != NULL)' is generally preferred to 'if (object)', plus
in this case of be_control_look that is the more common style.


# eee4243d 20-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

De-virtualize BView::InvalidateLayout() and introduce LayoutInvalidated() hook, like BLayout.


# 26fe4141 13-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

Small coding style fixes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36216 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2f86ba45 15-Feb-2009 Stephan Aßmus <superstippi@gmx.de>

Implemented a new look for the Haiku interface controls. It was
overheard that they looked too ninety-ish.
TODO: The code behind this is work in progress. The basic idea
is to extract all drawing code into a new class BControlLook,
of which there is a global instance be_control_look, instantiated
in InterfaceDefs.cpp. At the moment, all the old drawing code is
still there, and the usage of be_control_look is inside if-bodies
checking the instance against NULL. In another words, by not
instanitating be_control_look, you can revert back to the old look.
BControlLook's job is to provide reusable methods for drawing
certain types of frames, backgrounds and labels, so that application
developers can make controls that re-use the same drawing code
as built-in controls and adopt to changes made there. I have added
the notion of "borders". Each of the frame drawing methods can be
made to draw certain borders only, which is supposed to help when
controls shall visually attach. This feature is not fully explored
at all ATM.
TODO: Update BColumnListView header view and BStringItem text
spacing. Update other apps where it makes sense to use BControlLook.
For the moment, only Tracker and LaunchBox are updated. More...
NOTE: The new look is not very radically different, so that existing
apps do not immediately look too ugly or out of place.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29221 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 39fbf550 15-Oct-2008 Oliver Tappe <zooey@hirschkaefer.de>

bonefish + zooey:
* Fixed a general problem with respect to overriding of the reserved
virtual function slots: instead of statically invoking the method
that corresponds to the reserved slot on the class that contains the
slot, we now invoke the virtual Perform() method. Perform() then dispatches
the method invocation to the "proper" class, i.e. the highest class in the
hierarchy that actually implements the requested method.
This fixes a crash in apps that use liblayout's MSlider class and
should fix one or other spurious bug with old apps or libraries, too.
* added new header folder 'binary_compatibility' that contains files that
define the method codes and data structures required by Perform()
* looked for and implemented all used reserved virtual slot functions to
invoke Perform() where necessary or to pass on the method call statically
(for slots that were already maintained by Be)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28124 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 43f8c614 16-Sep-2008 Stephan Aßmus <superstippi@gmx.de>

* Updated the coding style.
* The layout friendly constructors don't need to mess with the control size.
* The layout friendly constructors can use the respective BControl constructor.
* Refactored some duplicated code.
* Removed duplicated GetFontHeight() calls.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27585 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9ecf9d1c 26-Aug-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

Merge from layout management branch.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18649 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 17408188 12-Jul-2006 Jérôme Duval <korli@users.berlios.de>

SetValue now avoids itself switching off
also added an ASSERT to check the current radio button is still on after the switching off process
this fixes the weird behavior in the password window of the ScreenSaver prefapp


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18107 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 19f441e5 05-May-2006 Stephan Aßmus <superstippi@gmx.de>

the drawing code was optimized for bugs in Painter, no longer
necessary


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17330 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 40fc37b0 11-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* Fixed GetPreferredSize()
* Text height was computed with roundf() instead of ceilf() (which makes more sense).
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16706 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a71c9607 01-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

* BControl::SetValue() now calls Invalidate() again - not doing so would
break compatibility a bit too much (as this is a public class).
* Instead, we're now using the same mechanism as in Dano/Zeta, that is,
we use BControl::SetValueNoUpdate() in the inherited classes.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16183 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8643b098 23-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

All controls/views now accept NULL arguments for "width" and "height" in GetPreferredSize().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15091 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5ac57aeb 05-Nov-2005 Stephan Aßmus <superstippi@gmx.de>

improved look and applied style guide, fixed redrawing in BWindows with synchronous controls, it wouldn't have mattered if Haiku didn't have anti-aliasing, override B_RETURN on keydown to disallow turning the control off

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14715 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0c3344f4 03-Jun-2005 Stephan Aßmus <superstippi@gmx.de>

no Invalidate in BControl::SetValue, I figure more controls need to be updated for this change

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12947 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c7694b4a 17-May-2005 Stephan Aßmus <superstippi@gmx.de>

Make the dot a dynamic size and improve the rendering for anti-aliasing under Haiku. Confirmed to look good with different font sizes.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12711 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9199a339 20-Oct-2004 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Synchronous and asynchronous MouseDown() code was wrongly placed.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9436 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8053a364 16-Jun-2003 Marc Flerackers <mflerackers@nowhere.fake>

Assynchronous mouse hooks and correct handling of BRadioButtons in BBox-en :)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3534 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ac6f7aa8 23-Jan-2003 Marc Flerackers <mflerackers@nowhere.fake>

Lots of fixes, geometry calculations updated, added buffered BSlider support


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2539 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a577a699 17-Oct-2002 Marc Flerackers <mflerackers@nowhere.fake>

Fixed a bug in SetValue()


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1559 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52a38012 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1f424632be5dcad5b81a23080eb205ab6471cd7b 11-Jun-2014 John Scipione <jscipione@gmail.com>

Style fixes to IK, focus on docs


# b29d84a85ad95ed8b5848f20980b17430c41cb8d 28-May-2014 John Scipione <jscipione@gmail.com>

BRadioButton style fixes for docs.


# 5e815cf35b7cfada9473824c0e1f651081e9d93f 22-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BRadioButton: Add icon support

* Fix off-by-one issue in Draw() and GetPreferredSize(). The label was
too close to the knob.
* GetPreferredSize(): Remove empty space to the right, when no label
and no icon was specified. Like with BCheckBox there's still two rows
of empty pixels above and below the knob.
* Draw(), GetPreferredSize(): Add icon support.


# 36e1566271e399169564810bb4859d8a5c0467cf 22-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BRadioButton: Remove non-BControlLook code


# be4367428b6478ae059614d7a9b6f6dc721e5dcb 21-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BControl subclasses: Override SetIcon()

... and implement Perform() action for potential later use.


# 57973ac96b3b121bfcd70ad864aec0192f4e2b68 20-Dec-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BRadioButton: Fix spurious Invoke()

MouseUp(): Don't call SetValue() and Invoke() when the button was
already the selected one.


# 46d6e9d9ed21f6752b4f256ed193faa5bc586501 29-Jun-2013 Rene Gollent <anevilyak@gmail.com>

Interface Kit: Adjust max size and default alignment...

...on controls where it makes sense:
- BRadioButton and BCheckBox now return their preferred size as their
maximum.
- BRadioButton, BCheckBox and BTextControl now use left alignment by
default, as this is the most common use case for them.


# 57c5b09e1a3d0f36f94cbab11c96842d782b8eaf 05-Aug-2012 Ryan Leavengood <leavengood@gmail.com>

Use be_control_look != NULL everywhere in the Interface Kit.

Should not be a functional change. It is not in the Haiku Coding Guidelines but
I feel like 'if (object != NULL)' is generally preferred to 'if (object)', plus
in this case of be_control_look that is the more common style.


# eee4243d35225a35d0964ebebe94490eaca14261 20-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

De-virtualize BView::InvalidateLayout() and introduce LayoutInvalidated() hook, like BLayout.


# 26fe41417d84b47074967073b8ea2f6910832dfe 13-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

Small coding style fixes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36216 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2f86ba45579bdc9648b232175f87edc62ab71b54 15-Feb-2009 Stephan Aßmus <superstippi@gmx.de>

Implemented a new look for the Haiku interface controls. It was
overheard that they looked too ninety-ish.
TODO: The code behind this is work in progress. The basic idea
is to extract all drawing code into a new class BControlLook,
of which there is a global instance be_control_look, instantiated
in InterfaceDefs.cpp. At the moment, all the old drawing code is
still there, and the usage of be_control_look is inside if-bodies
checking the instance against NULL. In another words, by not
instanitating be_control_look, you can revert back to the old look.
BControlLook's job is to provide reusable methods for drawing
certain types of frames, backgrounds and labels, so that application
developers can make controls that re-use the same drawing code
as built-in controls and adopt to changes made there. I have added
the notion of "borders". Each of the frame drawing methods can be
made to draw certain borders only, which is supposed to help when
controls shall visually attach. This feature is not fully explored
at all ATM.
TODO: Update BColumnListView header view and BStringItem text
spacing. Update other apps where it makes sense to use BControlLook.
For the moment, only Tracker and LaunchBox are updated. More...
NOTE: The new look is not very radically different, so that existing
apps do not immediately look too ugly or out of place.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29221 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 39fbf5509b8740d9883b61649027478dc8a3ead8 15-Oct-2008 Oliver Tappe <zooey@hirschkaefer.de>

bonefish + zooey:
* Fixed a general problem with respect to overriding of the reserved
virtual function slots: instead of statically invoking the method
that corresponds to the reserved slot on the class that contains the
slot, we now invoke the virtual Perform() method. Perform() then dispatches
the method invocation to the "proper" class, i.e. the highest class in the
hierarchy that actually implements the requested method.
This fixes a crash in apps that use liblayout's MSlider class and
should fix one or other spurious bug with old apps or libraries, too.
* added new header folder 'binary_compatibility' that contains files that
define the method codes and data structures required by Perform()
* looked for and implemented all used reserved virtual slot functions to
invoke Perform() where necessary or to pass on the method call statically
(for slots that were already maintained by Be)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28124 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 43f8c6143ab803f64b966b257a7488e02b1aec86 16-Sep-2008 Stephan Aßmus <superstippi@gmx.de>

* Updated the coding style.
* The layout friendly constructors don't need to mess with the control size.
* The layout friendly constructors can use the respective BControl constructor.
* Refactored some duplicated code.
* Removed duplicated GetFontHeight() calls.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27585 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9ecf9d1c1d4888d341a6eac72112c72d1ae3a4cb 26-Aug-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

Merge from layout management branch.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18649 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 17408188c51c8c137e497669a25aefce604ceec6 12-Jul-2006 Jérôme Duval <korli@users.berlios.de>

SetValue now avoids itself switching off
also added an ASSERT to check the current radio button is still on after the switching off process
this fixes the weird behavior in the password window of the ScreenSaver prefapp


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18107 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 19f441e57543994eadbd3a2870b5b21bbdcc182a 05-May-2006 Stephan Aßmus <superstippi@gmx.de>

the drawing code was optimized for bugs in Painter, no longer
necessary


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17330 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 40fc37b0ae7da03188f4dc25659d8acee5eaa4f0 11-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* Fixed GetPreferredSize()
* Text height was computed with roundf() instead of ceilf() (which makes more sense).
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16706 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a71c960755b6e636ce99639c700d3415788c7b41 01-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

* BControl::SetValue() now calls Invalidate() again - not doing so would
break compatibility a bit too much (as this is a public class).
* Instead, we're now using the same mechanism as in Dano/Zeta, that is,
we use BControl::SetValueNoUpdate() in the inherited classes.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16183 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8643b0987c2d6aca25b53fb6d8fa0a126b2b3f1f 23-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

All controls/views now accept NULL arguments for "width" and "height" in GetPreferredSize().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15091 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5ac57aebfbdc1b185b31616c6f0b949d20900762 05-Nov-2005 Stephan Aßmus <superstippi@gmx.de>

improved look and applied style guide, fixed redrawing in BWindows with synchronous controls, it wouldn't have mattered if Haiku didn't have anti-aliasing, override B_RETURN on keydown to disallow turning the control off

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14715 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0c3344f4a18959a347e6ed9d58fc31976b72d6b4 03-Jun-2005 Stephan Aßmus <superstippi@gmx.de>

no Invalidate in BControl::SetValue, I figure more controls need to be updated for this change

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12947 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c7694b4ac7ff5e5e010debe4eea3b5b69aafb664 17-May-2005 Stephan Aßmus <superstippi@gmx.de>

Make the dot a dynamic size and improve the rendering for anti-aliasing under Haiku. Confirmed to look good with different font sizes.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12711 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9199a3397bec0badca7d6f898be3185213597a29 20-Oct-2004 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Synchronous and asynchronous MouseDown() code was wrongly placed.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9436 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8053a364e1f8e6d34b4b96ca502c43b6efacb4e1 16-Jun-2003 Marc Flerackers <mflerackers@nowhere.fake>

Assynchronous mouse hooks and correct handling of BRadioButtons in BBox-en :)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3534 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ac6f7aa8506e964f35eb1c1107aea80ae7d06d18 23-Jan-2003 Marc Flerackers <mflerackers@nowhere.fake>

Lots of fixes, geometry calculations updated, added buffered BSlider support


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2539 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a577a699da0965203aac998dca1346857293857c 17-Oct-2002 Marc Flerackers <mflerackers@nowhere.fake>

Fixed a bug in SetValue()


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1559 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52a380120846174213ccce9c4aab0dda17c72083 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96