Searched +hist:2 +hist:f86ba45 (Results 26 - 34 of 34) sorted by relevance

12

/haiku/src/kits/interface/
H A DMenuField.cppdiff 285b7163 Tue Oct 08 18:09:41 MDT 2013 John Scipione <jscipione@gmail.com> MenuField: Filter out additional MouseDown messages.

...while mouse is down on a menufield

This makes it so that you can't open 2 menufields simultaneously
by clicking and holding the right mouse button on one menufield while
clicking a second with the the left mouse button opening it.

This matches the behavior on BeOS R5.

Should help with #6408 comment:9
diff 2f86ba45 Sun Feb 15 11:23:19 MST 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
diff 2f86ba45 Sun Feb 15 11:23:19 MST 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
diff b321303c Tue Jun 19 17:38:00 MDT 2007 Ingo Weinhold <ingo_weinhold@gmx.de> * Implemented Min/Max/PreferredSize().
* Reworked the internal layout. _ValidateLayoutData() computes and caches the
layout related data and all other methods just use those values. Now, in
layout-aware mode the class should properly work not only when using the
layout items. And when using layout items, the class does actually do
internal layout; it was basically good luck that it worked in the tests,
before. Vertical resizing is supported, too.
* We do a few mean tricks to get the probably mostly preferred layout behavior:
By default our own explicit max width and that of the menu bar layout item is
set to unlimited and the horizontal menu bar alignment to left aligned. This
allows to horizontally resize a BMenuField beyond its preferred size,
although both label and menu bar have a limited max width. The user can, of
course, override those explicit sizes/alignments to get a different behavior,
if desired.
* Fixed invalidation in SetDivider(). When having the focus, the left and top
border of the blue frame were not invalidated.
* The label is no longer drawn at vertical position font ascent + descent
+ leading + 2 (not sure how this calculation was supposed to work), but
vertically centers the label around the ascent. With big fonts the label is
shown a bit too far to the bottom. Not sure how to fix this in a generic way.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21466 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2e6a5805 Tue Jul 05 10:30:53 MDT 2005 Stephan Aßmus <superstippi@gmx.de> MenuField layouts the menu bar better with respect to fDivider, it aligns better with other controls. fDivider in TextControl is an integer number now, small fix and small cleanup in Menu, Window::InitData takes an optional BBitmap token to construct an offscreen window, fixed PrivateScreen IndexForColor, View prevents being located at fractional coordinates as in R5, BBitmap unlocks its offscreen window since it is never Show()n and needs manual unlocking, fixed Slider offscreen window mode and improved triange thumb drawing, ScrollView would not crash when passing a NULL target just for kicks, the private MenuBar class now implements Draw to draw itself a little differently inside the BMenuField (dark right and bottom side) - though how it currently sets the clipping region prevents the text controls to draw in Playground, needs fixing

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13450 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 285b7163ad41e00841d0dc28b48fe10902a350bc Tue Oct 08 18:09:41 MDT 2013 John Scipione <jscipione@gmail.com> MenuField: Filter out additional MouseDown messages.

...while mouse is down on a menufield

This makes it so that you can't open 2 menufields simultaneously
by clicking and holding the right mouse button on one menufield while
clicking a second with the the left mouse button opening it.

This matches the behavior on BeOS R5.

Should help with #6408 comment:9
diff 2f86ba45579bdc9648b232175f87edc62ab71b54 Sun Feb 15 11:23:19 MST 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
diff b321303cf9862de9ef3f5526d78c5c317cfc45e4 Tue Jun 19 17:38:00 MDT 2007 Ingo Weinhold <ingo_weinhold@gmx.de> * Implemented Min/Max/PreferredSize().
* Reworked the internal layout. _ValidateLayoutData() computes and caches the
layout related data and all other methods just use those values. Now, in
layout-aware mode the class should properly work not only when using the
layout items. And when using layout items, the class does actually do
internal layout; it was basically good luck that it worked in the tests,
before. Vertical resizing is supported, too.
* We do a few mean tricks to get the probably mostly preferred layout behavior:
By default our own explicit max width and that of the menu bar layout item is
set to unlimited and the horizontal menu bar alignment to left aligned. This
allows to horizontally resize a BMenuField beyond its preferred size,
although both label and menu bar have a limited max width. The user can, of
course, override those explicit sizes/alignments to get a different behavior,
if desired.
* Fixed invalidation in SetDivider(). When having the focus, the left and top
border of the blue frame were not invalidated.
* The label is no longer drawn at vertical position font ascent + descent
+ leading + 2 (not sure how this calculation was supposed to work), but
vertically centers the label around the ascent. With big fonts the label is
shown a bit too far to the bottom. Not sure how to fix this in a generic way.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21466 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2e6a5805ba8db3b072d81257cc44f966def5fd37 Tue Jul 05 10:30:53 MDT 2005 Stephan Aßmus <superstippi@gmx.de> MenuField layouts the menu bar better with respect to fDivider, it aligns better with other controls. fDivider in TextControl is an integer number now, small fix and small cleanup in Menu, Window::InitData takes an optional BBitmap token to construct an offscreen window, fixed PrivateScreen IndexForColor, View prevents being located at fractional coordinates as in R5, BBitmap unlocks its offscreen window since it is never Show()n and needs manual unlocking, fixed Slider offscreen window mode and improved triange thumb drawing, ScrollView would not crash when passing a NULL target just for kicks, the private MenuBar class now implements Draw to draw itself a little differently inside the BMenuField (dark right and bottom side) - though how it currently sets the clipping region prevents the text controls to draw in Playground, needs fixing

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13450 a95241bf-73f2-0310-859d-f6bbb57e9c96
H A DControlLook.cppdiff 1482b250 Wed Mar 04 03:03:47 MST 2020 John Scipione <jscipione@gmail.com> IK: Update scroll bars for alternative control look

Scroll bars should look and work identically to before on
HaikuControlLook.

Add DrawScrollBarButton() and DrawScrollBarThumb() and
DrawScrollBarBorder() methods. These methods are used to draw scroll
bars in a generic way so that they can be drawn differently by alternative
control look's (e.g. BeControlLook). Also it gives us back drawing of
scroll bar knobs. However the knob setting is not exposed in the
interface in this commit.

These methods are in addition to the 2 existing DrawScrollBarBackground()
methods that draw the scroll bar background. One draws the area above and
below the thumb and the other is called by the first to actually draw the
area.

The rest of the drawing besides the backgrounds was being done in
BScrollBar before. To draw the scroll bar arrows and thumb we were recyling
other ControlLook methods, while this worked well enough on HaikuControlLook
it wasn't flexible enough for alternative control looks.

DrawScrollBarButton() is used to draw the four scroll buttons and is
typically (so far) used in combination with DrawArrowShape().

DrawScrollBarThumb() draws the scroll bar thumb.

DrawScrollBarBorder() draws a 1px border around the entire scroll bar,
potentially B_KEYBOARD_NAVIGATION_COLOR if focused (although this is
feature not currently used.)

Draw unscrollable scroll bars as if they were disabled including the
buttons with their arrow shapes, background, and thumb.

Add FBC backwords compatibility macros in ControlLook.cpp

Change-Id: I9237c5ce45d17d674785111d51de951e5686306b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/351
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
diff e439b003 Mon Apr 07 15:14:15 MDT 2014 John Scipione <jscipione@gmail.com> Fix button label position, try number 2

Create and use BLayoutUtils::AlignOnRect() to position the button label
in BControlLook::DrawLabel().

AlignOnRect(), unlike AlignInFrame(), provides the possibility to return
a rectangle with dimensions greater than the available size.

Add some comments above the methods in LayoutUtils that indicate such.

Also update copyright headers in LayoutUtils and ControlLook
diff 2ce5b172 Tue Mar 24 18:02:20 MDT 2009 Stephan Aßmus <superstippi@gmx.de> Fix case label coding style violations...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29688 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2f86ba45 Sun Feb 15 11:23:19 MST 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
diff 2f86ba45 Sun Feb 15 11:23:19 MST 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
diff e439b003978b9554e034bb4cfc59e164a7215b31 Mon Apr 07 15:14:15 MDT 2014 John Scipione <jscipione@gmail.com> Fix button label position, try number 2

Create and use BLayoutUtils::AlignOnRect() to position the button label
in BControlLook::DrawLabel().

AlignOnRect(), unlike AlignInFrame(), provides the possibility to return
a rectangle with dimensions greater than the available size.

Add some comments above the methods in LayoutUtils that indicate such.

Also update copyright headers in LayoutUtils and ControlLook
diff 2ce5b17258316aa8d221f39dfad332dc1a2e00b4 Tue Mar 24 18:02:20 MDT 2009 Stephan Aßmus <superstippi@gmx.de> Fix case label coding style violations...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29688 a95241bf-73f2-0310-859d-f6bbb57e9c96
2f86ba45579bdc9648b232175f87edc62ab71b54 Sun Feb 15 11:23:19 MST 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
H A DSlider.cppdiff 2f86ba45 Sun Feb 15 11:23:19 MST 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
diff 2f86ba45 Sun Feb 15 11:23:19 MST 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
diff f898f8af Wed Jul 16 09:15:24 MDT 2008 Stephan Aßmus <superstippi@gmx.de> If the user specified a hashmark location other than B_HASH_MARKS_NONE, draw
at least two hash marks, even if the hash mark count has never been configured.
Also means the minimum hashmark count is 2 instead of 1 as before. I think this
behavior is more what one would expect, I turned on hashmarks and wondered
why nothing happened until I realized I needed to configure the count as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26443 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2e6a5805 Tue Jul 05 10:30:53 MDT 2005 Stephan Aßmus <superstippi@gmx.de> MenuField layouts the menu bar better with respect to fDivider, it aligns better with other controls. fDivider in TextControl is an integer number now, small fix and small cleanup in Menu, Window::InitData takes an optional BBitmap token to construct an offscreen window, fixed PrivateScreen IndexForColor, View prevents being located at fractional coordinates as in R5, BBitmap unlocks its offscreen window since it is never Show()n and needs manual unlocking, fixed Slider offscreen window mode and improved triange thumb drawing, ScrollView would not crash when passing a NULL target just for kicks, the private MenuBar class now implements Draw to draw itself a little differently inside the BMenuField (dark right and bottom side) - though how it currently sets the clipping region prevents the text controls to draw in Playground, needs fixing

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13450 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2f86ba45579bdc9648b232175f87edc62ab71b54 Sun Feb 15 11:23:19 MST 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
diff f898f8af47a152b4380ea509a3e305a04f2fffca Wed Jul 16 09:15:24 MDT 2008 Stephan Aßmus <superstippi@gmx.de> If the user specified a hashmark location other than B_HASH_MARKS_NONE, draw
at least two hash marks, even if the hash mark count has never been configured.
Also means the minimum hashmark count is 2 instead of 1 as before. I think this
behavior is more what one would expect, I turned on hashmarks and wondered
why nothing happened until I realized I needed to configure the count as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26443 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2e6a5805ba8db3b072d81257cc44f966def5fd37 Tue Jul 05 10:30:53 MDT 2005 Stephan Aßmus <superstippi@gmx.de> MenuField layouts the menu bar better with respect to fDivider, it aligns better with other controls. fDivider in TextControl is an integer number now, small fix and small cleanup in Menu, Window::InitData takes an optional BBitmap token to construct an offscreen window, fixed PrivateScreen IndexForColor, View prevents being located at fractional coordinates as in R5, BBitmap unlocks its offscreen window since it is never Show()n and needs manual unlocking, fixed Slider offscreen window mode and improved triange thumb drawing, ScrollView would not crash when passing a NULL target just for kicks, the private MenuBar class now implements Draw to draw itself a little differently inside the BMenuField (dark right and bottom side) - though how it currently sets the clipping region prevents the text controls to draw in Playground, needs fixing

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13450 a95241bf-73f2-0310-859d-f6bbb57e9c96
H A DJamfilediff a0ba79fb Wed Mar 11 15:17:16 MDT 2015 John Scipione <jscipione@gmail.com> Split BSpinner into BAbstractSpinner and...

2 concrete classes which are currently implemented:
* BSpinner (works on int32s)
* BDecimalSpinner (works on doubles)

In addition BAbstractSpinner now inherits from BControl instead of
BView/BInvoker. This allowed for code simplification at the cost of needing to
cast for the decimal version because SetValue(int32 value) comes from BControl.

Also, add a spinner_button_style enum with 3 options:
* SPINNER_BUTTON_HORIZONTAL_ARROWS
* SPINNER_BUTTON_VERTICAL_ARROWS
* SPINNER_BUTTON_PLUS_MINUS

which sets the spinner arrows to either use horizontal arrows (left/right)
vertical arrows, (up/down), or +/- symbols (the default).

If the spinner button is using horizontal arrows you can decrement and increment
the spinner value by pushing control+left/right, otherwise you can increment and
decrement by pushing up or down. The reason for needing control is so that you
can move the cursor in the textbox otherwise.

Switch the 3 apps that are currently using BSpinners to use the integer variety
in Deskbar preferences, WebPostive preferences, and Screen preferences.
diff 2f86ba45 Sun Feb 15 11:23:19 MST 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
diff 2f86ba45 Sun Feb 15 11:23:19 MST 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
diff b09e53fa Sat Mar 04 22:01:15 MST 2006 Michael Lotz <mmlr@mlotz.ch> Wrote a new color conversion engine. It's 2-5 times faster than the old one (depending on colorspaces) and about half in size.
I've put it into ColorConversion.cpp and moved PaletteConverter there too, cleaning up Bitmap.cpp.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16580 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff a0ba79fbff0d2a8ce0f008362d5e8832c1d994c2 Wed Mar 11 15:17:16 MDT 2015 John Scipione <jscipione@gmail.com> Split BSpinner into BAbstractSpinner and...

2 concrete classes which are currently implemented:
* BSpinner (works on int32s)
* BDecimalSpinner (works on doubles)

In addition BAbstractSpinner now inherits from BControl instead of
BView/BInvoker. This allowed for code simplification at the cost of needing to
cast for the decimal version because SetValue(int32 value) comes from BControl.

Also, add a spinner_button_style enum with 3 options:
* SPINNER_BUTTON_HORIZONTAL_ARROWS
* SPINNER_BUTTON_VERTICAL_ARROWS
* SPINNER_BUTTON_PLUS_MINUS

which sets the spinner arrows to either use horizontal arrows (left/right)
vertical arrows, (up/down), or +/- symbols (the default).

If the spinner button is using horizontal arrows you can decrement and increment
the spinner value by pushing control+left/right, otherwise you can increment and
decrement by pushing up or down. The reason for needing control is so that you
can move the cursor in the textbox otherwise.

Switch the 3 apps that are currently using BSpinners to use the integer variety
in Deskbar preferences, WebPostive preferences, and Screen preferences.
diff 2f86ba45579bdc9648b232175f87edc62ab71b54 Sun Feb 15 11:23:19 MST 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
diff b09e53fae0c50ed31994c3f03d477ae2af8ab951 Sat Mar 04 22:01:15 MST 2006 Michael Lotz <mmlr@mlotz.ch> Wrote a new color conversion engine. It's 2-5 times faster than the old one (depending on colorspaces) and about half in size.
I've put it into ColorConversion.cpp and moved PaletteConverter there too, cleaning up Bitmap.cpp.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16580 a95241bf-73f2-0310-859d-f6bbb57e9c96
H A DMenuBar.cppdiff 2bcccf5a Wed Mar 03 10:43:31 MST 2010 Stephan Aßmus <superstippi@gmx.de> Patch in part by "yourpalal":
* Set the MENU_STATE_CLOSED state upon BMenu initialization.
* When drawing the label, use the parent bounds, including
item margins to truncate the label, when the parent menu is
closed.

Thanks a lot for the patch!

Changes by myself:
* Cache the MenuPrivate instance in BMenuItem::DrawContent().
* Use Window()->UpdateIfNeeded() to animate the flashing invoked menu item,
which makes a lot more sense, the comment about it working in BeOS is
probably due to item->Select() probably drawing outside of an update cycle.
* The trigger invokation in keyboard handling didn't break out of the loop
after invoking an item. Probably didn't matter since triggers are hopefully
not assigned to more than one menu item. :-)
* Use the same trick as BMenuBar to avoid interfering with keyboard navigation
in the BMenu::_Track() hook.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35739 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2f86ba45 Sun Feb 15 11:23:19 MST 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
diff 2f86ba45 Sun Feb 15 11:23:19 MST 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
diff 2ce1b3ec Wed Jan 12 04:39:56 MST 2005 Stefano Ceccherini <stefano.ceccherini@gmail.com> Cleanups


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10695 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 5b752875 Mon Jan 03 17:59:49 MST 2005 Stefano Ceccherini <stefano.ceccherini@gmail.com> The frame around the BMenu is now drawn by a special class (as happens in beos), and not by BMenu::DrawBackground(). Refactored BMenuWindow to support scrolling (not implemented yet). The AddItem() functions now call the private _AddItem(). Implemented AddList(), but it's not tested. BMenus are now offsetted by 2, 2, as in BeOS.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10582 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 5b752875 Mon Jan 03 17:59:49 MST 2005 Stefano Ceccherini <stefano.ceccherini@gmail.com> The frame around the BMenu is now drawn by a special class (as happens in beos), and not by BMenu::DrawBackground(). Refactored BMenuWindow to support scrolling (not implemented yet). The AddItem() functions now call the private _AddItem(). Implemented AddList(), but it's not tested. BMenus are now offsetted by 2, 2, as in BeOS.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10582 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2bcccf5a74b943b5cbff81d6481ee26bff244eec Wed Mar 03 10:43:31 MST 2010 Stephan Aßmus <superstippi@gmx.de> Patch in part by "yourpalal":
* Set the MENU_STATE_CLOSED state upon BMenu initialization.
* When drawing the label, use the parent bounds, including
item margins to truncate the label, when the parent menu is
closed.

Thanks a lot for the patch!

Changes by myself:
* Cache the MenuPrivate instance in BMenuItem::DrawContent().
* Use Window()->UpdateIfNeeded() to animate the flashing invoked menu item,
which makes a lot more sense, the comment about it working in BeOS is
probably due to item->Select() probably drawing outside of an update cycle.
* The trigger invokation in keyboard handling didn't break out of the loop
after invoking an item. Probably didn't matter since triggers are hopefully
not assigned to more than one menu item. :-)
* Use the same trick as BMenuBar to avoid interfering with keyboard navigation
in the BMenu::_Track() hook.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35739 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2f86ba45579bdc9648b232175f87edc62ab71b54 Sun Feb 15 11:23:19 MST 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
diff 2ce1b3ecc2644d91b7c7692614227c8d1d832761 Wed Jan 12 04:39:56 MST 2005 Stefano Ceccherini <stefano.ceccherini@gmail.com> Cleanups


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10695 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 5b7528754df83835624e2536e13c848deb58ac93 Mon Jan 03 17:59:49 MST 2005 Stefano Ceccherini <stefano.ceccherini@gmail.com> The frame around the BMenu is now drawn by a special class (as happens in beos), and not by BMenu::DrawBackground(). Refactored BMenuWindow to support scrolling (not implemented yet). The AddItem() functions now call the private _AddItem(). Implemented AddList(), but it's not tested. BMenus are now offsetted by 2, 2, as in BeOS.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10582 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 5b7528754df83835624e2536e13c848deb58ac93 Mon Jan 03 17:59:49 MST 2005 Stefano Ceccherini <stefano.ceccherini@gmail.com> The frame around the BMenu is now drawn by a special class (as happens in beos), and not by BMenu::DrawBackground(). Refactored BMenuWindow to support scrolling (not implemented yet). The AddItem() functions now call the private _AddItem(). Implemented AddList(), but it's not tested. BMenus are now offsetted by 2, 2, as in BeOS.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10582 a95241bf-73f2-0310-859d-f6bbb57e9c96
H A DInterfaceDefs.cppdiff 2f86ba45 Sun Feb 15 11:23:19 MST 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
diff 2f86ba45 Sun Feb 15 11:23:19 MST 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
diff 2bbb8288 Sun Dec 14 07:43:49 MST 2008 Jérôme Duval <korli@users.berlios.de> added get_modifier_key() as proposed by Olivier Cortes. Thanks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28812 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2d4b179d Wed Jun 15 10:49:04 MDT 2005 Axel Dörfler <axeld@pinc-software.de> Implemented B_TRUNCATE_MIDDLE, since truncate_strings() could corrupt memory
before in this mode. Some further cleanup, only B_TRUNCATE_BEGINNING is still
left.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13154 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2b7da867 Fri Aug 27 09:23:39 MDT 2004 haydentech <haydentech@nowhere.fake> Resolved some compiler warnings


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8678 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2f86ba45579bdc9648b232175f87edc62ab71b54 Sun Feb 15 11:23:19 MST 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
diff 2bbb828870b7394d876930766f208ea8ef5ea785 Sun Dec 14 07:43:49 MST 2008 Jérôme Duval <korli@users.berlios.de> added get_modifier_key() as proposed by Olivier Cortes. Thanks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28812 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2d4b179de58f8830977ee843c8da2fb77b4b7feb Wed Jun 15 10:49:04 MDT 2005 Axel Dörfler <axeld@pinc-software.de> Implemented B_TRUNCATE_MIDDLE, since truncate_strings() could corrupt memory
before in this mode. Some further cleanup, only B_TRUNCATE_BEGINNING is still
left.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13154 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2b7da867514e4ae808c5ee79993b6fd46da09f6c Fri Aug 27 09:23:39 MDT 2004 haydentech <haydentech@nowhere.fake> Resolved some compiler warnings


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8678 a95241bf-73f2-0310-859d-f6bbb57e9c96
H A DTextView.cppdiff d9385a9d Mon Jul 20 09:00:41 MDT 2020 John Scipione <jscipione@gmail.com> IK: align BTextView text rect/fix alignment

Recalculate line breaks in FrameResized() if word-wrap is on, otherwise
only move the text rect into position. StyledEdit was recalculating line
breaks before on resize (we have to in this mode) and the frame offset
updates for non-wrapping text views are inexpensive. This makes resizing
text view's work like StyledEdit everywhere.

Scroll to cursor when word-wrap setting changes if text view is editable.
If you are viewing a long document changing word-wrap can move the cursor
quite far, so scroll back to it.

Fix _ActualTabWidth() pen location for right and center-aligned text views
so that tabs widths are calculated correctly.

Reset fTextRect horizontal limits to bounds minus insets in
_RecalculateLineBreaks(), then grow fTextRect based on alignment when
wrap is off.

Fixing insets also fixes right and center-aligned BTextViews.
Left-aligned text view's grow right, right-aligned ones grow left,
and center-aligned ones grow out.

Make extra scrolling space for all aligned text views go the other way
from how it did in hrev24130 (and on left-aligned text view's too) so
that half the text is visible when you edit past the end or before the
beginnning of a text view instead of none of it.

Fixes #1651 #12608 #13796 #15189

Do not _RecalculateLineBreaks() if text view bounds are invalid.
In SetText() detect invalid text view bounds and resize the view to the
width and height of the first line. Then recalculate line breaks.
This fixes BAlert text view size issues.

Fixes #16481 (regression from hrev54496.)

Remove useless and heavy computation. There is no point in computing line
breaks for a 10px wide text view and it takes a long time because it needs
a lot of linebreaks. The view eventually gets laid out properly.

Fixes #5582 (which was not locale-related, after all.)

Only apply default insets if text rect is set to bounds. This ensures
that apps that manipulate the text rect can continue to do so without
the default insets interfering while apps that don't can benefit
from the defaults. If you want to set the text rect to bounds and
not use the default insets you must override the default by calling
SetInsets(). This prevent the default insets from being applied once
apps have changed the text rect fixing a bug in Icon-O-Matic where the
text rect insets were being applied incorrectly.

Fixes #16488 (regression from hrev54496.)

Reduce left and right insets inside text views from full label spacing
to half label spacing. Unify padding between BTextControl and BTextView.

Move fLayoutData->UpdateInsets() to private BTextView::_UpdateInsets()
because we need access to BTextView member variables when deciding
whether or not to add the default padding or not.

_UpdateInsets() changes:
* Don't update insets if BTextView::SetInsets() was called.
* Don't add default insets unless fTextRect is set to view Bounds().
* Do not set the right and bottom insets to left and top if negative,
set them to 0 like we do to left and top -- DeskCalc bug otherwise.

Fixes #15688

Other BTextView fixes:
* Replace max_c and min_c with std::max and std::min respectively.
* Remove scrolling from one instance of BTextView::SetText() as it
produced undesired results while editing a scrolled text view.
* Add default insets in _UpdateInsets()
* Fix scrolling when entering and deleting text so that some part of
the text is always visible. Make visible scroll width depend on font
size.
* Allow scrolling to a negative offset in x but not y. This allows you
to scroll the entire contents of right and centered-aligned text views
whose content does not fit in the box.
* Change _Refresh() to take an offset instead of a bool so that you can
scroll to any offset.
* Replace TextLength() with fText->Length() in a couple of places.

TextControl changes:
* Set text rect in BTextControl::DoLayout().
* Remove AlignTextRect() from TextInput.

Fix the following problems in apps:

ScreenSaver: Set text rect in PreviewView::AddPreview().
Tracker: Set "Edit name" text view insets to 2. Tweek text rect position
to be on top of label in icon, mini-icon, and list mode. Add a TODO that
the text rect is a pixel off from the name on some files.
Mail: Remove _AlignTextRect() and FrameResized() from AddressTextControl.
Use default insets on the text view, defaults are fine here.
DeskCalc: Set insets based on font size in ExpressionTextView
SetTextRect() instead of manipulating the text rect.
Remove _CheckTextRect() and related methods from InputTextView.
Icon-O-Matic: Remove _CheckTextRect() and related methods from InputTextView.
WebPositive: Remove _AlignTextRect() and FrameResized() from URLTextView
and call SetInsets().
StyledEdit: Word-wrap and FrameResized() changes ported to BTextView.

Fixes #16476 #16480 #16488 (regressions from hrev54496.)

Change-Id: Ifeca6077f8815ccd86d5a3880f99556298aaf0fe
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3152
Reviewed-by: John Scipione <jscipione@gmail.com>
diff 2ae836db Mon Apr 27 02:48:56 MDT 2009 Oliver Tappe <zooey@hirschkaefer.de> * temporarily removed parts of my last change as this completely ruins
single-lined textviews - needs some more thinking ...

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30456 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2da74964 Mon Apr 06 03:00:52 MDT 2009 Oliver Tappe <zooey@hirschkaefer.de> fixed two scalability problems that made BTextView perform rather slow
with large contents:
* when searching for tab characters in DrawLine(), we now limit the search
to the current line, too (not only the end of the style) - this avoids
scanning to the end of large contents repeatedly
* there's no need to refresh from the edit location to the end of the
content in _DoInsertText(), we only need to refresh the part that has
changed

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29960 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2f86ba45 Sun Feb 15 11:23:19 MST 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
diff 2f86ba45 Sun Feb 15 11:23:19 MST 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
diff 2a739c31 Tue Jul 15 07:17:20 MDT 2008 Stephan Aßmus <superstippi@gmx.de> Insignificant cleanup and comment typo fixes...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26420 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff b8872c02 Sun Feb 24 13:39:29 MST 2008 Stephan Aßmus <superstippi@gmx.de> BTextControl:
* Placed _BTextInput_ into BPrivate namespace.
* Made _BTextInput_::AlignTextRect() smarter, it centers the line vertically,
for the case that the BTextControl has a larger label font. Improved insets
for asthetics.
* Used _BTextInput_::AlignTextRect() consistently in BTextControl, no more
custom calls to SetTextRect(). Account for minimum vertical inset of 2
pixels in GetPreferredSize().
* Consistendly select all text when gaining focus in _BTextInput_.
* Override MouseDown() in case the control did not have focus before, or else
BTextView::MouseDown() will deselct the text again and place the cursor.
(in line with BeOS behavior)
* Removed unused fBool member from _BTextInput_ and other cleanup.

BTextView:
* Reimplemented BTextView::_AutoResize() so that it works well with
BTextControl and autoscrolling when the alignment is not B_ALIGN_LEFT.
I needed two new members for this, fLeftInset and fRightInset which are
the original insets from the fTextRects. It might currently be broken
for renaming things in Tracker, I will have to check. _AutoResize() no
longer messes up the fTextRect insets.
* Fixed stray carrets sometimes being left over, mostly when auto scrolling,
but I observed them in other cases as well.
* Prevent negative scrolling offsets when autoscrolling. Fixes weird scrolling
offsets when navigating to the left.
* Reset scrolling to B_ORIGIN when SetText() is called. Fixes for example
starting to type in the middle of the control in Vision when entering new
text and autoscrolling was triggered before.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24101 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2c2176ce Tue Jan 01 08:50:37 MST 2008 Stefano Ceccherini <stefano.ceccherini@gmail.com> Removed SetViewCursor() from BTextView::_Deactivate(), as suggested by
cl21.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23203 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2ae836dbe00be1d3d2245edc2c8657490fe6b481 Mon Apr 27 02:48:56 MDT 2009 Oliver Tappe <zooey@hirschkaefer.de> * temporarily removed parts of my last change as this completely ruins
single-lined textviews - needs some more thinking ...

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30456 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2da74964c08221fba8875a5bb1d4374ee89b86f6 Mon Apr 06 03:00:52 MDT 2009 Oliver Tappe <zooey@hirschkaefer.de> fixed two scalability problems that made BTextView perform rather slow
with large contents:
* when searching for tab characters in DrawLine(), we now limit the search
to the current line, too (not only the end of the style) - this avoids
scanning to the end of large contents repeatedly
* there's no need to refresh from the edit location to the end of the
content in _DoInsertText(), we only need to refresh the part that has
changed

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29960 a95241bf-73f2-0310-859d-f6bbb57e9c96
H A DMenu.cppdiff 2db8ba2c Fri Dec 04 08:01:57 MST 2020 Murai Takashi <tmurai01@gmail.com> Menu: Fix dead store

Fix value stored to 'flags' is never read.
Pointed out by Clang Static Analyzer.

Change-Id: Ia154fbdd4dd5fb10716cf9079625ca65e2f58122
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3472
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
diff 2e08685b Tue Mar 03 03:49:06 MST 2020 John Scipione <jscipione@gmail.com> BMenu: Rename FrameMoved and FrameResized variable names

No functional change. lowercase_with_underscore file names are not
in-line with Haiku's style guidelines.

Change-Id: I254c975ee60168963ca4039a61dc428c05e0e6ba
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2306
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
diff 5f603da0 Tue Jul 17 13:03:11 MDT 2018 Adrien Destugues <pulkomandy@pulkomandy.tk> Better shape for submenu arrow

Just use BControLook where appropriate. It already provides a nice arrow
drawing function (also used in DeskBar expander and in scrollbar
buttons).

Fix second part of #8900

Changes by John Scipione:

Update menu mark and submenu arrow color with menu text color

Use text color for checkmark and submenu arrow colors, tint less black.
This means that colored bg/white text menu item will also draw a white
checkmark and submenu arrow.

Break out BMenuItem::Draw functionality into private methods _IsActive,
_LowColor() and _HighColor() methods and use them to set the mark colors.

Scale submenu arrow and checkmark with item height (which scales with
font size.)

does not align shortcuts with submenu arrows... but if you were to do
that you'd add item->Bounds().Height() / 2.

Signed-off-by: John Scipione <jscipione@gmail.com>

Change-Id: I8299094ef88bf227510b116eb1b84c261dc94723
Reviewed-on: https://review.haiku-os.org/c/341
Reviewed-by: Stefano Ceccherini <stefano.ceccherini@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
diff 2bcccf5a Wed Mar 03 10:43:31 MST 2010 Stephan Aßmus <superstippi@gmx.de> Patch in part by "yourpalal":
* Set the MENU_STATE_CLOSED state upon BMenu initialization.
* When drawing the label, use the parent bounds, including
item margins to truncate the label, when the parent menu is
closed.

Thanks a lot for the patch!

Changes by myself:
* Cache the MenuPrivate instance in BMenuItem::DrawContent().
* Use Window()->UpdateIfNeeded() to animate the flashing invoked menu item,
which makes a lot more sense, the comment about it working in BeOS is
probably due to item->Select() probably drawing outside of an update cycle.
* The trigger invokation in keyboard handling didn't break out of the loop
after invoking an item. Probably didn't matter since triggers are hopefully
not assigned to more than one menu item. :-)
* Use the same trick as BMenuBar to avoid interfering with keyboard navigation
in the BMenu::_Track() hook.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35739 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2f86ba45 Sun Feb 15 11:23:19 MST 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
diff 2f86ba45 Sun Feb 15 11:23:19 MST 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
diff 2e2bff94 Fri Sep 12 02:09:13 MDT 2008 Stefano Ceccherini <stefano.ceccherini@gmail.com> buttons could be used initialized if locking the looper failed (CID 1134)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27440 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2a3de9bc Fri May 19 03:39:54 MDT 2006 Stephan Aßmus <superstippi@gmx.de> * use new (nothrow) when checking the returned pointer
* better handling of errors in various versions of AddItem()


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17506 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2c11ec31 Fri Mar 03 12:31:09 MST 2006 Stefano Ceccherini <stefano.ceccherini@gmail.com> BMenuItem also draws ctrl bitmap if needed, BTextView::AutoResize implemented more correctly

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16577 a95241bf-73f2-0310-859d-f6bbb57e9c96
diff 2a5bad15 Thu Feb 09 13:58:15 MST 2006 Stefano Ceccherini <stefano.ceccherini@gmail.com> Avoid menus in menufields going out of the screen in the upper part

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16316 a95241bf-73f2-0310-859d-f6bbb57e9c96
/haiku/src/kits/tracker/
H A DContainerWindow.cppdiff 2b6ccde0 Tue Apr 25 21:40:02 MDT 2023 John Scipione <jscipione@gmail.com> Tracker: Disable edit menu items on ro volumes

... such as virtual directories or read-only media.
Also applies to open/save panels.

Menu items disabled on read-only volumes:
* New >
* Duplicate
* Move to Trash
* Move To >
* Cut
* Paste

Other reasons a menu item is disabled:
* Duplicate, Move To Trash, Cut, Copy, Move to >,
Copy to >, Create link > and Identify require a
selection.
* Paste requires something in your clipboard.
* Edit name requires a single item is selected.

Edit name is permitted on a read-only volume so
that you may copy the name. However the name is
not editable, you may only select and copy.

Pop system folder warning dialog on Edit name
commit instead, this way you won't see the dialog
if you just want to copy the name.

Move "Create link here" option last in the right-
click drag menu. Disable "Move here" if source or
dest is read-only, rest if dest is read-only.

Ignore Paste to virtual directory, (even more)
but permit Edit name.

Allow drag-and-drop to virtual directory but alert
and disable all right-click drag menu items like
other read-only directories.

Tint window backgrounds on all read-only windows
darker, not just on virtual and query folders.
Automatically switch the background color as you
navigate in and out of read-only folders.

Fix highlight color on column resize when background
color is not white. Fix "reverse video" effect so
that the highlight color is the inverse of the
background color. On Desktop however, highlight
color is always black or white.

Do not alter focus in save dialogs after initial
focus on the file name because focus on the pose
view is required for cut/copy/paste to work.

Make Edit Name work in file open/save dialogs and
make Cut/Copy/Paste work while editing file name.

Make Select all work in Edit name.

Duplicate code cleanup:

NameAttributeText::CommitEditedTextFlavor() and
HeaderView::FinishEditingTitle() call common
EditModelName() function in FSUtils.

RealNameAttributeText inherits from
NameAttributeText and calls its inherited
CommitEditedTextFlavor() method.

The alert text is defined in just one place in
FSUtils ShouldEditRefName() instead of three.
Consequently file name changed in the info window
can now be undone.

Change-Id: I3a78960057b8fb42d1f71af2ec3c808754c9b314
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6357
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
diff e6c710f4 Mon Jul 06 21:40:55 MDT 2020 Augustin Cavalier <waddlesplash@gmail.com> Tracker: Set a minimum size on the count view...

...when it is paired with a horizontal scrollbar. This has the
added benefit of restoring the previous horizontal scrollbar size,
it having been lost in the prior refactor due to the "container views"
removing 2 pixels for the borders (previously, there was a different
sizing system for the count view that provided it.)

Fixes #16368 item 1.
diff 27c911e8 Tue Aug 30 14:40:35 MDT 2016 John Scipione <jscipione@gmail.com> Revert "Tracker: Add zoom padding in list mode take 2"

This reverts commit 7d009616aab2b00f0db48976625db042d141c5b1.
diff 7d009616 Sat Aug 27 00:07:18 MDT 2016 John Scipione <jscipione@gmail.com> Tracker: Add zoom padding in list mode take 2

Add 16px to right and bottom of content when zoom

fixup of last commit
diff 2d34b65e Tue Sep 15 00:51:22 MDT 2015 Jessica Hamilton <jessica.l.hamilton@gmail.com> Tracker: fix insets of vertical scrollbar.
diff 2ead925e Sun Mar 29 16:36:51 MDT 2015 Augustin Cavalier <waddlesplash@gmail.com> Tracker: fix extra border in spatial mode.
diff 2f5fe16a Sat Feb 14 16:20:01 MST 2015 Augustin Cavalier <waddlesplash@gmail.com> Tracker: delete #ifndef __HAIKU__ code.

Since tracker_layout has been merged, this is pretty useless now.
Should result in no change to generated assembly.
diff 2f60dea5 Tue Jul 29 15:11:21 MDT 2014 John Scipione <jscipione@gmail.com> Tracker: Throw exception on assert failure

... in situations where a NULL pointer dereference was vital to the
functioning of the method we use a stronger assert that throws an
exception on failure. This is accomplished by a new method in
Utilities.cpp, ThrowOnAssert().

None of these conditions should ever be true, if they are it means that
the code is written improperly and would have resulted in a NULL
dereference and undefined behavior (most likely a crash) before.

Most instances of ThrowOnAssert() either replace an ASSERT followed
by a dereference or an early return that covered the error.

Also remove _ThrowOnErrorWithMessage() which wasn't being used.
diff 888f72ca Mon Jun 09 22:59:50 MDT 2014 John Scipione <jscipione@gmail.com> Tracker: close Desktop window on switch to spatial mode

If you have the Desktop window open when you switch to spatial
mode this will now close the window. You aren't allowed to have
the Desktop open in 2 places symultaneously in spatial mode.
diff 2e6221ff Sun Jan 27 12:24:52 MST 2013 Philippe Saint-Pierre <stpere@gmail.com> Tracker: Replace usage of ceil by ceilf

Completed in 418 milliseconds

12