History log of /haiku/src/kits/interface/Menu.cpp
Revision Date Author Comments
# 0f792e57 12-Feb-2024 Jérôme Duval <jerome.duval@gmail.com>

BMenu: std::stable_sort uses a comparator function returning bool

thanks Madmax for the pointer.
fixes #18775

Change-Id: I1934c90a2976ce12c4aa8adb0205c48c239627d8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7401
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# 67380402 28-Jan-2024 PulkoMandy <pulkomandy@pulkomandy.tk>

BMenu: use std::stable_sort to implement SortItems

This fixes two problems:

- Use of a stable sorting algorithm makes sure that the relative
position between items that compare equal are not modified
- More importantly, the compare function in BList passes a
pointer-to-pointer (in this case a BMenuItem**) and this was masked by
the casts due to BList lack of type safety. So, BMenu::SortItems was
not working at all when trying to use it as its prototype would imply.

NetworkStatus and Network preferences worked around this by doing the
extra dereferencing in their compare functions. I did not find any
other places in Haiku where this function is used (it was introduced
specifically for this in hrev55562). All 3rd party code that had a
similar workaround will have to be fixed to remove it (if there is
anything using that function).

Change-Id: Ia78fd1363f2c012f6eff6f9a47e8b3aac2752ebd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7356
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>


# e91af56d 24-Nov-2023 John Scipione <jscipione@gmail.com>

BMenu: Turn on keyboard tracking on up arrow too

Set MENU_STATE_KEY_TO_SUBMENU on up arrow as well as down. This
causes the menu to check if there is a selected item even if you
aren't hovering over the menu. Previously we were doing this for
the down arrow but not the up arrow which caused a subtle bug that
humdinger stumbled upon in Deskbar where if you push the Menu key,
up, then Enter, the menu item is not activated, but if you push
Menu key, down, then Enter the menu item is activated.

Fixes #18686

Change-Id: I8dce6112603e12fb47afebb48a33b3ec6fa60230
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7140
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 4e145ead 24-Aug-2023 Augustin Cavalier <waddlesplash@gmail.com>

BMenu: Lock the looper before calling _AddItem().

Otherwise, we could wind up in a state where the
list of items is being concurrently accessed,
which is invalid.

Hopefully fixes #18256.


# e9154f59 29-Dec-2022 PulkoMandy <pulkomandy@pulkomandy.tk>

Menu: disable triggers when SetTriggerEnabled(false) is called

Triggers are a way to trigger menu items by ressing one of the letters
in their label. Normally that letter is underlined in the menu, but in
Haiku this is disabled by default and can't be enabled due to the lack
of a Menu preference (the code is there to draw the underline, still).

The trigger for each item is either assigned manually (using SetTrigger)
or automatically by the Interface Kit (picking a reasonable letter from
the label).

Triggers can be completly disabled at the menu level, however, in Haiku
this only disables drawing the underlines, and does not actually
disable the triggers, so items can still be invoked. This does not
match what is said in the Be Book. This commit actually disables the
triggers when SetTriggerEnabled(false) is called, making the keyboard
available for other uses if needed.

Possibly affected apps from a GitHub search on "SetTriggersEnabled":
- BeCJK
- 8dock
- Some of Tracker menus with lots of items, for example X-Ray menus

Change-Id: I1efa675b018fa524953c81e2dc2d456c28d6be8e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5971
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# cb0165c4 25-Aug-2022 Augustin Cavalier <waddlesplash@gmail.com>

BMenu: Adjust padding computation logic.

Instead of applying scaling factors to the font size, use
the label spacing value instead. Also, perform the computation in
_InitData(), which all constructors call, rather than in BMenu.


# 0a53cbb3 01-Aug-2021 John Scipione <jscipione@gmail.com>

BMenu: Add SortItems(), SwapItems() and MoveItem()

... methods which call the respective methods in BList.

These convinience methods allow you to sort a menu of menu items
via a compare function, swap two menu items, or move a menu item
to a new index. Update items layout if menu is open.

Previously there was no easy way to rearrange menu items in a menu.

Change-Id: Ice3d6e5404e895196d8bd32d696dce7c55bd72d4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4296
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 1aca853f 13-Jun-2021 Máximo Castañeda <antiswen@yahoo.es>

BMenu: fix menu items width in column layout

Change-Id: Ia16d51ff31760fef28bcceeab7b5c26a05cfbdad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4092
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# e41899a6 07-Jun-2021 Máximo Castañeda <antiswen@yahoo.es>

BMenu: fix scroll activation

Fixes #14932

Change-Id: I72b16a26ea4d3cef0e9518381c583b23bdcadc22
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4078
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: humdinger <humdingerb@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 46c95b5d 06-Jun-2021 Máximo Castañeda <antiswen@yahoo.es>

BMenu: move menu over the menu bar only if there's more space there

Fixes #16773

Change-Id: I465c2f4366c11b7b0bacaed57c3d8fd33defe8a2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4077
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 2db8ba2c 04-Dec-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>


# 529fedc7 07-Mar-2020 X512 <danger_mail@list.ru>

Interface kit: Resize menu if invalidated.

Change-Id: I45a966b13be6953431a1176378e4ddc10920916b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2325
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: X512 <danger_mail@list.ru>


# cf7c2ea6 04-Jul-2020 Augustin Cavalier <waddlesplash@gmail.com>

BMenu: Make margins/padding more HiDPI-aware.

This greatly improves the appearance of menus under font-scaled systems.
The computations are written such that the margins should be unchanged
under a 12pt font size.


# d9d96260 01-Jul-2020 X512 <danger_mail@list.ru>

BMenu: speed up deleting items

Fixes #16336.

Change-Id: Ie941f45f363f6fe94062fc3acb8bd3bb876c1f1e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2976
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 66f0993a 02-Jul-2020 waddlesplash <waddlesplash@gmail.com>

Revert "BMenu: fix memory leak in scripting"

This reverts commit fb44a1cd7204b88987cd1370cb1a5ccf30d479d5.

Reason for revert: may cause UAFs

Change-Id: I315ce4fc5cd1706ca07e7062fc0461b7fff7c831
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2980
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# fb44a1cd 02-Jul-2020 X512 <danger_mail@list.ru>

BMenu: fix memory leak in scripting

Change-Id: Ia283594a622f758189cc8280683a4e068ae1f3af
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2978
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 8fbce873 21-Jun-2020 X512 <danger_mail@list.ru>

BMenu: implement scripting

Fixes #15540.

Change-Id: I965d04bcbb6db41cc7a744d18fa3c9ffab2a81f1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2941
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 9b33a309 04-Mar-2020 X512 <danger_mail@list.ru>

Interface Kit: fix menu resizing when scrolling is enabled

BMenuWindow::Attach/DetachScrollers can be called when scrollers are
already attached/detached and it should handle this case properly.

Call BMenuWindow::DetachScrollers when scrolling is not needed anymore.

Fixes #8513.

Change-Id: I1f70b63d75106cf33ab1f72d34e221a54b45a75e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2310
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>


# 2e08685b 03-Mar-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>


# fa60e7a6 24-Feb-2020 X512 <danger_mail@list.ru>

BMenu: remove delay when opening submenu with mouse

Fixes #11703.

Change-Id: Iae01eeffee27ecde5bb333c85b8c3cb411f1bd00
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2274
Reviewed-by: Sergei Reznikov <diver@gelios.net>
Reviewed-by: humdinger <humdingerb@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 17a91a98 02-Jan-2020 X512 <danger_mail@list.ru>

BMenu: fix menu navigation area

Change-Id: If9326ebc99978627d9dfb1eaff67912f0114f292
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2071
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# e10de1ec 12-Jul-2018 Ryan Leavengood <leavengood@gmail.com>

Visually align shortcuts in menus

In a menu, we use the right side both for submenu arrows and shortcuts.
As a result, when an entry has both a shortcut and a submenu, its
shortcut is not aligned with others, and this does not look so nice.

The spacing for the arrow appears only if there is a submenu in any of
the items in the parent menu.

Change-Id: If91fdcdad36abb0141fb05d1f59141f89540c1db
Reviewed-on: https://review.haiku-os.org/c/haiku/+/355
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Ryan Leavengood <leavengood@gmail.com>


# f146f74b 20-Aug-2019 X512 <danger_mail@list.ru>

Fix BMenuBar width


# 5f603da0 17-Jul-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>


# 0a973154 08-Jan-2019 Augustin Cavalier <waddlesplash@gmail.com>

BMenu: Look for ASCII characters < 128, not < 255.

Otherwise we will include ISO 8859-15 (é, à, etc.)
Thanks to PulkoMandy for pointing this out!


# 52a022f2 21-Dec-2018 Augustin Cavalier <waddlesplash@gmail.com>

BMenu: Accept any alphanumeric ASCII character on the first trigger pass.

Since we use sentence-cased menus, there is probably only one capital
letter in the line, so looking for only capitals won't be very useful.
Instead, accept any ASCII character (< 255) which is alphanumeric,
as these are more likely to be command-able in any given keymap.

(IsAlNum returns true for accented Latin characters also, which may
be un-command-able if they require dead keys to type.)


# 588a0c9f 11-Dec-2018 Adrien Destugues <pulkomandy@pulkomandy.tk>

BMenu: Use BUnicodeChar for unicode char manipulation.

It is not allowed to use isspace, tolower, etc, on character outside of
the char type range (and EOF). Use BUnicodeChar instead to avoid out of
bound accesses.

Fixes the second crash in #14753.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
Some changes by me to make "index" a byte instead of character index
as it needs to be.


# 9ece4920 17-Jul-2018 David Murphy <murphman@gmail.com>

BMenu: BMenuBar submenus at screen edge moved onscreen instead of scrolling

Fixes #9093
Change-Id: I1322c0cd8ba4bbfddace037ed8a8ef666ebe7fe3


# e3f7fe94 16-Jul-2018 David Murphy <murphman@gmail.com>

BMenu: Submenu opening direction follows parent opening direction

Fixes #4859
Change-Id: I8e89afc3ad982d899428e3038fed354a78d04981


# e4433ad0 07-Jul-2018 David Murphy <murphman@gmail.com>

BMenu: Fix crash and keyboard navigation on 'recent items' menus

* Prevents crash mentioned in Trac, but also enables keyboard navigation
to 'recent items' menus such as "Open files..." in MediaPlayer and DiskProbe
* Check selected menu and submenu exist in menu tracking thread before accessing
* Update BMenu::AttachedToWindow to pass in keydown param to _AddDynamicItems

Fixes #9251
Change-Id: I3031b8e9c1b9dd4ef1187c5a6b8ab7925e3496d2


# 346d1496 05-Nov-2017 Humdinger <humdingerb@gmail.com>

Properly terminate property_info lists

BListView's property_info list lacked termination, resulting in
garbage output at the and of 'hey getsuites'.

Use { 0 } everywhere for sake of consistency.

Thanks to waddlesplash for spotting the bug an providing the easy fix.


# bfbb9655 10-Sep-2017 Augustin Cavalier <waddlesplash@gmail.com>

Interface Kit: Remove more non-BControlLook code.


# ca766a50 19-Apr-2016 John Scipione <jscipione@gmail.com>

BMenu: Offset the menu field's menu window left 8px

...so that the text when the menu is closed lines up with the text
when the menu is open.

The checkmark is draw to the left of left edge of the closed menufield.


# b75a2e9d 19-Apr-2016 John Scipione <jscipione@gmail.com>

BMenu: Add default padding to ctor


# dcecaf60 19-Apr-2016 John Scipione <jscipione@gmail.com>

BMenu: Remove _ from protected method _DrawItems


# 61dfdec4 19-Apr-2016 John Scipione <jscipione@gmail.com>

BMenu and friends: style fixes

BMenuBar: style fix: msg => message

MenuPrivate: style fixes

MenuItem: 80 char limit style fix

MenuBar: tiny style fix

Menu: tiny style fix, indentation

Menu: Small refactor

Implement _SetIgnoreHidden() in header
Change on to ignoreHidden
Change on in _SetStickyMode to sticky

_BMCItem_: tiny whitespace style fix

Menu: style fixes, rename msgr => messenger

BMenu: style fix, pointer != NULL

BMenu::Archive rename ret to status

Also check pointer against NULL explicitly

BMenuItem style fixes: rename abbreviation, pointer style


# 7a96554c 09-Dec-2015 looncraz <looncraz@looncraz.net>

kits/interface: Convert to using Set*UIColor.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
Patches 0003-0017 from looncraz, unmodified.


# ac9ec47d 09-Sep-2015 Axel Dörfler <axeld@pinc-software.de>

BMenu: made left side padding font size relative.

* Also changed BMenuItem to make better use of that size.


# fb4ea396 04-Aug-2015 Augustin Cavalier <waddlesplash@gmail.com>

BMenu: Check return value of LockLooper().

CIDs 602450-602452.


# c4793b24 17-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

fix adding or removing items to an open BMenu

The menu would try to relayout itself, but fail to get the supermenu
bounds as the looper for it was not locked in that case.

This fixes the crash with two downsides:
* The menu width isn't adjusted to match the parent menu (mostly visible
in BMenuFields)
* There is some flickering as the menu is updated

Fixes #9863 (Network prefs part).


# 0eb59784 18-Oct-2014 Adrien Destugues <pulkomandy@gmail.com>

BMenu: don't invalidate layout when changing marked item

* The layout does not need to change. The label may change in
SetLabelFromMarked mode, but this only affects the layout of the parent
menu.
* This would crash when programatically changing the menu marked item
while the menu is open.


# ca6cc0aa 24-Apr-2014 John Scipione <jscipione@gmail.com>

BMenu: Replace min_c and max_c

... with std:min and std:max


# b7096fd7 23-Apr-2014 John Scipione <jscipione@gmail.com>

BMenu: remove useless default case


# cb30cf14 22-Apr-2014 John Scipione <jscipione@gmail.com>

BMenu: style fixes


# eb539d59 22-Nov-2013 Julian Harnath <julian.harnath@rwth-aachen.de>

Don't try to open another menu window if there already is one.

* Fixes crash when using Gobe Productive toolbar.


# 9a9ebda4 05-Nov-2013 John Scipione <jscipione@gmail.com>

BMenu: Some style fixes related to docs

Mostly just making the variable names match between the
header and source.

No functional change intended.


# 40082f76 31-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BMenu: Update comment


# 0b4c2d32 31-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BMenu: Use shift modifier for page-wise wheel scrolling

Fixes part of #9907.


# c29f2d22 25-Oct-2013 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Close the menu on keypress.
After _InvokeItem(), call QuitTracking() to close the menu.
Incidentally this also seems to fix #9863.


# 4385f739 25-Aug-2013 John Scipione <jscipione@gmail.com>

Revert "Menu: check numBytes == 1 on KeyDown"

This reverts commit 44dc533861d5e6c8c80f3ed89d6dfb4b8a30c724.


# 60a7f115 24-Aug-2013 John Scipione <jscipione@gmail.com>

Menu: Handle Keyboard input better.

When you push an arrow key obscure the cursor so that it doesn't get in the
way of the menu items. BeOS R5 also did this.

When you select an item with Enter or Space, or cancel with Escape, set the
super menu to close in _QuitTracking() if you've specified onlyThis == false.
Also, show the cursor here in case you haven't moved the mouse since it was
obscured.

This fixes a problem where when you select an item in a menu via the keyboard
while your mouse is over the parent menu item or menu field it would pop the
menu back up again even though you've made your selection or cancelled.


# 44dc5338 24-Aug-2013 John Scipione <jscipione@gmail.com>

Menu: check numBytes == 1 on KeyDown


# cccc4076 24-Aug-2013 John Scipione <jscipione@gmail.com>

Menu and friends: Style fixes, no functional

... changes intended.

* 80 char limit fixes
* Indentation fixes
* Braces style fixes
* Use ternary operator where appropriate
* Rename menuItem to just item and declare it once outside
the loop
* Omit 3rd param of GetMouse() because it is default
* Rename variables eg state => focused and menu => submenu
* Indent comments below line they apply to
* Reword some comments
* Add some #pragmas


# f5bb8311 23-Aug-2013 John Scipione <jscipione@gmail.com>

Menu: Silly code optimization

Always set releasedOnce to true here instead of setting it true in the
case that it is false. It's almost certainly faster and clearer to always do
the assignment than to incur the cost of the conditional and branch.


# d5de9547 21-Aug-2013 John Scipione <jscipione@gmail.com>

Menu: some helpful comments


# 408c0ee4 20-Aug-2013 John Scipione <jscipione@gmail.com>

MenuField: enable/disable the menu field when...

the child menu bar or the child menu bar's menu is enabled/disabled.

This means that there is just one status we have to check, the menu
fields, and the child menus agree. This change takes practical form
in the Backgrounds preflet which disables the placement menu when
the image is set to "None", but, only the menu got disabled and not the
parent menu field so the label was erroneously still drawn as enabled.


# 83ea4af4 20-Aug-2013 John Scipione <jscipione@gmail.com>

BMenu: Don't hit test separator items

Fixes #4147 while not causing the regression described in #6610
like hrev35248 did.


# 77850e8d 20-Aug-2013 John Scipione <jscipione@gmail.com>

Revert "BMenu return only enabled items"

Patch by "stimut"

This reverts commit abc26ba8ad02a8394a30dece78ba443fc099b81d.

Reverting this patch fixes #6610


# 6da3c1c7 29-May-2013 John Scipione <jscipione@gmail.com>

if menu _BMCMenuBar_ subtract the popup indicator width

... when calculating the width of items in _ComputeLayout. This prevents
that menu field from growing on selection fixing #9796 and #2413.

Also a few style fixes.


# d5c51ba6 06-May-2013 John Scipione <jscipione@gmail.com>

Update header comments


# d97b4340 06-May-2013 John Scipione <jscipione@gmail.com>

Style fixes to BMenu and related classes.


# 5041cdf4 03-May-2013 John Scipione <jscipione@gmail.com>

Fix a few minor BMenu issues, follup on hrev45610

Only AttachScrollers() and scroll if B_ITEMS_IN_COLUMN because if not we don't
support scrolling anyway. Also, rename superpoint variable to superPoint.


# 4898c615 03-May-2013 Jessica Hamilton <jessica.l.hamilton@gmail.com>

BMenu: scroll marked item into view when menu has scrollers attached.

Signed-off-by: Axel Dörfler <axeld@pinc-software.de>


# 50120176 13-Apr-2013 Stefano Ceccherini <stefano.ceccherini@gmail.com>

In case the BMenu is inside a BMenuField, override the items width to
span over the BMenuField's width. Note that if the BMenu is already
wider, we don't shrink it, at least for now.
Fixes #5015.


# 3ef837fd 12-Apr-2013 Stefano Ceccherini <stefano.ceccherini@gmail.com>

If a submenu was opened, the parent menu tracking loop would continue calling
_HitTestItems() even if the user didn't move the mouse.


# 49126a0e 03-Jan-2013 Tri-Edge AI <triedgeai@gmail.com>

Added ResourceEdit and modified BColumnListView, BRow and BMenu.

Signed-off-by: Matt Madia <mattmadia@gmail.com>


# afa1c291 21-Jul-2012 John Scipione <jscipione@gmail.com>

Tweaks, remove dead code. Menu and Menubar are stock again.


# 49ff476d 19-Jul-2012 John Scipione <jscipione@gmail.com>

Make ScrollMenu not rely on Menu.cpp

Rename ScrollMenu.cpp to MenuScrollView.cpp

Half step towards making this class work as part of Deskbar without
extending any other classes. Scrolling works both with mouse and
scroll wheel. Redraws on scroll, need to make that work better.
Also need to move classes out of the Interface Kit and into Deskbar.


# cb55ef9f 27-Jun-2011 John Scipione <jscipione@gmail.com>

WIP: Created a BScrollMenu class that works like BMenuWindow but works on a view instead of a window. Use this to implement a scrollable BarMenuBar in Deskbar. The basics work but there are issues still with sizing and other issues.

Modify the ScrollMenu class to use the layout kit by adding a constructor that doesn't take a view.

Get the BScrollMenu class to follow the size of the BMenu it is a parent of. Adjust the scrollers to appear in the right places. This is a WIP but it works in Deskbar, next step is to integrate this directly into BMenu with the scrollers as children of the menu instead of as children of the BScroller class.

Rebase changes on top of master

Deskbar scrolling works for the most part, just need to fix the
bottom arrow and clean up a bit.


# 0eed2a7c 02-Aug-2012 Ryan Leavengood <leavengood@gmail.com>

Fix flickering menus, especially menu bars.

Figured out by Stephan originally and only hacked in WebPositive, I knew
something about WebPositive was different because it did not flicker when
everything else did.

Since we fully draw the menus there is no need to have app_server fill in the
background with the view color. That is what was causing the flickering.

Should fix #484, #532 and #4335. Thanks diver for confirming the patch against
those tickets.


# 9be774b5 30-Jul-2012 Alex Smith <alex@alex-smith.me.uk>

Compilation and 64-bit fixes to libbe.so sources.

Fixed the usual issues - printf format strings, uint32 instead of
addr_t, etc. One thing that isn't so nice is several places where
BList is used to store (u)int32, these require a double cast to addr_t
then void* to silence a warning on x86_64.


# 546208a5 16-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

More catalog-related cleanup.

* rename B_TRANSLATE_CONTEXT to B_TRANSLATION_CONTEXT and
B_TRANSLATE_WITH_CONTEXT to B_TRANSLATE_CONTEXT, squashing a TODO
* adjust all uses of both macros in Haiku's source tree
* use correct header guard for collecting/Catalog.h

The renamed macros require adjustments to all external applications
using catalogs.


# eaa5e093 14-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

Fix #8452 (app's crashing for non-existent system catalog)

* make the system catalog a BCatalog instead of a BCatalogAddOn*,
such that using a non-existing system catalog won't crash but
simply return the untranslated string instead
* rename MutableLocaleRoster::GetSystemCatalog() to LoadSystemCatalog()
and adjust it to use BCatalog::SetTo() in order to replace the
data used by the given catalog
* adjust all users of gSystemCatalog accordingly


# 60f75e90 04-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

Merge liblocale.so into libbe.so.

* Make the locale kit a part of libbe.
* Drop the LocaleBackend kludge used from within libbe (and from
other places, too) in order to access system catalog strings.
This is now done via gSystemCatalog, which is provided and initialized
by libbe.
* Drop all references to liblocale.so from all Jamfiles.
* Add legacy symlink liblocale.so in order to keep optional packages
that rely on it in a working state.

TODO: the documentation hasn't been updated.


# 577265d1 31-Mar-2012 JackBurton <stefano.ceccherini@gmail.com>

Avoid calling BMenu::HitTestItems() if the cursor is over a submenu.


# 92894183 03-Mar-2012 JackBurton <stefano.ceccherini@gmail.com>

Fix Indentation


# 417c123c 03-Mar-2012 JackBurton <stefano.ceccherini@gmail.com>

Fix indentation


# 7327891c 25-Feb-2012 Jerome Duval <jerome.duval@gmail.com>

interface kit: added compatibility symbols for BeAE for #8354

* _ZN5BMenu16InvalidateLayoutEb for GCC4
* InvalidateLayout__7BSliderb for GCC2


# c8df0c9b 18-Dec-2011 Rene Gollent <anevilyak@gmail.com>

BePDF needed this one to be added as well.


# 29ef6eb5 08-Dec-2011 Alex Wilson <yourpalal2@gmail.com>

Fix BMenu behaviour/ABI by reinstating BMenu::InvalidateLayout()

It turns out,this is an old method added by Be, and is not really related to BView::InvalidateLayout(bool). In fact BMenu::InvalidateLayout() does something separate, but related to the BView method. I was wrong to delete this method, since it needs to have action taken each time it is called, so moving these actions into LayoutInvalidated() only worked sometimes (when the BView was considered to have a valid layout).

I have added a comment for future hackers so that they don't delete this method.


# 8abe72fb 06-Nov-2011 John Scipione <jscipione@gmail.com>

Changes the menu key bitmap from CTL to CTRL and SHFT to SHIFT.

This is coming from but does not close #7967

Adds a new (currently unused) Menu key bitmap.

Instead of having a single AltAsCommandKey() method the menus now
show the correct bitmap when you switch between your control,
windows/option, and alt/command keys. This is really not flushed
out yet since it only works when you switch those keys and not
other combinations like say switching the control and caps lock
keys but it is a step in the right direction.

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


# 61eb1f1d 22-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

Replace remaining InvalidateLayout()'s with LayoutInvalidated(). Also do a bit of cleanup/move methods around.


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

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


# e750d35c 06-Jun-2011 Stephan Aßmus <superstippi@gmx.de>

Applied patch by Pete Goodeve from ticket #7182. It improves
keyboard navigation/tracking of BMenus and BMenuBars, although
many issues remain.
Should not yet go into alpha, since there is one issue which
I am not sure if it's not a regression. The issue is that
invoking a menu item with Enter for the first time seems to
have no effect, while invoking it subsequently works as
expected. I don't know, yet, if that's a regression of this patch.
In any case, it's better than before, thanks, Pete!


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


# 4115645a 17-Mar-2011 Siarzhuk Zharski <zharik@gmx.li>

Localization of some UI parts:
- context menu of the replicant dragger. Fixes #7363;
- default <empty> menu placeholder. Fixes #7072;
- other messages used in PrintJob, Dragger and ZombieReplicantView classes.



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


# 77b7e18a 07-Jan-2011 Ryan Leavengood <leavengood@gmail.com>

Revert my hack from r40132 and just go ahead and fix our pop-up menu behavior
by forcing openAnyway and creating a clickToOpen rect if there is not one.
Should fix #7022 and maybe others. Partially based on the patch from #7022 and
Travis Reed's patch from the mailing list discussion in December.


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


# f8f64f9a 06-Jan-2011 Ryan Leavengood <leavengood@gmail.com>

Make pop-up menu behavior more like BeOS (though this still is not ideal):

If the menu opens right under the mouse cursor, do not select or invoke an item
until the mouse is moved. Since this seems to break normal menu bars, I added
the check for fSuper. As a (bad?) side effect BMenuField menus also need mouse
movement before something is selected. If anything else is broken, let me know.

I'm committing this because it does remove some bad behavior in pop up menus
(unintentionally selecting items.)

We may also want to force the openAnyway behavior as discussed on the mailing
list in December.

In general though the menu handling code really should be redesigned/refactored.


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


# 9b741428 09-Jul-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Move assigments a bit earlier, so they aren't done at every loop.
Thanks to Sean Bailey for watching after me.


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


# 821a9b03 09-Jul-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Renamed attachAborted to addAborted
Use fAttachAborted in AttachedToWindow().



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


# 8460e00c 30-Jun-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

_AddDynamicItems didn't pass the keyDown parameter to _OkToProceed (noticed
by Ziusudra).
Also removed leftover fDynamicItemsAdded.


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


# 7ecc0417 25-Jun-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed use of fDynamicItemsAdded, since it can't work like this.
Since a custom BMenu can remove the added items whenever it wants,
they wouldn't never be added back if the menu wasn't destroyed
and recreated


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


# 780b76dc 25-Jun-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Applied patch by Ziusudra in ticket #4930 to avoid a deadlock when
navigating the menus via keyboard.
I also factored some code into functions, in particular the code to
add the dynamic items. Also keep track if the dynamic items have been added
or not (using a new boolean class member).
I tested for regressions but couldn't find any.



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


# 8345d755 15-Jun-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Don't set the width and height of the view in the constructor,
otherwise some other calculation screws up later, and the menu frame ends up
to be offsetted by its height. Fixes ticket #6159.


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


# 0cf1ecfb 14-May-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by Ziusudra: Fixes navigation in to and out of sub menus with the cursor
keys. Thanks! Closes ticket #5996.


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


# 52883718 14-May-2010 Stephan Aßmus <superstippi@gmx.de>

Rewrote BMenu::_NextItem(), since it could busy loop when there was no item.
The new code should be a little easier to follow. IMHO, there were also problems
with detecting and breaking out of a full cycle, in case there was no start
item passed to the method.


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


# 6f05b102 11-May-2010 Stephan Aßmus <superstippi@gmx.de>

Removed stuff which was completely unused.


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


# 676a46d5 08-May-2010 Stephan Aßmus <superstippi@gmx.de>

fSelected was accessed unchecked in _UpdateStateOpenSelect(), but the method
can be called without any item being selected yet. In that case, fall back
to just select the item and return (setting fSelected). I've had Tracker
crash with a BT that suggest this was the case, when I invoked some context
menu.


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


# cd9af8e7 01-May-2010 Rene Gollent <anevilyak@gmail.com>

Reverted r35463 and applied a patch by Stefano to handle the Terminal context
menu issue a different way. Should fix #5835.


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


# f7b6636a 24-Apr-2010 Rene Gollent <anevilyak@gmail.com>

Don't set releasedOnce unless we actually detect an appropriate change in mouse button states. Otherwise we could mistakenly invoke menu items when not desired. Fixes the other part of #3267.



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


# 8e23974b 23-Apr-2010 Rene Gollent <anevilyak@gmail.com>

After looking for items/submenus, always update the closed state at least once before mouse polling. Otherwise the click to open sticky setting would sometimes not get evaluated until after the mouse cursor had already moved outside of the click to open rect. Fixes ticket #3267.



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


# 76d5e064 19-Apr-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Partially revert r35962, since the cure is worse than the sickness.
Should fix #5717 (but probably reopens #3103)


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


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

bonefish+stippi:
All views which cache layout information need to call ResetLayoutInvalidation()
when they have updated the cached information. Otherwise calling
InvalidateLayout() once they are already attached to a layout may not have any
effect.


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


# bb2576f0 26-Mar-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed some code which was added to fix a crash, which was obviously fixed
correctly later in another way.
Removing this code should also fix ticket #3103.
Use the width of the Bitmaps instead of fixed values.


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


# 8c3d172b 03-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Fixed hovering over a sub-menu to let it open automatically, which I broke
with my previous commit.


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


# 2bcccf5a 03-Mar-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


# abc26ba8 23-Jan-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by "stimut": Fixed BMenu to return only enabled BMenuItems when invoking
them via mouse. This will make the mechanism that BSeparatorItems are always
disabled actually work and the behavior correct for other items as well. It also
fixes #4147 (Magnify crashing because it assume all its items have a BMessage).

Thanks a lot!


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


# af10de93 28-Nov-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Changed a comment


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


# 075cff30 29-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Also resize the window if it wouldn't fit on screen otherwise.
* Fixes bug #3675.
* Minor cleanup.


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


# 13e50c47 25-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

* Indentation cleanup.
* 80 chars limit
* Copyright fixed.
* Better grouping of methods.

+alphabranch


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


# d587e0fb 21-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Not sure why we are that generous (copying BView behaviour), but pressing
Alt, Option, or Control while scrolling the menu via the mouse wheel now
scrolls page wise.


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


# 12194e33 07-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Added missing default initializer for the message.
* Changed BMenuField::MenuBarLayoutItem::BasePreferredSize() to return the
min size as well, instead of a fixed 100 pixels for the width...
* More minor cleanup.


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


# 50f8cd14 07-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Cleanup, no functional change.
* Remove superfluous operator=() implementations.


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


# dcc8ae91 01-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Some cleanups: made the bitmaps static, moved variables around. No functional change.


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


# 33e0d2e4 30-Jul-2009 Rene Gollent <anevilyak@gmail.com>

Also remove no longer needed variable.



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


# 5171d87a 30-Jul-2009 Rene Gollent <anevilyak@gmail.com>

Removed stray debug printf.



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


# 7a8567e6 30-Jul-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved MenuPrivate implementation to its own file. Made MenuPrivate.h
self-contained. Adjusted other files accordingly.


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


# c3d7cee2 30-Jul-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Instead of creating the Modifiers bitmaps on demand, for every DrawItem invocation,
for every BMenuItem, have them created in _init_interface_kit(), and keep
them cached. This required some reorganisation of the code in Menu and MenuItem.
Also has the side effect that BMenuItem doesn't have to know about the
alt/ctrl/command keys stuff.
Added a comment in BMenu::AttachedToWindow().


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


# 4e23bc03 02-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* BMenu now scrolls when you press page up/down, if possible.
* BMenuWindow no longer uses a fixed scroll step - instead, the menu sets it
to the height of its first item.
* Cleanup.


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


# c6278c8f 07-May-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Lock the root menu before calling BMenuItem::Invoke(). This fixes #3842, although in some circumstances could introduce a deadlock (if someone does strange things in Invoke(), for example).

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


# a48d16a0 07-May-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

BMenuItem didn't draw the modifier indicator for B_OPTION_KEY. Fixes ticket #3887

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


# fdfeaa4e 25-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Small code simplifications. No functional change.


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


# c7bb90f8 14-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Improve cosmetics when menu scrollers are shown. The menu is not supposed to
draw all of the frame (no top/bottom borders).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29532 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


# 6eb09230 01-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

* Resolve further warnings on GCC4.
* Enable -Werror on GCC4 builds as well (limited to the same selected targets).


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


# 321bba93 19-Jan-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Vertical menu scrolling was enabled also in case the menu was wider than the screen, but this is obviously wrong. The menu window was also resized to be the height of the screen in this case, and it was the cause of bug #3174. Note that horizontal scrolling is not yet implemented

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28954 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


# e58419d3 02-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* White space cleanup.


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


# 4e0c2a79 03-Oct-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Menus can be scrolled also using the mouse wheel

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


# 18fe1bf6 20-Sep-2008 Stephan Aßmus <superstippi@gmx.de>

Small fix for 80 char/line limit.


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


# c7d112ff 20-Sep-2008 Karsten Heimrich <host.haiku@gmx.de>

* unmark existing marked items in case we add a new item that is marked
i did exactly that way in my code, which messed up the location popup



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


# d1fe8034 20-Sep-2008 Karsten Heimrich <host.haiku@gmx.de>

* automatic whitespace cleanup



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


# 2e2bff94 12-Sep-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


# 009aa366 20-Aug-2008 Alexandre Deckner <alex@zappotek.com>

- Changed Alt/Ctrl mode handling in Menu prefs, BMenu and Appearance
prefs as discussed in #2139 comments. This allow using Alt-Gr in either
Ctrl or Alt mode. Appearance needs a serious style cleanup, comming next
:)


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


# ebdb1a61 22-Jul-2008 Stephan Aßmus <superstippi@gmx.de>

Just small white space cleanup.


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


# c3f006de 12-Jun-2008 Alexandre Deckner <alex@zappotek.com>

- initialize the variable, we never know :)


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


# 709ef827 12-Jun-2008 Alexandre Deckner <alex@zappotek.com>

- BMenu caches the preferred size (since r21396) but didn't recompute it if the ResizingMode changed, it did it only in
InvalidateLayout().

This fixes #1461, the bug appeared because DraggableContainerIcon uses a special trick, involving changing the resizing
mode, to get the total width of the menu items. (see tracker/ContainerWindow.cpp line 479)


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


# 18af47f5 11-Apr-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Renamed some private methods to have the underline prefix, now that
BWindow doesn't call them directly anymore.


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


# 10f4d067 11-Apr-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added a class MenuPrivate to handle access to private BMenu methods.
BMenuItem and BWindow are no longer friends of BMenu, but use this class
instead.


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


# 47ed33e0 19-Mar-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Apply the same logic of BMenu::_Track() also in BMenuBar::_track():
check if mouse is over a submenu and then if it's over the current menu.


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


# 5c30ed35 07-Mar-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

If a NULL menuitem was supplied to BMenu::_NextItem(), the function
would have returned the second item in place of the first. Also return
NULL, not false, when there are no "next items".


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


# 495949fc 02-Mar-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

x_offset -> xOffset


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


# dc93a6b1 01-Mar-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Applied patch by Denis Washington which implements "diagonal mouse
support" for menus (see ticket #284). Thanks a lot!


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


# 47d3c506 21-Feb-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Change the order we use to check the position of the mouse pointer
inside menus: first sub, then current, then super. It's more logical,
and handles every case (hopefully I've tested every possible
combination) of overlapping menus correctly.
Fixes bug #1821.


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


# 5cc2ed98 30-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Don't close a submenu if the mouse is outside the parent menu.


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


# cc5d5e7a 15-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Reduced the time used for the vmware workaround


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


# d01f3af1 15-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Menu tracking now ignores mouse movements if they are too fast
(suggested by stippi). The movement threshold will be subject to
changes, as I only tested on vmware and it's probably too high.


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


# 6e11b3f9 10-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Close the whole menu hierarchy when invoking an item via keyboard. Added
a TODO comment.


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


# cb6cd9af 11-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

BMenu::_SelectNextItem() also opens the menu if we're inside a menubar.
That way menubars are navigable via keyboard. There are still glitches,
but menu keyboard navigation works now.
Minor optimization: cache the value of CountItems() instead of calling
it multiple times.


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


# 737ce1c0 10-Jan-2008 Axel Dörfler <axeld@pinc-software.de>

* The keyboard target was always the first menu in the window list - no matter if that was hidden or not.
This fixes the bug described by Stefano in r23343.
* Therefore, I enabled cached menu windows again.


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


# 0625889c 10-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

IsModal() now includes also the kMenuWindowLook. Fixes bug #1269. Please
review.
Added a compile time option to switch off the use of the cached menu
windows. Looks like there is a problem with the focus system, if I keep
the cached menu window around, it "steals" keyboard events from the main
app window after the menu has been opened and closed once.


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


# 85e661db 10-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Merged (parts of, for now) patches from Rene Gollent and
Christof Lutteroth, which improve menu keyboard navigation. Sorry for
the delay, I had these patches sitting on my hard drive for a while. At
least now you can open a menu with ALT + ESC, navigate it with the arrow keys,
and invoke an item.
Various issues still exist, including: menubars don't get the keydown
messages, and if you keep the mouse over the menu while navigating
with the keyboard, nothing will happen.


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


# 20817b77 07-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Double sorry...


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


# 598ea11c 07-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Sorry, this wasn't meant to be here.


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


# 3e06c4fa 07-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Improved the code still a little bit. Menus seems to be somewhat more
responsive.


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


# 8d44324f 07-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Same thing as previous commit, only for BMenuBar. Added some other
comment


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


# 14e826c4 07-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Some changes in menu tracking:
- in the code path, now it's clear if the looper is locked or not
- if menus are quitting, now we don't call snooze() anymore, and avoid
the extra GetMouse() call.
- some other cleanups


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


# 7957219e 07-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed a check which was always false.


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


# c129260a 03-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

There was a reason for this after all: Sometimes hovering from the
submenu to the parent didn't trigger tracking from it.


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


# 9e64a7ed 03-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed problem with some popup menus (check ticket #1679)
Moved GetMouse() calls near the check for exit conditions.
Reorganized a bit the code, and hopefully simplified it in some places.


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


# 4b812f29 01-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Set sticky mode to the correct value before calling BMenu::_Track().
Fixes bug #1679


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


# 423e822a 28-Nov-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Only enlarge the menus if there's a submenu symbol (regression). Fixes
bug #1647.


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


# c053b4a9 19-Nov-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved call to _DeleteMenuWindow() to a better place

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


# 82a54995 07-Nov-2007 Axel Dörfler <axeld@pinc-software.de>

* Fixed _ComputeColumnLayout() optimization introduced in r22658: it actually
never worked correctly for any case which was very visible in Tracker (and
especially so if you had "sorting apps" turned on).
* Removed superfluous white space at the end of lines.


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


# afd60167 07-Nov-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Reverted r21395. Many people didn't like the change, and after all I too
think it wasn't a really good idea. The alignment of shortcut
charachters and submenu symbols could use some more work, though.


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


# 795a2888 29-Oct-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Rewrote PopUpMenu.h and MenuBar.h. Adjusted source files accordingly.
Added license to SeparatorItem.h


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


# 7bd24def 22-Oct-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

At least for the column menu layout, don't recalculate the whole layout
if the calling function supplied an item index.


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


# 083de48a 30-Sep-2007 Axel Dörfler <axeld@pinc-software.de>

* Rewrote the trigger selection mechanism: it now searches for uppercase
characters first, and then falls back to take everything. fTrigger is now
uint32 and works with all unicode characters; unlike in BeOS, the
MenuTriggerTest application now works correctly in Haiku.
* fTriggerIndex is now a character position, not a byte position of the label;
this allows BMenuItem::DrawContent() to draw the trigger at the correct
position, even if there are multi-byte UTF-8 characters.
* The above fixed bug #1506; triggers are still not working, though.
* Rewrote Menu.h header.
* Renamed all private methods (that are not called by BWindow) to have the
underscore prefix.
* Removed unused methods.
* Some minor cleanup.


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


# ded80ae4 28-Sep-2007 Stephan Aßmus <superstippi@gmx.de>

* very minor cosmetic change


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


# d237672a 19-Aug-2007 Ryan Leavengood <leavengood@gmail.com>

A fix to bug #1154 by Justin O'Dell. Basically the settings for menus
default to having no accelerators, but that setting was not ever read
properly. So in fact the meny pref was correct, but the menus were wrong.
This fixes that.

If the default setting is supposed to be accelerators on then the settings
should be changed.


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


# baade558 17-Jun-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Typo. Fixes menus (bug #1276).


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


# 4fa167e1 16-Jun-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added layout-related methods (Min/Max/PreferredSize(), InvalidateLayout(),
DoLayout()).
* Don't resize the view and the window anymore, when fResizeToFit is not
set.


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


# af035272 12-Jun-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Changed the loop to compute the column layout: Now the space for
modifiers is added after we've calculated the maximum width. This way we
don't get overlapping between the menu content and the modifiers bitmaps
themselves. TBR.


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


# 37ddfd14 11-Jun-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Shortcut characters are aligned even if there's a submenu, like
discussed in the thread in haiku-development. I added a fSubmenus member
to BMenu, to be able to tell from BMenuItem if there are other items
with a submenu (maintained in BMenuItem::SetSuper()). If you don't like
this solution, let's just revert.


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


# fbe2f227 12-Jun-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Some work on menu layouts:
- Menus are generally a bit wider (BeIDE ones didn't look nice)
- The modifiers bitmap are drawn more centered vertically
- Splitted BMenu::ComputeLayout() into three methods
- Various minor changes.
The menuitems still don't look nice with bigger font sizes, but we'll
try to fix this...


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


# 63cd2925 22-Mar-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Update the window size when adding and removing items. This fix bug
#683, but makes bug #582 look even more funny. Oh, well I hope I'll fix
it one day.


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


# 80a1eea5 14-Mar-2007 Jérôme Duval <korli@users.berlios.de>

only chooses alpha characters for menu triggers


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


# 68fb2668 16-Jan-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

get rid of the now useless trackTime parameter

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


# ebd1a3a1 16-Jan-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

some more work on menus... fixed bug #953 and some more stuff


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


# 27e7210d 05-Jan-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Since Waldemar changes to menus, replicants menus didn't work
anymore. That problem showed up for example during my haiku
presentation at Begeistert, where I couldn't delete replicants from
the desktop... grrrr!!! :-)


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


# 436bc5cc 05-Jan-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Menuwindow was 10 pixels away from the screen bottom when scrolling was
enabled.


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


# f5e5e360 29-Dec-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

forgot to fix this small style issue

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


# c7338938 29-Dec-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Greatly improved scrolling, and simplified the code too. Now scrolling
is done from inside the BMenu::_track() function, and not inside Pulse()
anymore. Patch by Lucasz Zemczak


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


# f0f8601b 21-Dec-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

small cleanups


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


# 8b91b40a 12-Dec-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Try to split the tracking function into smaller ones. Please bear with
me for the absolutely UGLY names. Also, if someone can suggest better
ones...
I seem not to have introduced any new bug.


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


# 08d92916 07-Dec-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

removed now unneded extra Draw() call used as a workaround to broken
scrolling.
Menu attached to menubars now use scrolling if they are opened near the
bottom of the screen (just like in beos). I'm not sure if this is so
nice, though, so it could be reverted. Patch contributed by Lucasz
Zemczak


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


# 64a74d5e 23-Nov-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

close the menu immediately when user clicks outside the menu

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


# 7fc2eece 21-Nov-2006 Waldemar Kornewald <wkornewald@nowhere.fake>

Found out what trackTime was used for.
We should probably always start BMenuField menus in sticky mode and only switch
to non-sticky mode if the mouse was moved a minimum distance.


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


# 2628e60c 22-Nov-2006 Axel Dörfler <axeld@pinc-software.de>

Moved BMenuWindow, BMenuFrame, and BMenuScroller into the BPrivate namespace.


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


# a7067566 22-Nov-2006 Waldemar Kornewald <wkornewald@nowhere.fake>

Fixed menu disappearing bug when (in sticky mode) mouse button is pressed (and held down) and the mouse pointer is moved outside of the menu. Now, menus should work as expected and switch from sticky to non-sticky mode on mouse button press correctly.
BTW, I disabled trackTime. It seems to work without it, correctly, so I guess it can be removed completely.
If not, just revert the change ("if (system_time....") after TODO.


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


# 0512e989 21-Nov-2006 Waldemar Kornewald <wkornewald@nowhere.fake>

Now, menu reacts on first mouse release after having disabled sticky mode on MouseDown.


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


# b26e9fb4 21-Nov-2006 Waldemar Kornewald <wkornewald@nowhere.fake>

In sticky mode, menus should only invoke the selected item after the mouse is released (instead of immediately on MouseDown).
I hope this is the correct fix.


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


# e0fcf72a 21-Nov-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed some semi-random crashes in deskbar and tracker caused by the new scrolling code. patch by Lucasz Zemczak. Also now the menu tracking function checks the result of the userdefined tracking hook, thus fixing bug #938

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


# 27cc2508 20-Nov-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

First try at menu scrolling, courthesy of Łukasz Zemczak. Works more or less, although a bit buggy

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


# fe23fb66 29-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

* Renamed private BMenu::SelectItem() to _SelectItem(), and made its arguments a bit more sane.
* Fixed two GCC 4 warnings.


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


# 3cdc3291 11-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

The menu could leave the screen to the left, this fixes bug #902.
Patch by sil2100.


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


# 37f49a44 24-Aug-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

If show() fails, deselect the parent menu item.

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


# 27f1bc82 18-Aug-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Don't activate the window, because it will steal the focus from the current active window, and clicking elsewhere won't close the menu

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


# 4e338ac6 17-Aug-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Started implementing menu keyboard navigation. Does only work for menubars because menu windows never get keyboard focus. Any idea how to solve this, since menu windows are B_AVOID_FOCUS both in beos and haiku?

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


# bfb0aa18 13-Aug-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

some adjustments at the menu width calculation. Menus are generally a bit less 'compacted' now. Might need review

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


# 509c95da 12-Aug-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added s small workaround in BMenu::OkToProceed() to fix deskbar not opening the be menu under heavy load (or, always, under qemu) if the mouse button was released too soon. Beos seems to do something similar, although it's a hack

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


# b6bf3346 08-Aug-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

When calculating the menu frame, take the resizeToFit parameter into account. This fixes bug 574, although the implementation isn't probably completed yet. Needs more investigation.

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


# cf2ef43a 13-Jul-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

fixed a small problem with StealFocus and RestoreFocus

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


# 9fcdf0e9 07-Jul-2006 Jérôme Duval <korli@users.berlios.de>

MenuItem::Archive uses BArchivable::Archive
inverted the enable state when initing the BMenu


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


# 9b224ec8 07-Jul-2006 Jérôme Duval <korli@users.berlios.de>

add item frames to BMenu archive
add class names to BMenuItem archives


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


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

archive deep when needed, restore menu items


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


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

archives menu items in menu archive


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


# 9d9c1564 03-Jul-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

One of the BMenu::AddItem() variations crashed if the passed item was NULL. Fixes bug 465

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


# a03ac895 05-Jun-2006 Jérôme Duval <korli@users.berlios.de>

fixed some property_info and value_info for BShelf, BMenu, BWindow and BView
real support is to be implemented for a lot of them


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


# b9af5bfa 30-May-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

- Fixed the recently introduced bug where menus would open again once closed. -Now hitting ESC will close the menu. - Reverted to the other variation of GetMouse() as Axel's advice

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


# 0dcf122e 29-May-2006 Axel Dörfler <axeld@pinc-software.de>

Removed now incorrect comment.


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


# c1dd282b 28-May-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed some bugs in StealFocus, RemoveFocus and SetStickyMode

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


# 848b8903 27-May-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

More hacks to BWindow's mousedown handler, to fix some problems with menus. Fixes bug 610 among other things. Note: I don't like this code so much, but apparently BeOS handles it in a similar way. I accept suggestions on how to improve this.

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


# e061d1ba 27-May-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

an eventually opened menu is now quit in BWindow::DispatchMessage()
before sending a B_MOUSE_DOWN message to any other view. This fixes bug
594 for real and another bug in BMenuBar. BMenuBar tracking will also
be simplified a bit because of this. Install items to a NULL window on
Show() as does R5 (although I don't know why yet).


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


# 03f2d779 26-May-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Switched back to the GetMouse variation which does NOT check the message
queue, should fix bug 594 and not risk of losing clicks. SetStickyMode()
calls StealFocus() to give the chance to be keyboard-navigated to menus.
Added an extra (temporary) InvalidateLayout() because some items weren't
added in
some cases (Tracker's attributes menu for example)


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


# 73f99cd6 26-May-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

reverted axel's change to menu, which introduced some other problems, and I can't reproduce that problem anymore. Axel, can you verify, please ?

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


# 712c1e8c 22-May-2006 Axel Dörfler <axeld@pinc-software.de>

Fixed the BMenuBar not spanning over the whole window width for MediaPlayer
and VLC (what a coincidence :)).
Would be nice if there is a better solution, though...


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


# 431da4dd 22-May-2006 Stephan Aßmus <superstippi@gmx.de>

AddItem(..., frame) used AddItem(..., index) which
triggered a debugger call -> refactoring and cleanup


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


# b0f89f91 20-May-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed the problem mentioned in bug 484, some cleanups, implemented
BMenu::InvokeItem() more correctly.


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


# 2a3de9bc 19-May-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


# f7111101 19-May-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Refactored the AddItem mechanism. Now the private _AddItem() method doesn't lock the looper or invalidate the layout anymore, which is done by the caller. This way AddList is much more efficient.

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


# 925479d7 09-May-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added a new method RelayoutIfNeeded(), which does the real Layout invalidation, it's called by menubar and menu. This fixes the menufields not being resized. Note that a problem still remains, will be fixed shortly (hopefully)

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


# 63b78888 07-May-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

BMenu::InvalidateLayout() should only sets a variable, the real invalidation is done on Draw() or AttachedToWindow() (like on R5). This fixes bug 567 (at least the crash in HotEdit)

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


# 4436b726 30-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Menuitems are layoutted better, fixing bug 526

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


# 9c418bc0 29-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

Fixed warning.


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


# 05e515d5 22-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

hopefully improved menu tracking. Among other things, this fixes bug 461

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


# 59d1b7be 21-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

It's a good idea to snooze AFTER we've checked the possible exit conditions

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


# 48688dcd 20-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed a bug in menu tracking: in some cases you had a goal of 1 pixel when trying to enter a submenu ( http://flickr.com/photos/johndrinkwater/131805244 )

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


# b03deb09 19-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Menu settings are now handled by the app_server. As a result, changing them does something, although they aren't saved to disk yet. 'click_to_open' is not checked anymore, because it was useless anyway, I'll remove it from the Menu preflet too.

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


# 1b5b2e4c 18-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

MenuItems don't flicker anymore when a submenu opens (fixes bug 484). Implemented popupmenu's 'clickToOpenRect' feature, used by tracker's dirmenus, for example (fixes bug 523

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


# 46970160 17-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Lowered the delay in menus after which they don't switch to sticky mode, should fix bug 491, although its not really a bug

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


# 415c63be 15-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

PopUpMenus didn't respect the openanyway setting (sticky mode), they always set it. And even in that case, they weren't working correctly. This should fix bugs 463 and 476. This might not work if click to open isn't selected in the menu prefs, though.

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


# 36aa2198 14-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Some more changes, fixed bug 487, added a small hysteresis so menus could be more nice to navigate, some corrections in popupmenu

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


# 0e0b8fd5 12-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

more fixes

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


# 7d550b53 11-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

and there, the usual forgotten stuff

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


# 2191a09a 11-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

big improvements for menus. The tracking is in many ways on par with r5, except for a few things, like diagonal movement and that grandparent bug

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


# 9c5c552d 07-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

more fixes

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


# bf5d7973 07-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Obviously I put in the usual 'untested last minute change' which broke everything. Should be fixed now.

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


# c51421cc 07-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

implemented sticky mode. Let's see how many complaints because it's not perfect at all. Under qemu it's super crappy btw

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


# 29c407a3 04-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed menus in case the window was hidden (VLC, StyledEdit). This is just a quick fix and will be changed later. Thanks to John Drinkwater for testing

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


# 6d9adcf1 04-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

Removed a superfluous const_cast and a variable from ChooseTrigger().


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


# cb2998af 04-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

BMenuItem::SetTrigger() and SetAutomaticTrigger() now also update fTriggerIndex.


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


# 0f11085c 04-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

* Rewrote MenuItem.h (we're no longer using Be's header).
* Renamed private SetSysTrigger() to SetAutomaticTrigger().
* Added the '_' prefix to private methods that aren't called by anything outside
BMenuItem (ie. no friend classes either).


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


# 195f58dd 03-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

BMenu::_AddItem() keeps the looper locked for the whole time, other changes: let's see if this fixes that bug

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


# e90bed06 02-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed vlc menubars

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


# 262a2483 31-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

I woulnd't say the classical last words... but I seem to have fixed latest crashes...

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


# f2e9b063 31-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

This small change could even fix some big problems with menus... unfortunately I can only reproduce them in vmware, and not in qemu

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


# 793fde40 29-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

This should fix some problems I experienced later. At least, I can't reproduce them anymore

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


# 35beeaa9 28-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Minor improvements

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


# 4185bd8b 28-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Hopefully simplified BMenu/BMenuWindow relationship and made it more robust.

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


# 9913366f 27-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Reset fAttachAborted otherwise menus never get filled after they have been interrupted once.

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


# 6aa12747 27-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Stupid me. ConvertToScreen() isn't needed, and I should read more carefully my own code

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


# ed49f4af 27-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Improved OkToProceed(), removed unused file


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


# f356aedc 27-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implemented BMenu::OkToProceed() and used it correctly in BMenu::AttachedToWindow(). For some reason, though, I had to comment it out partially as something is wrong. I haven't debugged, though

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


# 7abe70f1 23-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Hopefully cleaned up a bit the locking in BMenu::_show()/_hide()

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


# 37cf3d97 22-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Avoid attaching a menu to the BMenuWindow when not needed

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


# b80eb9d4 22-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Partially reverted axel's change, because it brings more troubles than benefits (menus lock when they reuse the supermenu's menuwindow). I'll try to resolve the various problems in another way. Some cleanups

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


# e87965de 21-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* Fixed a possible crash when removing and adding items from a window.
* This does not yet close bug #233, but could also be a reason for this crash.


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


# 7a2c9b35 21-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Reverted to r16487 due to various problems. I'll recommit the code once it's fully working.

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


# ebaeaa12 20-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

BMenu::InvalidateLayout() now just marks the cached layout as invalid, instead of recalculating it. This results in less computations. Reorganized the layout calculation due to that. Now it's done once in AttachedToWindow(), and in Draw(), only if needed

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


# 65b4fb8a 20-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Check if alt is the command key on BMenu::AttachedToWindow instead of doing it for every BMenuItem::Draw()

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


# 21f9f047 15-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Don't resize items if not needed, small change

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


# 446d93a0 08-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

sorry, this was meant to be removed

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


# 49b154d1 08-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed wrong calculation of the menu frame if layout is B_ITEMS_IN_ROW. Fixes bug 209

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


# 66188b66 06-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

pulled check out of the loop

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


# 6d87a142 06-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Take the max content width into account in BMenu::ComputeLayout(). This fixes bug 188. IOW the deskbar expander arrow is now shown

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


# 2c11ec31 03-Mar-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


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

Removed trailing newline from window name.


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


# de71e4da 18-Feb-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

_BMCItem_ isn't used anymore

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


# 15b4cc6e 09-Feb-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

reduced the histeresis, now it's a fixed value

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


# 2a5bad15 09-Feb-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


# fd1528f2 30-Jan-2006 Axel Dörfler <axeld@pinc-software.de>

Accidently broke selecting sub menus with the last commit.


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


# ec549309 30-Jan-2006 Axel Dörfler <axeld@pinc-software.de>

The menus work a bit less good now I think, but they no longer have 100% CPU usage
when the menu item under the mouse cursor has a sub-menu.
Minor cleanup.


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


# 61ba5a32 29-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added some code to draw "empty" in empty menus. Not working for the
moment, but committing since it's too late to continue working, and at
least the window is resized correctly...


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


# 365a41fd 21-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Reduced the time hysteresis. Need more testing, though

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


# 0219459b 21-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added a small time hysteresis: submenus are only opened if the user keeps the mouse there for a while. I'd like feedback on this

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


# c592b98f 17-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Reworked BMenu::Set/IsEnabled(). I tested what happens under beos and our code seems to be finally correct

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


# 0c745023 16-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

followed stippi's suggestion and implemented SetEnabled more cleanly

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


# dd180e63 16-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

SetEnabled() enables or disables the parent menu too, SetRadioMode() and SetLabelFromMarked() call each other if needed, BMenuBar::Draw() doesn't make a difference if the menubar is disabled or not, should even fix bug #87 as it was calling LayoutItems() every cycle. Work done by John Drinkwater and me

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


# fc3a8a1c 13-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed popup menus opened at the wrong position (mostly noticed in Installer) with a horrible hack which I can't see how to avoid

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


# 201381d6 13-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Menus make a better use of windows: when a child menu is opened, it asks the parent for a window, which is then cached for every other child for that parent menu. This avoids multiple creation/deletion of BWindows in a row. This also makes menus much nicer to use in qemu (together with the slight change in locking in BMenuBar (Lock() instead of LockWithTimeout))

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


# b120bcd6 10-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Don't quit tracking the menu even if OverSuper() returns true, if HitTestItems() doesn't return NULL. This should fix (at least in part) bug #85

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


# b8fe2d4e 17-Dec-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

some changes, fixed a possible segfault

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


# 1d44f679 08-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

Now checks if locking the looper succeeded.
Now hides the window before removing itself to prevent a superfluous drawing update.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15410 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


# 758b1d0e 12-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
Otherwise the an inner class with that name is considered as friend.
gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



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


# ac507022 10-Nov-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

BMenu::FindMarked() was broken just like FindItem() was. And it's even my fault. Yay!

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


# 8f4959d8 09-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

Both BMenu::FindItem() versions were broken and could return a wrong item.


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


# 86343dcb 09-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

There is no reason ComputeLayout() needs a parent/window - in fact, it should always
work correctly (for GetPreferredSize()).


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


# ecf92c7e 02-Nov-2005 Stephan Aßmus <superstippi@gmx.de>

cleaner version of RemoveItems, more error checking

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


# e7dfacc2 14-Oct-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed a typo which caused a bug.

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


# 8991f1a2 06-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Implemented basic dynamic item support (IOW the BSlowMenu/BNavMenu stuff is now working
as expected), OkToProceed() needs some work, though.
Made _AddItem() more safe - the window is now also locked during BList::AddItem() and
while getting the window to install the item in.


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


# 0b4ce825 05-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Fixed ComputeLayout(); it added 20 pixel for every item in the list in B_ITEMS_IN_COLUMN.


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


# 1b1b6891 05-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Fixed CalcFrame(): it could be called with Superitem() and Supermenu() == NULL.


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


# 4da171ef 05-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

CalcFrame() no longer returns the maximum frame, but the one that should be
used.
Changed CalcFrame() so that it tries to find the best on-screen location - works
already, though it might have to be improved.
Moved ScreenLocation() so that it's close to CalcFrame(). Changed the position
for B_ITEMS_IN_COLUMNS a bit (they now appear one pixel lower).


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


# 2e6a5805 05-Jul-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


# 2323effa 05-Jul-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Avoid calling ComputeLayout() if the menu is not attached to a BWindow. Small cleanups.

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


# 1ae414f3 04-Jul-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Don't assume we have an owner. This fixes a crash in MenuWorld, but needs more investigation

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


# 1a02bff8 04-Jul-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

the menuitem wasn't deselected when you moved the mouse away from the menu window. Thanks to Axel for reporting.

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


# 16942545 02-Jul-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Avoid calling BMenu::_hide() when not needed

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


# 557dfeeb 23-Jun-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implemented CalcFrame() and used it to limit the menu frame's size (actually, only the width for now). This shows that TruncateLabel() works.

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


# 61e19def 20-Jun-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Verified and removed a ToDO item (thanks goes to Olivier Milla)

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


# ba618358 14-Jun-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed submenus for good

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


# 757ce6e5 15-Jun-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Greatly improved BMenuBar::Track(). Now it uses a simple tracking loop instad of two nested loops. BMenu will follow, someday.

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


# ac7ee5af 11-Jun-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

removed COMPILE_FOR_R5. For BMenu it doesn't make any sense anymore.

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


# fd083d7e 07-Jun-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Use the private menu actions defines. Small cleanups.

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


# 8768dcd8 07-Jun-2005 Stephan Aßmus <superstippi@gmx.de>

BMenu installed all previously added items each time a new item was added

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


# 26ad9841 30-May-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Menus don't flicker anymore, extended some ToDos, small cleanups. Implemented BMenu::IsItemVisible() as I think I'll need it soon, extended Bmenu::OverSubmenu() to be recursive, it's not used at the moment but should be.

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


# 063446f4 23-May-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Reverted that last change, as it was really a bad idea afterall (as Axel pointed out)

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


# 8b47fd87 23-May-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

MenuWindow's look is now B_BORDERED_WINDOW_LOOK, so we can avoid drawing the border ourselves.

Now BMenu caches its windows instead of creating a new one every time. This last change could be reverted, though, as we could end up keeping around too many windows.

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


# f32c7475 16-Feb-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

A couple of small style changes, fixed a problem with some compilers


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


# 6a1a734c 15-Feb-2005 DarkWyrm <darkwyrm@gmail.com>

A small crash fix whilst testing with a stock People app


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


# a0394110 19-Jan-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

We have submenus working (still not perfect, though)


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


# 0c14fc6d 19-Jan-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Changes to make BMenu behave correctly. Implemented SetTrackingHook(). AddItem() calls the debugger in some cases, as it should. Cleanups.


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


# 727e24f7 18-Jan-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Now BMenu also calculate the triggers for BMenuItems.


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


# 5fd36a24 13-Jan-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

A BMenuItem couldn't be removed and then added back to a BMenu: Fixed.


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


# 4ff5ade2 04-Jan-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Many visual fixes to BMenu. Now it's almost undistinguable from the real thing. SeparatorItems were being drawn too dark. Fixed.


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


# 5b752875 03-Jan-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


# 1664b981 03-Jan-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added some todo items, cleanups. Removed the frame parameter from BMenuWindow as it's not needed.


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


# 4e876d12 03-Jan-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

implemented B_ITEMS_IN_MATRIX layout correctly. Small cleanups all around.


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


# 9a8540fb 03-Jan-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Now menuitems are highlighted correctly, and submenus open, at least.


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


# 92aa9dcf 31-Dec-2004 Stefano Ceccherini <stefano.ceccherini@gmail.com>

some more cleanups. The AddItem() variation which accepts a BRect parameter now calls the debugger if called when the layout is not B_ITEMS_IN_MATRIX.


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


# 9944a299 31-Dec-2004 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Now items are removed correctly. All RemoveItem() call pass now through the private RemoveItems() method. ComputeLayout now uses a switch block, and prints a warning if B_ITEMS_IN_MATRIX is used, since it's not supported yet. Some cleanups.


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


# efa306a0 30-Dec-2004 Stefano Ceccherini <stefano.ceccherini@gmail.com>

BMenu now does even work correctly and doesn't flicker anymore. Submenus does not yet, though, and sticky mode is not yed supported.


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


# b0d01b5f 30-Dec-2004 Stefano Ceccherini <stefano.ceccherini@gmail.com>

MenuWindow now uses the private window_feel "1025", which I guess we'll need to implement server side too, since it behaves differently than B_MODAL_WINDOW_FEEL. Menu items added to a menubar didn't appear immediately, so I forced an Invalidate(). Could be made better, I think.


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


# 31e911da 30-Dec-2004 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed BMenuBar drawing. Managed to have BMenu working (partially) with BMenuBar.


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


# 446b8c19 27-Dec-2004 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved BMenuWindow to its own file


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


# a87bf007 09-Oct-2004 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Bare minimum stuff to have BPopupmenu working with our own BMenu


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


# ed52cdfd 27-Jun-2004 Axel Dörfler <axeld@pinc-software.de>

Fixed the build by disabling MouseDown/Up/Moved() methods.
Added missing BMenu::sMenuInfo storage.


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


# 8e449e70 04-Sep-2003 haydentech <haydentech@nowhere.fake>

Eliminate one warning and one bug


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


# 40ceba30 03-Jun-2003 haydentech <haydentech@nowhere.fake>

Janitorial work and gcc3-related fixes


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


# af61f86f 14-Nov-2002 Marc Flerackers <mflerackers@nowhere.fake>

Added headers


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


# 16cedc60 14-Nov-2002 Marc Flerackers <mflerackers@nowhere.fake>

Initial Checkin


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


# ac9ec47d2763393d02aebd1460ba52f9c4fa9a05 09-Sep-2015 Axel Dörfler <axeld@pinc-software.de>

BMenu: made left side padding font size relative.

* Also changed BMenuItem to make better use of that size.


# fb4ea396e3c74324d365a277dfd2c51195c641b8 04-Aug-2015 Augustin Cavalier <waddlesplash@gmail.com>

BMenu: Check return value of LockLooper().

CIDs 602450-602452.


# c4793b242c5c4c7bcebc4a2702ff139365f017ef 17-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

fix adding or removing items to an open BMenu

The menu would try to relayout itself, but fail to get the supermenu
bounds as the looper for it was not locked in that case.

This fixes the crash with two downsides:
* The menu width isn't adjusted to match the parent menu (mostly visible
in BMenuFields)
* There is some flickering as the menu is updated

Fixes #9863 (Network prefs part).


# 0eb5978482fde54db1789252243c4de907d0264c 18-Oct-2014 Adrien Destugues <pulkomandy@gmail.com>

BMenu: don't invalidate layout when changing marked item

* The layout does not need to change. The label may change in
SetLabelFromMarked mode, but this only affects the layout of the parent
menu.
* This would crash when programatically changing the menu marked item
while the menu is open.


# ca6cc0aa5033795c5acea1d73a3f72e2f36df3ce 24-Apr-2014 John Scipione <jscipione@gmail.com>

BMenu: Replace min_c and max_c

... with std:min and std:max


# b7096fd76be21a95d778c65948fef2634108dbd6 23-Apr-2014 John Scipione <jscipione@gmail.com>

BMenu: remove useless default case


# cb30cf1423cec942ca12e67cb67f62a1aaeeb3c5 22-Apr-2014 John Scipione <jscipione@gmail.com>

BMenu: style fixes


# eb539d59e7d26369ad2cbb9b3780cfdbc78a8a37 22-Nov-2013 Julian Harnath <julian.harnath@rwth-aachen.de>

Don't try to open another menu window if there already is one.

* Fixes crash when using Gobe Productive toolbar.


# 9a9ebda459d7df4925d516f9f638bdddd7140a74 05-Nov-2013 John Scipione <jscipione@gmail.com>

BMenu: Some style fixes related to docs

Mostly just making the variable names match between the
header and source.

No functional change intended.


# 40082f768abc6897a15908b36f406b9eda329558 31-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BMenu: Update comment


# 0b4c2d3210c59c202541bde992c52cbdb10b8db6 31-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BMenu: Use shift modifier for page-wise wheel scrolling

Fixes part of #9907.


# c29f2d22a9ebf0066cf2a146aff98e7fe0b20d76 25-Oct-2013 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Close the menu on keypress.
After _InvokeItem(), call QuitTracking() to close the menu.
Incidentally this also seems to fix #9863.


# 4385f739962c852de851cf28145d96d001f48b33 25-Aug-2013 John Scipione <jscipione@gmail.com>

Revert "Menu: check numBytes == 1 on KeyDown"

This reverts commit 44dc533861d5e6c8c80f3ed89d6dfb4b8a30c724.


# 60a7f11599aac7412d6db940ce93d03c24cda261 24-Aug-2013 John Scipione <jscipione@gmail.com>

Menu: Handle Keyboard input better.

When you push an arrow key obscure the cursor so that it doesn't get in the
way of the menu items. BeOS R5 also did this.

When you select an item with Enter or Space, or cancel with Escape, set the
super menu to close in _QuitTracking() if you've specified onlyThis == false.
Also, show the cursor here in case you haven't moved the mouse since it was
obscured.

This fixes a problem where when you select an item in a menu via the keyboard
while your mouse is over the parent menu item or menu field it would pop the
menu back up again even though you've made your selection or cancelled.


# 44dc533861d5e6c8c80f3ed89d6dfb4b8a30c724 24-Aug-2013 John Scipione <jscipione@gmail.com>

Menu: check numBytes == 1 on KeyDown


# cccc4076dbd857be016741e5dd75c61858aabe2a 24-Aug-2013 John Scipione <jscipione@gmail.com>

Menu and friends: Style fixes, no functional

... changes intended.

* 80 char limit fixes
* Indentation fixes
* Braces style fixes
* Use ternary operator where appropriate
* Rename menuItem to just item and declare it once outside
the loop
* Omit 3rd param of GetMouse() because it is default
* Rename variables eg state => focused and menu => submenu
* Indent comments below line they apply to
* Reword some comments
* Add some #pragmas


# f5bb83110829d1667ac0be4d4fbf69846cfc4559 23-Aug-2013 John Scipione <jscipione@gmail.com>

Menu: Silly code optimization

Always set releasedOnce to true here instead of setting it true in the
case that it is false. It's almost certainly faster and clearer to always do
the assignment than to incur the cost of the conditional and branch.


# d5de9547c79ff18ccc3c20b3afd05243a7c230fb 21-Aug-2013 John Scipione <jscipione@gmail.com>

Menu: some helpful comments


# 408c0ee4cdd7cbe9935aae9af2c5e3ca110a89a6 20-Aug-2013 John Scipione <jscipione@gmail.com>

MenuField: enable/disable the menu field when...

the child menu bar or the child menu bar's menu is enabled/disabled.

This means that there is just one status we have to check, the menu
fields, and the child menus agree. This change takes practical form
in the Backgrounds preflet which disables the placement menu when
the image is set to "None", but, only the menu got disabled and not the
parent menu field so the label was erroneously still drawn as enabled.


# 83ea4af492d1a08d825b19c3e5026d99a189e083 20-Aug-2013 John Scipione <jscipione@gmail.com>

BMenu: Don't hit test separator items

Fixes #4147 while not causing the regression described in #6610
like hrev35248 did.


# 77850e8dba4472e725d058ed3e49f242a0f39119 20-Aug-2013 John Scipione <jscipione@gmail.com>

Revert "BMenu return only enabled items"

Patch by "stimut"

This reverts commit abc26ba8ad02a8394a30dece78ba443fc099b81d.

Reverting this patch fixes #6610


# 6da3c1c78805a428e567ba00a6effa40df394159 29-May-2013 John Scipione <jscipione@gmail.com>

if menu _BMCMenuBar_ subtract the popup indicator width

... when calculating the width of items in _ComputeLayout. This prevents
that menu field from growing on selection fixing #9796 and #2413.

Also a few style fixes.


# d5c51ba6768d7ffd5bb983af9ab97b6372eae134 06-May-2013 John Scipione <jscipione@gmail.com>

Update header comments


# d97b43406038a6398e097939b71908ff490c64ff 06-May-2013 John Scipione <jscipione@gmail.com>

Style fixes to BMenu and related classes.


# 5041cdf4d90ded8e958233b33b74add10def68ec 03-May-2013 John Scipione <jscipione@gmail.com>

Fix a few minor BMenu issues, follup on hrev45610

Only AttachScrollers() and scroll if B_ITEMS_IN_COLUMN because if not we don't
support scrolling anyway. Also, rename superpoint variable to superPoint.


# 4898c615d6c4f72deb9433c784b9e6d84419efb0 03-May-2013 Jessica Hamilton <jessica.l.hamilton@gmail.com>

BMenu: scroll marked item into view when menu has scrollers attached.

Signed-off-by: Axel Dörfler <axeld@pinc-software.de>


# 501201761ba2edad1c4a9cc96e79f011978c7463 13-Apr-2013 Stefano Ceccherini <stefano.ceccherini@gmail.com>

In case the BMenu is inside a BMenuField, override the items width to
span over the BMenuField's width. Note that if the BMenu is already
wider, we don't shrink it, at least for now.
Fixes #5015.


# 3ef837fd409aa1dc999c886f3618348c8bee4751 12-Apr-2013 Stefano Ceccherini <stefano.ceccherini@gmail.com>

If a submenu was opened, the parent menu tracking loop would continue calling
_HitTestItems() even if the user didn't move the mouse.


# 49126a0e9b1b7a8a148dab17d0c3aa4eb6e798ed 03-Jan-2013 Tri-Edge AI <triedgeai@gmail.com>

Added ResourceEdit and modified BColumnListView, BRow and BMenu.

Signed-off-by: Matt Madia <mattmadia@gmail.com>


# afa1c29104c7f6b7a904008fbfc6a4835de4b3d3 21-Jul-2012 John Scipione <jscipione@gmail.com>

Tweaks, remove dead code. Menu and Menubar are stock again.


# 49ff476d139dc28ebaa95d65b7820423b6061d60 19-Jul-2012 John Scipione <jscipione@gmail.com>

Make ScrollMenu not rely on Menu.cpp

Rename ScrollMenu.cpp to MenuScrollView.cpp

Half step towards making this class work as part of Deskbar without
extending any other classes. Scrolling works both with mouse and
scroll wheel. Redraws on scroll, need to make that work better.
Also need to move classes out of the Interface Kit and into Deskbar.


# cb55ef9fb597a3f3bc91e53017360b18b20dd27b 27-Jun-2011 John Scipione <jscipione@gmail.com>

WIP: Created a BScrollMenu class that works like BMenuWindow but works on a view instead of a window. Use this to implement a scrollable BarMenuBar in Deskbar. The basics work but there are issues still with sizing and other issues.

Modify the ScrollMenu class to use the layout kit by adding a constructor that doesn't take a view.

Get the BScrollMenu class to follow the size of the BMenu it is a parent of. Adjust the scrollers to appear in the right places. This is a WIP but it works in Deskbar, next step is to integrate this directly into BMenu with the scrollers as children of the menu instead of as children of the BScroller class.

Rebase changes on top of master

Deskbar scrolling works for the most part, just need to fix the
bottom arrow and clean up a bit.


# 0eed2a7c98afafc461dd42a93986bb2f898d262e 02-Aug-2012 Ryan Leavengood <leavengood@gmail.com>

Fix flickering menus, especially menu bars.

Figured out by Stephan originally and only hacked in WebPositive, I knew
something about WebPositive was different because it did not flicker when
everything else did.

Since we fully draw the menus there is no need to have app_server fill in the
background with the view color. That is what was causing the flickering.

Should fix #484, #532 and #4335. Thanks diver for confirming the patch against
those tickets.


# 9be774b553296a712704078314f2291ae5fc352c 30-Jul-2012 Alex Smith <alex@alex-smith.me.uk>

Compilation and 64-bit fixes to libbe.so sources.

Fixed the usual issues - printf format strings, uint32 instead of
addr_t, etc. One thing that isn't so nice is several places where
BList is used to store (u)int32, these require a double cast to addr_t
then void* to silence a warning on x86_64.


# 546208a53940a26c6379c48a7854ade1a8250fc5 16-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

More catalog-related cleanup.

* rename B_TRANSLATE_CONTEXT to B_TRANSLATION_CONTEXT and
B_TRANSLATE_WITH_CONTEXT to B_TRANSLATE_CONTEXT, squashing a TODO
* adjust all uses of both macros in Haiku's source tree
* use correct header guard for collecting/Catalog.h

The renamed macros require adjustments to all external applications
using catalogs.


# eaa5e0936d94e7d0bb2e6066a87d485e7613414c 14-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

Fix #8452 (app's crashing for non-existent system catalog)

* make the system catalog a BCatalog instead of a BCatalogAddOn*,
such that using a non-existing system catalog won't crash but
simply return the untranslated string instead
* rename MutableLocaleRoster::GetSystemCatalog() to LoadSystemCatalog()
and adjust it to use BCatalog::SetTo() in order to replace the
data used by the given catalog
* adjust all users of gSystemCatalog accordingly


# 60f75e901ce3063c63441ac644dd0e55a17d5d09 04-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

Merge liblocale.so into libbe.so.

* Make the locale kit a part of libbe.
* Drop the LocaleBackend kludge used from within libbe (and from
other places, too) in order to access system catalog strings.
This is now done via gSystemCatalog, which is provided and initialized
by libbe.
* Drop all references to liblocale.so from all Jamfiles.
* Add legacy symlink liblocale.so in order to keep optional packages
that rely on it in a working state.

TODO: the documentation hasn't been updated.


# 577265d14f71407c7ce93639bbe7938678afe4c2 31-Mar-2012 JackBurton <stefano.ceccherini@gmail.com>

Avoid calling BMenu::HitTestItems() if the cursor is over a submenu.


# 9289418325f453bc718b400c77222ee33dd7fd31 03-Mar-2012 JackBurton <stefano.ceccherini@gmail.com>

Fix Indentation


# 417c123cc452b4cb2eb3cb4eb9e3f1d7637470ec 03-Mar-2012 JackBurton <stefano.ceccherini@gmail.com>

Fix indentation


# 7327891c90556890045ddc6f828dfe9caaa809fc 25-Feb-2012 Jerome Duval <jerome.duval@gmail.com>

interface kit: added compatibility symbols for BeAE for #8354

* _ZN5BMenu16InvalidateLayoutEb for GCC4
* InvalidateLayout__7BSliderb for GCC2


# c8df0c9b275264d27fcb4b1ee62b3598863fade7 18-Dec-2011 Rene Gollent <anevilyak@gmail.com>

BePDF needed this one to be added as well.


# 29ef6eb52d019b8b209958eac8f38fd4553612b2 08-Dec-2011 Alex Wilson <yourpalal2@gmail.com>

Fix BMenu behaviour/ABI by reinstating BMenu::InvalidateLayout()

It turns out,this is an old method added by Be, and is not really related to BView::InvalidateLayout(bool). In fact BMenu::InvalidateLayout() does something separate, but related to the BView method. I was wrong to delete this method, since it needs to have action taken each time it is called, so moving these actions into LayoutInvalidated() only worked sometimes (when the BView was considered to have a valid layout).

I have added a comment for future hackers so that they don't delete this method.


# 8abe72fb66b36e98eedc463c85cf752651280386 06-Nov-2011 John Scipione <jscipione@gmail.com>

Changes the menu key bitmap from CTL to CTRL and SHFT to SHIFT.

This is coming from but does not close #7967

Adds a new (currently unused) Menu key bitmap.

Instead of having a single AltAsCommandKey() method the menus now
show the correct bitmap when you switch between your control,
windows/option, and alt/command keys. This is really not flushed
out yet since it only works when you switch those keys and not
other combinations like say switching the control and caps lock
keys but it is a step in the right direction.

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


# 61eb1f1d19eed26b6138b0701612e8eb31bb1d86 22-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

Replace remaining InvalidateLayout()'s with LayoutInvalidated(). Also do a bit of cleanup/move methods around.


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

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


# e750d35cbfaed10c317bbba6f66212a410500013 06-Jun-2011 Stephan Aßmus <superstippi@gmx.de>

Applied patch by Pete Goodeve from ticket #7182. It improves
keyboard navigation/tracking of BMenus and BMenuBars, although
many issues remain.
Should not yet go into alpha, since there is one issue which
I am not sure if it's not a regression. The issue is that
invoking a menu item with Enter for the first time seems to
have no effect, while invoking it subsequently works as
expected. I don't know, yet, if that's a regression of this patch.
In any case, it's better than before, thanks, Pete!


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


# 4115645af634d7cabe8d91ae67efcd16dadd3c38 17-Mar-2011 Siarzhuk Zharski <zharik@gmx.li>

Localization of some UI parts:
- context menu of the replicant dragger. Fixes #7363;
- default <empty> menu placeholder. Fixes #7072;
- other messages used in PrintJob, Dragger and ZombieReplicantView classes.



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


# 77b7e18ab7f97a10c0d55d69a48efa1b97cca8ce 07-Jan-2011 Ryan Leavengood <leavengood@gmail.com>

Revert my hack from r40132 and just go ahead and fix our pop-up menu behavior
by forcing openAnyway and creating a clickToOpen rect if there is not one.
Should fix #7022 and maybe others. Partially based on the patch from #7022 and
Travis Reed's patch from the mailing list discussion in December.


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


# f8f64f9a2e4473686b07a3441456281eaf11fa7a 06-Jan-2011 Ryan Leavengood <leavengood@gmail.com>

Make pop-up menu behavior more like BeOS (though this still is not ideal):

If the menu opens right under the mouse cursor, do not select or invoke an item
until the mouse is moved. Since this seems to break normal menu bars, I added
the check for fSuper. As a (bad?) side effect BMenuField menus also need mouse
movement before something is selected. If anything else is broken, let me know.

I'm committing this because it does remove some bad behavior in pop up menus
(unintentionally selecting items.)

We may also want to force the openAnyway behavior as discussed on the mailing
list in December.

In general though the menu handling code really should be redesigned/refactored.


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


# 9b7414285160d737e02637cbe3769f93bc350abd 09-Jul-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Move assigments a bit earlier, so they aren't done at every loop.
Thanks to Sean Bailey for watching after me.


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


# 821a9b030624272f03c3d20f845cf8ba07f0dcee 09-Jul-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Renamed attachAborted to addAborted
Use fAttachAborted in AttachedToWindow().



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


# 8460e00cc0d9d43fad4eee52706968dc21b3a2cc 30-Jun-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

_AddDynamicItems didn't pass the keyDown parameter to _OkToProceed (noticed
by Ziusudra).
Also removed leftover fDynamicItemsAdded.


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


# 7ecc04177a37e9e15ef4b87b577ea2577d78fe4e 25-Jun-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed use of fDynamicItemsAdded, since it can't work like this.
Since a custom BMenu can remove the added items whenever it wants,
they wouldn't never be added back if the menu wasn't destroyed
and recreated


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


# 780b76dcf90c60169c7513ebf5767a25e816329b 25-Jun-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Applied patch by Ziusudra in ticket #4930 to avoid a deadlock when
navigating the menus via keyboard.
I also factored some code into functions, in particular the code to
add the dynamic items. Also keep track if the dynamic items have been added
or not (using a new boolean class member).
I tested for regressions but couldn't find any.



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


# 8345d7559d48f9ac304704d77744db0769e84920 15-Jun-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Don't set the width and height of the view in the constructor,
otherwise some other calculation screws up later, and the menu frame ends up
to be offsetted by its height. Fixes ticket #6159.


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


# 0cf1ecfb29de66cd1f68b0c480e22e76625316a7 14-May-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by Ziusudra: Fixes navigation in to and out of sub menus with the cursor
keys. Thanks! Closes ticket #5996.


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


# 52883718648c95b4f1ac7e0573ed4aa789962ef2 14-May-2010 Stephan Aßmus <superstippi@gmx.de>

Rewrote BMenu::_NextItem(), since it could busy loop when there was no item.
The new code should be a little easier to follow. IMHO, there were also problems
with detecting and breaking out of a full cycle, in case there was no start
item passed to the method.


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


# 6f05b1027f6a97cc20f6d4341d09e670b0faa0d4 11-May-2010 Stephan Aßmus <superstippi@gmx.de>

Removed stuff which was completely unused.


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


# 676a46d50bc4f2915de2d88c33edfc56963f53b1 08-May-2010 Stephan Aßmus <superstippi@gmx.de>

fSelected was accessed unchecked in _UpdateStateOpenSelect(), but the method
can be called without any item being selected yet. In that case, fall back
to just select the item and return (setting fSelected). I've had Tracker
crash with a BT that suggest this was the case, when I invoked some context
menu.


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


# cd9af8e701322c691fd340cb7970586e4d632642 01-May-2010 Rene Gollent <anevilyak@gmail.com>

Reverted r35463 and applied a patch by Stefano to handle the Terminal context
menu issue a different way. Should fix #5835.


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


# f7b6636a8bdb5260c963a3475fe9036da8907af9 24-Apr-2010 Rene Gollent <anevilyak@gmail.com>

Don't set releasedOnce unless we actually detect an appropriate change in mouse button states. Otherwise we could mistakenly invoke menu items when not desired. Fixes the other part of #3267.



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


# 8e23974bbe4880ce0e719446861a42485b95cab7 23-Apr-2010 Rene Gollent <anevilyak@gmail.com>

After looking for items/submenus, always update the closed state at least once before mouse polling. Otherwise the click to open sticky setting would sometimes not get evaluated until after the mouse cursor had already moved outside of the click to open rect. Fixes ticket #3267.



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


# 76d5e0641b4b4c162d0719305de3b9a2a49c7d02 19-Apr-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Partially revert r35962, since the cure is worse than the sickness.
Should fix #5717 (but probably reopens #3103)


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


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

bonefish+stippi:
All views which cache layout information need to call ResetLayoutInvalidation()
when they have updated the cached information. Otherwise calling
InvalidateLayout() once they are already attached to a layout may not have any
effect.


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


# bb2576f0c8fe02ae30008bf8190121cb4ad15b88 26-Mar-2010 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed some code which was added to fix a crash, which was obviously fixed
correctly later in another way.
Removing this code should also fix ticket #3103.
Use the width of the Bitmaps instead of fixed values.


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


# 8c3d172b46ec7e9cb9c13377f6d1f413339a4f63 03-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Fixed hovering over a sub-menu to let it open automatically, which I broke
with my previous commit.


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


# 2bcccf5a74b943b5cbff81d6481ee26bff244eec 03-Mar-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


# abc26ba8ad02a8394a30dece78ba443fc099b81d 23-Jan-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by "stimut": Fixed BMenu to return only enabled BMenuItems when invoking
them via mouse. This will make the mechanism that BSeparatorItems are always
disabled actually work and the behavior correct for other items as well. It also
fixes #4147 (Magnify crashing because it assume all its items have a BMessage).

Thanks a lot!


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


# af10de93a495dded3c7c0ad36a832c0c749a3840 28-Nov-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Changed a comment


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


# 075cff30a05a895d8165d727ebc1cfaf4f5e7055 29-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Also resize the window if it wouldn't fit on screen otherwise.
* Fixes bug #3675.
* Minor cleanup.


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


# 13e50c47a24ba560619b0a976e053c37690af984 25-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

* Indentation cleanup.
* 80 chars limit
* Copyright fixed.
* Better grouping of methods.

+alphabranch


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


# d587e0fbfe7f983b39dfbbf21e4ca05aa1354583 21-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Not sure why we are that generous (copying BView behaviour), but pressing
Alt, Option, or Control while scrolling the menu via the mouse wheel now
scrolls page wise.


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


# 12194e33b720dd4785c9ca34e06b807d91c36566 07-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Added missing default initializer for the message.
* Changed BMenuField::MenuBarLayoutItem::BasePreferredSize() to return the
min size as well, instead of a fixed 100 pixels for the width...
* More minor cleanup.


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


# 50f8cd14bb40895f9167f44752525386af219513 07-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Cleanup, no functional change.
* Remove superfluous operator=() implementations.


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


# dcc8ae91187ab85ff9e6fb61992ca8b82c47485f 01-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Some cleanups: made the bitmaps static, moved variables around. No functional change.


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


# 33e0d2e413848188519b4e77ef7cc291f04df804 30-Jul-2009 Rene Gollent <anevilyak@gmail.com>

Also remove no longer needed variable.



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


# 5171d87a62a51f0c40c4e4551d3626095b7906fa 30-Jul-2009 Rene Gollent <anevilyak@gmail.com>

Removed stray debug printf.



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


# 7a8567e61d42a4c1aa3ecae991ad8dd3b098db44 30-Jul-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved MenuPrivate implementation to its own file. Made MenuPrivate.h
self-contained. Adjusted other files accordingly.


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


# c3d7cee2d9b1ed21cb64db3def908434e9e32c9b 30-Jul-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Instead of creating the Modifiers bitmaps on demand, for every DrawItem invocation,
for every BMenuItem, have them created in _init_interface_kit(), and keep
them cached. This required some reorganisation of the code in Menu and MenuItem.
Also has the side effect that BMenuItem doesn't have to know about the
alt/ctrl/command keys stuff.
Added a comment in BMenu::AttachedToWindow().


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


# 4e23bc03830b81ec305154bcbddfa0792ece17f0 02-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* BMenu now scrolls when you press page up/down, if possible.
* BMenuWindow no longer uses a fixed scroll step - instead, the menu sets it
to the height of its first item.
* Cleanup.


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


# c6278c8f4931339b91b2bb10b5225596203475ee 07-May-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Lock the root menu before calling BMenuItem::Invoke(). This fixes #3842, although in some circumstances could introduce a deadlock (if someone does strange things in Invoke(), for example).

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


# a48d16a0269a7e7273b362fd509d85c27c6259e6 07-May-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

BMenuItem didn't draw the modifier indicator for B_OPTION_KEY. Fixes ticket #3887

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


# fdfeaa4eec63d2259c6232cbaa0105f27ff60a87 25-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Small code simplifications. No functional change.


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


# c7bb90f8de3de030bd9b9e670cbc12543658dd8a 14-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Improve cosmetics when menu scrollers are shown. The menu is not supposed to
draw all of the frame (no top/bottom borders).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29532 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


# 6eb09230bae52bcdf045e1f1920b67205c29adc8 01-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

* Resolve further warnings on GCC4.
* Enable -Werror on GCC4 builds as well (limited to the same selected targets).


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


# 321bba933d6aebfa8ec8eeb23f552f7f8c9e4585 19-Jan-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Vertical menu scrolling was enabled also in case the menu was wider than the screen, but this is obviously wrong. The menu window was also resized to be the height of the screen in this case, and it was the cause of bug #3174. Note that horizontal scrolling is not yet implemented

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28954 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


# e58419d39154618b01eb64eb237abbc9091e0450 02-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* White space cleanup.


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


# 4e0c2a797d01708bc3c1a49f2d496dc465f833cf 03-Oct-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Menus can be scrolled also using the mouse wheel

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


# 18fe1bf6fbe9b688719dfa69d30452d42f58cc9f 20-Sep-2008 Stephan Aßmus <superstippi@gmx.de>

Small fix for 80 char/line limit.


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


# c7d112ff6ad4c9c9e0382021662177a6a30e252a 20-Sep-2008 Karsten Heimrich <host.haiku@gmx.de>

* unmark existing marked items in case we add a new item that is marked
i did exactly that way in my code, which messed up the location popup



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


# d1fe803469631bebe7d1616e7f75be79e3e1bdd9 20-Sep-2008 Karsten Heimrich <host.haiku@gmx.de>

* automatic whitespace cleanup



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


# 2e2bff94a998a139f175a96ac360fbaf01889d05 12-Sep-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


# 009aa366c6edea3f78417173a31c4815220c2de2 20-Aug-2008 Alexandre Deckner <alex@zappotek.com>

- Changed Alt/Ctrl mode handling in Menu prefs, BMenu and Appearance
prefs as discussed in #2139 comments. This allow using Alt-Gr in either
Ctrl or Alt mode. Appearance needs a serious style cleanup, comming next
:)


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


# ebdb1a612b5b2b84966b14d547153e5171afa8bc 22-Jul-2008 Stephan Aßmus <superstippi@gmx.de>

Just small white space cleanup.


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


# c3f006deb072968cf6b471e6d93649ab44a5727e 12-Jun-2008 Alexandre Deckner <alex@zappotek.com>

- initialize the variable, we never know :)


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


# 709ef82757c29ea1ab4e51ec274ad141d606d0d1 12-Jun-2008 Alexandre Deckner <alex@zappotek.com>

- BMenu caches the preferred size (since r21396) but didn't recompute it if the ResizingMode changed, it did it only in
InvalidateLayout().

This fixes #1461, the bug appeared because DraggableContainerIcon uses a special trick, involving changing the resizing
mode, to get the total width of the menu items. (see tracker/ContainerWindow.cpp line 479)


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


# 18af47f5c48bfd21e0f51562a643eb28c8b23879 11-Apr-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Renamed some private methods to have the underline prefix, now that
BWindow doesn't call them directly anymore.


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


# 10f4d0679a8df9f72c2a295b2f2ac80ea776538b 11-Apr-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added a class MenuPrivate to handle access to private BMenu methods.
BMenuItem and BWindow are no longer friends of BMenu, but use this class
instead.


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


# 47ed33e09b643ffeb0ea2048a716411b4499d1eb 19-Mar-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Apply the same logic of BMenu::_Track() also in BMenuBar::_track():
check if mouse is over a submenu and then if it's over the current menu.


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


# 5c30ed357ad2a7a558d3a0171e0a017616969cee 07-Mar-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

If a NULL menuitem was supplied to BMenu::_NextItem(), the function
would have returned the second item in place of the first. Also return
NULL, not false, when there are no "next items".


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


# 495949fc2c4320f7981017ebbfacc7641d68729d 02-Mar-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

x_offset -> xOffset


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


# dc93a6b1ee8c9c398617fd53dd9fbda3572a76e4 01-Mar-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Applied patch by Denis Washington which implements "diagonal mouse
support" for menus (see ticket #284). Thanks a lot!


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


# 47d3c506076a25f67fbbf6f5d248ababe9519c76 21-Feb-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Change the order we use to check the position of the mouse pointer
inside menus: first sub, then current, then super. It's more logical,
and handles every case (hopefully I've tested every possible
combination) of overlapping menus correctly.
Fixes bug #1821.


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


# 5cc2ed98e27eb3cb597eda5079052498a6b27a1e 30-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Don't close a submenu if the mouse is outside the parent menu.


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


# cc5d5e7a14e8d1597759a274ac00b5cbafa236c1 15-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Reduced the time used for the vmware workaround


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


# d01f3af185a87ddb6f2b71a0609fc4c0869ad846 15-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Menu tracking now ignores mouse movements if they are too fast
(suggested by stippi). The movement threshold will be subject to
changes, as I only tested on vmware and it's probably too high.


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


# 6e11b3f991eb4594914ae0a40b9b52e5887a775f 10-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Close the whole menu hierarchy when invoking an item via keyboard. Added
a TODO comment.


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


# cb6cd9af6f11dc9a5f4ed2781323fddbe71df337 11-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

BMenu::_SelectNextItem() also opens the menu if we're inside a menubar.
That way menubars are navigable via keyboard. There are still glitches,
but menu keyboard navigation works now.
Minor optimization: cache the value of CountItems() instead of calling
it multiple times.


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


# 737ce1c03c575393ea66268e91dfe4e5e671b5db 10-Jan-2008 Axel Dörfler <axeld@pinc-software.de>

* The keyboard target was always the first menu in the window list - no matter if that was hidden or not.
This fixes the bug described by Stefano in r23343.
* Therefore, I enabled cached menu windows again.


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


# 0625889c619cb5dd73fee1ee32c37ef96cd54775 10-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

IsModal() now includes also the kMenuWindowLook. Fixes bug #1269. Please
review.
Added a compile time option to switch off the use of the cached menu
windows. Looks like there is a problem with the focus system, if I keep
the cached menu window around, it "steals" keyboard events from the main
app window after the menu has been opened and closed once.


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


# 85e661dbf099e66c3e5f32a20eac1ec1b03114b6 10-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Merged (parts of, for now) patches from Rene Gollent and
Christof Lutteroth, which improve menu keyboard navigation. Sorry for
the delay, I had these patches sitting on my hard drive for a while. At
least now you can open a menu with ALT + ESC, navigate it with the arrow keys,
and invoke an item.
Various issues still exist, including: menubars don't get the keydown
messages, and if you keep the mouse over the menu while navigating
with the keyboard, nothing will happen.


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


# 20817b7706e9355e420d272ff171d3e99b8c4d15 07-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Double sorry...


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


# 598ea11c81a447ec64eb32b772ff490aedb18008 07-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Sorry, this wasn't meant to be here.


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


# 3e06c4fae21ef3a265827885020d905a7f5e0cff 07-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Improved the code still a little bit. Menus seems to be somewhat more
responsive.


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


# 8d44324fda4c29a792c763700188a00487835e31 07-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Same thing as previous commit, only for BMenuBar. Added some other
comment


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


# 14e826c4bae40824ba9759e0662b9e9b914987fe 07-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Some changes in menu tracking:
- in the code path, now it's clear if the looper is locked or not
- if menus are quitting, now we don't call snooze() anymore, and avoid
the extra GetMouse() call.
- some other cleanups


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


# 7957219ebb6149c477aa6d3650b65c3c873e327f 07-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed a check which was always false.


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


# c129260a24b80e0955d65008dd7f606e605cfd03 03-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

There was a reason for this after all: Sometimes hovering from the
submenu to the parent didn't trigger tracking from it.


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


# 9e64a7ed1ba6e91718aeae9a5a32c74ba9ca5421 03-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed problem with some popup menus (check ticket #1679)
Moved GetMouse() calls near the check for exit conditions.
Reorganized a bit the code, and hopefully simplified it in some places.


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


# 4b812f294e015af3747367e8dc9330b4180450ae 01-Jan-2008 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Set sticky mode to the correct value before calling BMenu::_Track().
Fixes bug #1679


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


# 423e822abefbc0f0f178e8e6040e6dbec0ffd115 28-Nov-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Only enlarge the menus if there's a submenu symbol (regression). Fixes
bug #1647.


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


# c053b4a9f88163383f688281e8b04e696323aa60 19-Nov-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved call to _DeleteMenuWindow() to a better place

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


# 82a54995b5e7938312a398632feae2852cd7eb9b 07-Nov-2007 Axel Dörfler <axeld@pinc-software.de>

* Fixed _ComputeColumnLayout() optimization introduced in r22658: it actually
never worked correctly for any case which was very visible in Tracker (and
especially so if you had "sorting apps" turned on).
* Removed superfluous white space at the end of lines.


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


# afd60167e36d877d194f82b91069763ec2e0a7b8 07-Nov-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Reverted r21395. Many people didn't like the change, and after all I too
think it wasn't a really good idea. The alignment of shortcut
charachters and submenu symbols could use some more work, though.


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


# 795a2888e7a9a2947d2529f6e955d1544ff0e50f 29-Oct-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Rewrote PopUpMenu.h and MenuBar.h. Adjusted source files accordingly.
Added license to SeparatorItem.h


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


# 7bd24def80adfdabb86404ac43741ce5a8ab80b7 22-Oct-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

At least for the column menu layout, don't recalculate the whole layout
if the calling function supplied an item index.


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


# 083de48a4bf9a88273bc1aae47da41a97fed22d2 30-Sep-2007 Axel Dörfler <axeld@pinc-software.de>

* Rewrote the trigger selection mechanism: it now searches for uppercase
characters first, and then falls back to take everything. fTrigger is now
uint32 and works with all unicode characters; unlike in BeOS, the
MenuTriggerTest application now works correctly in Haiku.
* fTriggerIndex is now a character position, not a byte position of the label;
this allows BMenuItem::DrawContent() to draw the trigger at the correct
position, even if there are multi-byte UTF-8 characters.
* The above fixed bug #1506; triggers are still not working, though.
* Rewrote Menu.h header.
* Renamed all private methods (that are not called by BWindow) to have the
underscore prefix.
* Removed unused methods.
* Some minor cleanup.


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


# ded80ae491c15d53dbaed18be6bf0b5a8c2f70f9 28-Sep-2007 Stephan Aßmus <superstippi@gmx.de>

* very minor cosmetic change


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


# d237672a06518106027833e7157352c3b83ef10f 19-Aug-2007 Ryan Leavengood <leavengood@gmail.com>

A fix to bug #1154 by Justin O'Dell. Basically the settings for menus
default to having no accelerators, but that setting was not ever read
properly. So in fact the meny pref was correct, but the menus were wrong.
This fixes that.

If the default setting is supposed to be accelerators on then the settings
should be changed.


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


# baade5580ec622e740c6b28860bc9592064078df 17-Jun-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Typo. Fixes menus (bug #1276).


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


# 4fa167e12d1c7feb2ac0cada5a3062d7d0cdc771 16-Jun-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added layout-related methods (Min/Max/PreferredSize(), InvalidateLayout(),
DoLayout()).
* Don't resize the view and the window anymore, when fResizeToFit is not
set.


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


# af03527240a5060e79933c9db7d41dbe91bdcbbf 12-Jun-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Changed the loop to compute the column layout: Now the space for
modifiers is added after we've calculated the maximum width. This way we
don't get overlapping between the menu content and the modifiers bitmaps
themselves. TBR.


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


# 37ddfd14aba3fe42b0d034759c9ae53d8f984ce6 11-Jun-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Shortcut characters are aligned even if there's a submenu, like
discussed in the thread in haiku-development. I added a fSubmenus member
to BMenu, to be able to tell from BMenuItem if there are other items
with a submenu (maintained in BMenuItem::SetSuper()). If you don't like
this solution, let's just revert.


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


# fbe2f227cab65d4a1d972fd0bc2ed08681985bc2 12-Jun-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Some work on menu layouts:
- Menus are generally a bit wider (BeIDE ones didn't look nice)
- The modifiers bitmap are drawn more centered vertically
- Splitted BMenu::ComputeLayout() into three methods
- Various minor changes.
The menuitems still don't look nice with bigger font sizes, but we'll
try to fix this...


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


# 63cd2925a05555013e0c40224246b5a82d3e91f6 22-Mar-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Update the window size when adding and removing items. This fix bug
#683, but makes bug #582 look even more funny. Oh, well I hope I'll fix
it one day.


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


# 80a1eea587ca252b86ec6e260b51bb650563ade1 14-Mar-2007 Jérôme Duval <korli@users.berlios.de>

only chooses alpha characters for menu triggers


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


# 68fb266820911697f0f32ac91fbca0eefbd6230a 16-Jan-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

get rid of the now useless trackTime parameter

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


# ebd1a3a1309a2088fac4a5f068a5fb38b3600124 16-Jan-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

some more work on menus... fixed bug #953 and some more stuff


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


# 27e7210df2e4cebc78fb46935dfa5e88d9ff5208 05-Jan-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Since Waldemar changes to menus, replicants menus didn't work
anymore. That problem showed up for example during my haiku
presentation at Begeistert, where I couldn't delete replicants from
the desktop... grrrr!!! :-)


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


# 436bc5cc51e19eefac21e7ec151f8172385e035a 05-Jan-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Menuwindow was 10 pixels away from the screen bottom when scrolling was
enabled.


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


# f5e5e36026c647d81c445cde5c28928718ef22f9 29-Dec-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

forgot to fix this small style issue

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


# c7338938468d2b88409ef3ec4c3289d389da693e 29-Dec-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Greatly improved scrolling, and simplified the code too. Now scrolling
is done from inside the BMenu::_track() function, and not inside Pulse()
anymore. Patch by Lucasz Zemczak


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


# f0f8601b3fb1d24d77c1a9c34ddd51a9d55b2f43 21-Dec-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

small cleanups


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


# 8b91b40ae6098918aeea3c645b53032f8f6a9c9a 12-Dec-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Try to split the tracking function into smaller ones. Please bear with
me for the absolutely UGLY names. Also, if someone can suggest better
ones...
I seem not to have introduced any new bug.


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


# 08d92916672b9c6c4274547f9366485dce31330e 07-Dec-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

removed now unneded extra Draw() call used as a workaround to broken
scrolling.
Menu attached to menubars now use scrolling if they are opened near the
bottom of the screen (just like in beos). I'm not sure if this is so
nice, though, so it could be reverted. Patch contributed by Lucasz
Zemczak


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


# 64a74d5eff7c9e0356724c0e47ebe2983ea6735d 23-Nov-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

close the menu immediately when user clicks outside the menu

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


# 7fc2eecefd5eb575e14a8846f10143256cedfa3a 21-Nov-2006 Waldemar Kornewald <wkornewald@nowhere.fake>

Found out what trackTime was used for.
We should probably always start BMenuField menus in sticky mode and only switch
to non-sticky mode if the mouse was moved a minimum distance.


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


# 2628e60cbca2ed49bf7d5704f99eb72bec7e249f 22-Nov-2006 Axel Dörfler <axeld@pinc-software.de>

Moved BMenuWindow, BMenuFrame, and BMenuScroller into the BPrivate namespace.


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


# a7067566a15085384a0c47db8e55d4d3fade36f0 22-Nov-2006 Waldemar Kornewald <wkornewald@nowhere.fake>

Fixed menu disappearing bug when (in sticky mode) mouse button is pressed (and held down) and the mouse pointer is moved outside of the menu. Now, menus should work as expected and switch from sticky to non-sticky mode on mouse button press correctly.
BTW, I disabled trackTime. It seems to work without it, correctly, so I guess it can be removed completely.
If not, just revert the change ("if (system_time....") after TODO.


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


# 0512e989395e89d86a6b48b39ec276f3e2f660fe 21-Nov-2006 Waldemar Kornewald <wkornewald@nowhere.fake>

Now, menu reacts on first mouse release after having disabled sticky mode on MouseDown.


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


# b26e9fb499f9e9326f34872f86aabdfd086c837d 21-Nov-2006 Waldemar Kornewald <wkornewald@nowhere.fake>

In sticky mode, menus should only invoke the selected item after the mouse is released (instead of immediately on MouseDown).
I hope this is the correct fix.


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


# e0fcf72ae00e04f7746f76cf8e675b40a679506b 21-Nov-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed some semi-random crashes in deskbar and tracker caused by the new scrolling code. patch by Lucasz Zemczak. Also now the menu tracking function checks the result of the userdefined tracking hook, thus fixing bug #938

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


# 27cc25083edc760e3ce0f2163f5222fa118e7852 20-Nov-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

First try at menu scrolling, courthesy of Łukasz Zemczak. Works more or less, although a bit buggy

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


# fe23fb6699f41536bf1990fcdca05c8a72930383 29-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

* Renamed private BMenu::SelectItem() to _SelectItem(), and made its arguments a bit more sane.
* Fixed two GCC 4 warnings.


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


# 3cdc3291b47de4decee058426ddc85d9f169d9f1 11-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

The menu could leave the screen to the left, this fixes bug #902.
Patch by sil2100.


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


# 37f49a44b4c35dcb084415aeeb40040678de7be5 24-Aug-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

If show() fails, deselect the parent menu item.

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


# 27f1bc82177e1b746a2fe98506f607e8957d7520 18-Aug-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Don't activate the window, because it will steal the focus from the current active window, and clicking elsewhere won't close the menu

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


# 4e338ac6df8ea2b43e459e6ce82efd099ac01cec 17-Aug-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Started implementing menu keyboard navigation. Does only work for menubars because menu windows never get keyboard focus. Any idea how to solve this, since menu windows are B_AVOID_FOCUS both in beos and haiku?

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


# bfb0aa18d38c1367c26ee8de9fa2dab2a8010444 13-Aug-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

some adjustments at the menu width calculation. Menus are generally a bit less 'compacted' now. Might need review

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


# 509c95da0e4f1769ab7ed866e39fea8c41067ea8 12-Aug-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added s small workaround in BMenu::OkToProceed() to fix deskbar not opening the be menu under heavy load (or, always, under qemu) if the mouse button was released too soon. Beos seems to do something similar, although it's a hack

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


# b6bf3346f38510bfffc1bbe97b20665cbd92c6eb 08-Aug-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

When calculating the menu frame, take the resizeToFit parameter into account. This fixes bug 574, although the implementation isn't probably completed yet. Needs more investigation.

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


# cf2ef43abd5e9c605d1d82169444b141383f8700 13-Jul-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

fixed a small problem with StealFocus and RestoreFocus

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


# 9fcdf0e92c0881017effddc8c6dafa0ca6d02fbb 07-Jul-2006 Jérôme Duval <korli@users.berlios.de>

MenuItem::Archive uses BArchivable::Archive
inverted the enable state when initing the BMenu


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


# 9b224ec82e0d967df0d7d531566b998f7f2100f7 07-Jul-2006 Jérôme Duval <korli@users.berlios.de>

add item frames to BMenu archive
add class names to BMenuItem archives


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


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

archive deep when needed, restore menu items


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


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

archives menu items in menu archive


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


# 9d9c1564b8297e61710cd7fda9e2ba7b994739ff 03-Jul-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

One of the BMenu::AddItem() variations crashed if the passed item was NULL. Fixes bug 465

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


# a03ac895264010903a2bf3ba28f259d1d1dbfefd 05-Jun-2006 Jérôme Duval <korli@users.berlios.de>

fixed some property_info and value_info for BShelf, BMenu, BWindow and BView
real support is to be implemented for a lot of them


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


# b9af5bfa5c018d4d53252750943ae5e16da562d5 30-May-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

- Fixed the recently introduced bug where menus would open again once closed. -Now hitting ESC will close the menu. - Reverted to the other variation of GetMouse() as Axel's advice

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


# 0dcf122e37e95f394b0c70dae94f63e94986760d 29-May-2006 Axel Dörfler <axeld@pinc-software.de>

Removed now incorrect comment.


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


# c1dd282b9b2ae7879d2a6aa58d1a1bac1453ee4e 28-May-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed some bugs in StealFocus, RemoveFocus and SetStickyMode

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


# 848b89034e2c6bc7b4a990f832e2102f2c6044ba 27-May-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

More hacks to BWindow's mousedown handler, to fix some problems with menus. Fixes bug 610 among other things. Note: I don't like this code so much, but apparently BeOS handles it in a similar way. I accept suggestions on how to improve this.

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


# e061d1bae5349fbb420946e44b9c6594786e3f6d 27-May-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

an eventually opened menu is now quit in BWindow::DispatchMessage()
before sending a B_MOUSE_DOWN message to any other view. This fixes bug
594 for real and another bug in BMenuBar. BMenuBar tracking will also
be simplified a bit because of this. Install items to a NULL window on
Show() as does R5 (although I don't know why yet).


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


# 03f2d7791e97456c292bcbf604c48315b1381821 26-May-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Switched back to the GetMouse variation which does NOT check the message
queue, should fix bug 594 and not risk of losing clicks. SetStickyMode()
calls StealFocus() to give the chance to be keyboard-navigated to menus.
Added an extra (temporary) InvalidateLayout() because some items weren't
added in
some cases (Tracker's attributes menu for example)


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


# 73f99cd6aef6ac3d539e4191e4bb7819d8d0c63e 26-May-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

reverted axel's change to menu, which introduced some other problems, and I can't reproduce that problem anymore. Axel, can you verify, please ?

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


# 712c1e8c396de7f5f390d475f92eba45e9f287ec 22-May-2006 Axel Dörfler <axeld@pinc-software.de>

Fixed the BMenuBar not spanning over the whole window width for MediaPlayer
and VLC (what a coincidence :)).
Would be nice if there is a better solution, though...


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


# 431da4dd4bbcc8d261b47392aa1a7bf6566ff4b9 22-May-2006 Stephan Aßmus <superstippi@gmx.de>

AddItem(..., frame) used AddItem(..., index) which
triggered a debugger call -> refactoring and cleanup


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


# b0f89f914d8d7e1e633c41566de0d5ae74c087b3 20-May-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed the problem mentioned in bug 484, some cleanups, implemented
BMenu::InvokeItem() more correctly.


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


# 2a3de9bc1d09fc4ae7ae256b472784a1cfee968e 19-May-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


# f71111019195bdb6ab419ecfdb422b9dce2361b6 19-May-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Refactored the AddItem mechanism. Now the private _AddItem() method doesn't lock the looper or invalidate the layout anymore, which is done by the caller. This way AddList is much more efficient.

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


# 925479d7b37c9182934fcd1e1b88a6ac641273c2 09-May-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added a new method RelayoutIfNeeded(), which does the real Layout invalidation, it's called by menubar and menu. This fixes the menufields not being resized. Note that a problem still remains, will be fixed shortly (hopefully)

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


# 63b78888542c61d523318d3d219e0245a96cee88 07-May-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

BMenu::InvalidateLayout() should only sets a variable, the real invalidation is done on Draw() or AttachedToWindow() (like on R5). This fixes bug 567 (at least the crash in HotEdit)

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


# 4436b7269deb26c44ccaa9f57a1a041e13f1afed 30-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Menuitems are layoutted better, fixing bug 526

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


# 9c418bc0f947449a919b6972d59bc9333cd4d704 29-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

Fixed warning.


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


# 05e515d56ce28f5a67f0c5cc3d63efd1a1153228 22-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

hopefully improved menu tracking. Among other things, this fixes bug 461

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


# 59d1b7be9db2f6c8bf0d9e015793999817587c89 21-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

It's a good idea to snooze AFTER we've checked the possible exit conditions

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


# 48688dcd5ffa64607229e76f2ae12db39e08b74c 20-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed a bug in menu tracking: in some cases you had a goal of 1 pixel when trying to enter a submenu ( http://flickr.com/photos/johndrinkwater/131805244 )

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


# b03deb09dbdb2968fecc5f128fd6ae4cf7b8169f 19-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Menu settings are now handled by the app_server. As a result, changing them does something, although they aren't saved to disk yet. 'click_to_open' is not checked anymore, because it was useless anyway, I'll remove it from the Menu preflet too.

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


# 1b5b2e4c354df94fd0246f305a2b88d0013c81de 18-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

MenuItems don't flicker anymore when a submenu opens (fixes bug 484). Implemented popupmenu's 'clickToOpenRect' feature, used by tracker's dirmenus, for example (fixes bug 523

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


# 4697016070d7340a32c4860cc7804b20366ebae3 17-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Lowered the delay in menus after which they don't switch to sticky mode, should fix bug 491, although its not really a bug

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


# 415c63bee290da0d064c5102d5e32b7f4ffe3aef 15-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

PopUpMenus didn't respect the openanyway setting (sticky mode), they always set it. And even in that case, they weren't working correctly. This should fix bugs 463 and 476. This might not work if click to open isn't selected in the menu prefs, though.

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


# 36aa2198b715fd6f8440f73355c22cc951c4f22d 14-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Some more changes, fixed bug 487, added a small hysteresis so menus could be more nice to navigate, some corrections in popupmenu

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


# 0e0b8fd554480de7f904b8e886c019bda319bb0f 12-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

more fixes

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


# 7d550b53a0d62f4cae067cfe64f2f5ca8fb3b9ea 11-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

and there, the usual forgotten stuff

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


# 2191a09a931d0c5ababb73c00ea78d3e40d58c17 11-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

big improvements for menus. The tracking is in many ways on par with r5, except for a few things, like diagonal movement and that grandparent bug

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


# 9c5c552dd69dd536304986d294022acb814170e2 07-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

more fixes

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


# bf5d7973b9bef93307d77a89f8fe1df87c7fbe0e 07-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Obviously I put in the usual 'untested last minute change' which broke everything. Should be fixed now.

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


# c51421cc0b5ce9bcf492722a38b138dd9468b166 07-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

implemented sticky mode. Let's see how many complaints because it's not perfect at all. Under qemu it's super crappy btw

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


# 29c407a371f0e98ab143372acebee70ec5cd86dd 04-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed menus in case the window was hidden (VLC, StyledEdit). This is just a quick fix and will be changed later. Thanks to John Drinkwater for testing

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


# 6d9adcf120c46ff6631f126cc8a6785f5ed43197 04-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

Removed a superfluous const_cast and a variable from ChooseTrigger().


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


# cb2998af29922e3bdccf6c8c26dd20e947e32598 04-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

BMenuItem::SetTrigger() and SetAutomaticTrigger() now also update fTriggerIndex.


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


# 0f11085c6cb253405a96edd783bd77f668c05c8c 04-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

* Rewrote MenuItem.h (we're no longer using Be's header).
* Renamed private SetSysTrigger() to SetAutomaticTrigger().
* Added the '_' prefix to private methods that aren't called by anything outside
BMenuItem (ie. no friend classes either).


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


# 195f58ddbb58c696d87d4e50f763094d6aed30d9 03-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

BMenu::_AddItem() keeps the looper locked for the whole time, other changes: let's see if this fixes that bug

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


# e90bed06b11d8bbfc1477952b63d5a7104fc1769 02-Apr-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed vlc menubars

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


# 262a2483e271b141b314468f485fe48d141b4341 31-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

I woulnd't say the classical last words... but I seem to have fixed latest crashes...

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


# f2e9b063a019959770d027777b96ac63f71e35ca 31-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

This small change could even fix some big problems with menus... unfortunately I can only reproduce them in vmware, and not in qemu

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


# 793fde40eb9b021368e69584549fe8f241704f8d 29-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

This should fix some problems I experienced later. At least, I can't reproduce them anymore

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


# 35beeaa99fcab37b2404af06c9259ff6cc64efe7 28-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Minor improvements

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


# 4185bd8b34afeea08550982b4a93d9a13a508504 28-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Hopefully simplified BMenu/BMenuWindow relationship and made it more robust.

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


# 9913366fe7298822b99fe785c2bdc34dc22401ae 27-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Reset fAttachAborted otherwise menus never get filled after they have been interrupted once.

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


# 6aa12747cd3bb81a2a6a902c840106f0ae23c9ae 27-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Stupid me. ConvertToScreen() isn't needed, and I should read more carefully my own code

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


# ed49f4afcd2396ec14f9bbf71df8e9d19e4c5e25 27-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Improved OkToProceed(), removed unused file


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


# f356aedc02c9128eb7ede409e796e885ab5c8825 27-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implemented BMenu::OkToProceed() and used it correctly in BMenu::AttachedToWindow(). For some reason, though, I had to comment it out partially as something is wrong. I haven't debugged, though

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


# 7abe70f1b4ea54686c0a200b9087b958ddc94705 23-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Hopefully cleaned up a bit the locking in BMenu::_show()/_hide()

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


# 37cf3d970dd0ca905fac555a7a117972a89ec439 22-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Avoid attaching a menu to the BMenuWindow when not needed

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


# b80eb9d443ee892b6c4e10a46112a76eab01124c 22-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Partially reverted axel's change, because it brings more troubles than benefits (menus lock when they reuse the supermenu's menuwindow). I'll try to resolve the various problems in another way. Some cleanups

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


# e87965deed68343f31c7aead94f91aeb4717d94c 21-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* Fixed a possible crash when removing and adding items from a window.
* This does not yet close bug #233, but could also be a reason for this crash.


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


# 7a2c9b35cd02aa31e7f5383bbc51af8a65398d7d 21-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Reverted to r16487 due to various problems. I'll recommit the code once it's fully working.

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


# ebaeaa12240330c86ef88999869c86244cc50e68 20-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

BMenu::InvalidateLayout() now just marks the cached layout as invalid, instead of recalculating it. This results in less computations. Reorganized the layout calculation due to that. Now it's done once in AttachedToWindow(), and in Draw(), only if needed

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


# 65b4fb8ab1cc75ce5fee62cb5f6963fdd8c4c7d4 20-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Check if alt is the command key on BMenu::AttachedToWindow instead of doing it for every BMenuItem::Draw()

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


# 21f9f047fad9076b57be15e92ae0736f31ecddb7 15-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Don't resize items if not needed, small change

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


# 446d93a0ccece04f0f76ce48a9d3fdf43033d504 08-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

sorry, this was meant to be removed

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


# 49b154d166545327c55c0a7b32a68db828d0987a 08-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed wrong calculation of the menu frame if layout is B_ITEMS_IN_ROW. Fixes bug 209

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


# 66188b66764cb518c53a3c3c1e350d35ee5e930b 06-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

pulled check out of the loop

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


# 6d87a14258ae8e7f06c3131db3fb44f864e7108e 06-Mar-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Take the max content width into account in BMenu::ComputeLayout(). This fixes bug 188. IOW the deskbar expander arrow is now shown

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


# 2c11ec31c876f2b77e3d03c9776dbf99119bbce7 03-Mar-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


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

Removed trailing newline from window name.


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


# de71e4da6d8f701ea6db2e618f9d3df5488405e3 18-Feb-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

_BMCItem_ isn't used anymore

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


# 15b4cc6ea6933fb22fc77dbd16bc6ad65de10ee5 09-Feb-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

reduced the histeresis, now it's a fixed value

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


# 2a5bad15418179e562d81f9750336f35a1a5a514 09-Feb-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


# fd1528f275519e9415ec10d9346bd421533e310d 30-Jan-2006 Axel Dörfler <axeld@pinc-software.de>

Accidently broke selecting sub menus with the last commit.


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


# ec549309c907fadc4956f18e6f529d7b9e7d0745 30-Jan-2006 Axel Dörfler <axeld@pinc-software.de>

The menus work a bit less good now I think, but they no longer have 100% CPU usage
when the menu item under the mouse cursor has a sub-menu.
Minor cleanup.


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


# 61ba5a32c1377a3a20242991f2ba24bd857b8e97 29-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added some code to draw "empty" in empty menus. Not working for the
moment, but committing since it's too late to continue working, and at
least the window is resized correctly...


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


# 365a41fd5c4054c15534c83f8cbe3b34ed9228ef 21-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Reduced the time hysteresis. Need more testing, though

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


# 0219459ba09dcf3a0755b2bee9bc761033fb59cf 21-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added a small time hysteresis: submenus are only opened if the user keeps the mouse there for a while. I'd like feedback on this

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


# c592b98fd2a7e0655abdaade7005acb6fac4677b 17-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Reworked BMenu::Set/IsEnabled(). I tested what happens under beos and our code seems to be finally correct

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


# 0c7450238f027ecee532e8af936715741218b895 16-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

followed stippi's suggestion and implemented SetEnabled more cleanly

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


# dd180e63784033715c13b58a3be4df7b1bf5d474 16-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

SetEnabled() enables or disables the parent menu too, SetRadioMode() and SetLabelFromMarked() call each other if needed, BMenuBar::Draw() doesn't make a difference if the menubar is disabled or not, should even fix bug #87 as it was calling LayoutItems() every cycle. Work done by John Drinkwater and me

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


# fc3a8a1c73d9d02de79d39acbba37aa3f3220d7a 13-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed popup menus opened at the wrong position (mostly noticed in Installer) with a horrible hack which I can't see how to avoid

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


# 201381d6abdfe03af5d3a854fc43b708c75f98e6 13-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Menus make a better use of windows: when a child menu is opened, it asks the parent for a window, which is then cached for every other child for that parent menu. This avoids multiple creation/deletion of BWindows in a row. This also makes menus much nicer to use in qemu (together with the slight change in locking in BMenuBar (Lock() instead of LockWithTimeout))

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


# b120bcd665f4ee4034762ab61841ed6b361c148f 10-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Don't quit tracking the menu even if OverSuper() returns true, if HitTestItems() doesn't return NULL. This should fix (at least in part) bug #85

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


# b8fe2d4ed5a773696a8da86cbb2bd3857dcdb035 17-Dec-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

some changes, fixed a possible segfault

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


# 1d44f6791d21690ce81fded7afa96b7824e03872 08-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

Now checks if locking the looper succeeded.
Now hides the window before removing itself to prevent a superfluous drawing update.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15410 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


# 758b1d0e05fe1042cce6e00d194a147802d4f9be 12-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
Otherwise the an inner class with that name is considered as friend.
gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



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


# ac50702270b71c10afb5e10909695c2b83c8fb35 10-Nov-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

BMenu::FindMarked() was broken just like FindItem() was. And it's even my fault. Yay!

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


# 8f4959d844865f4c8a098066623533499efed38a 09-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

Both BMenu::FindItem() versions were broken and could return a wrong item.


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


# 86343dcbcf26fbbec32e20300ff935844ad8f304 09-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

There is no reason ComputeLayout() needs a parent/window - in fact, it should always
work correctly (for GetPreferredSize()).


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


# ecf92c7e4be126f923fbfebf7def8a33e7807df2 02-Nov-2005 Stephan Aßmus <superstippi@gmx.de>

cleaner version of RemoveItems, more error checking

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


# e7dfacc2b454f948d16eab10851c9cd1be510076 14-Oct-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed a typo which caused a bug.

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


# 8991f1a2af5d078ed53bf15bd6fcef57b667695c 06-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Implemented basic dynamic item support (IOW the BSlowMenu/BNavMenu stuff is now working
as expected), OkToProceed() needs some work, though.
Made _AddItem() more safe - the window is now also locked during BList::AddItem() and
while getting the window to install the item in.


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


# 0b4ce825fbfadb81779d4c8e17db2940b82e7b9f 05-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Fixed ComputeLayout(); it added 20 pixel for every item in the list in B_ITEMS_IN_COLUMN.


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


# 1b1b68919c39453998ad082eb1bbfad64e2d2c20 05-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Fixed CalcFrame(): it could be called with Superitem() and Supermenu() == NULL.


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


# 4da171eff772ef4d5eaa903e56fd8a4fe1209d8d 05-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

CalcFrame() no longer returns the maximum frame, but the one that should be
used.
Changed CalcFrame() so that it tries to find the best on-screen location - works
already, though it might have to be improved.
Moved ScreenLocation() so that it's close to CalcFrame(). Changed the position
for B_ITEMS_IN_COLUMNS a bit (they now appear one pixel lower).


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


# 2e6a5805ba8db3b072d81257cc44f966def5fd37 05-Jul-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


# 2323effaeecca2d23d0355f1a9ac53222ac28528 05-Jul-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Avoid calling ComputeLayout() if the menu is not attached to a BWindow. Small cleanups.

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


# 1ae414f3c63773e8ac73ecd11eeec41b6bf2638e 04-Jul-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Don't assume we have an owner. This fixes a crash in MenuWorld, but needs more investigation

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


# 1a02bff86347fc5c34107f1c0c3b9ba3de69915e 04-Jul-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

the menuitem wasn't deselected when you moved the mouse away from the menu window. Thanks to Axel for reporting.

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


# 169425459faa4b7ce3bd1f65a3c12d56dc09623a 02-Jul-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Avoid calling BMenu::_hide() when not needed

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


# 557dfeeb1292aa8930a1c893316eb37bca79a986 23-Jun-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implemented CalcFrame() and used it to limit the menu frame's size (actually, only the width for now). This shows that TruncateLabel() works.

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


# 61e19def00fba5965f369d3c0443199cc85b21ab 20-Jun-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Verified and removed a ToDO item (thanks goes to Olivier Milla)

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


# ba61835820c6638402503bfd39e19b00f6677fdf 14-Jun-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed submenus for good

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


# 757ce6e540f09208a4bf7b155aa49be2183e572b 15-Jun-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Greatly improved BMenuBar::Track(). Now it uses a simple tracking loop instad of two nested loops. BMenu will follow, someday.

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


# ac7ee5af14d45dd8b7a35b5550540c7b469788f2 11-Jun-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

removed COMPILE_FOR_R5. For BMenu it doesn't make any sense anymore.

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


# fd083d7eede353001ea7adfa17e9974b94d26137 07-Jun-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Use the private menu actions defines. Small cleanups.

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


# 8768dcd876ab84204d47b28c879642e971349504 07-Jun-2005 Stephan Aßmus <superstippi@gmx.de>

BMenu installed all previously added items each time a new item was added

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


# 26ad9841a29ff5945fc3706142f52df8b77a4c9b 30-May-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Menus don't flicker anymore, extended some ToDos, small cleanups. Implemented BMenu::IsItemVisible() as I think I'll need it soon, extended Bmenu::OverSubmenu() to be recursive, it's not used at the moment but should be.

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


# 063446f455257c680c88681e9f954fa6ec8d89a5 23-May-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Reverted that last change, as it was really a bad idea afterall (as Axel pointed out)

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


# 8b47fd8708e59bc6a73566593373b65b1d701397 23-May-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

MenuWindow's look is now B_BORDERED_WINDOW_LOOK, so we can avoid drawing the border ourselves.

Now BMenu caches its windows instead of creating a new one every time. This last change could be reverted, though, as we could end up keeping around too many windows.

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


# f32c74752df02ee8175a6e20db35a6955446ac31 16-Feb-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

A couple of small style changes, fixed a problem with some compilers


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


# 6a1a734c5f92de2dc0232a67bdbc23fb9f42ce01 15-Feb-2005 DarkWyrm <darkwyrm@gmail.com>

A small crash fix whilst testing with a stock People app


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


# a0394110da7d51bdae5bb8bc9adb6f1c413bff87 19-Jan-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

We have submenus working (still not perfect, though)


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


# 0c14fc6dfd02183cabee248c9768c3b8b02fc69d 19-Jan-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Changes to make BMenu behave correctly. Implemented SetTrackingHook(). AddItem() calls the debugger in some cases, as it should. Cleanups.


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


# 727e24f793266555eb7e94459364f61a293b836c 18-Jan-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Now BMenu also calculate the triggers for BMenuItems.


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


# 5fd36a241d588cbd6b1f0475f533dcc9f810bb23 13-Jan-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

A BMenuItem couldn't be removed and then added back to a BMenu: Fixed.


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


# 4ff5ade2533831e6142d04d814b41bf1f88a688b 04-Jan-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Many visual fixes to BMenu. Now it's almost undistinguable from the real thing. SeparatorItems were being drawn too dark. Fixed.


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


# 5b7528754df83835624e2536e13c848deb58ac93 03-Jan-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


# 1664b981f2eb246d6622806e20c04b187664cafd 03-Jan-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added some todo items, cleanups. Removed the frame parameter from BMenuWindow as it's not needed.


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


# 4e876d126e7ab87ec51562b1e7f75358448ad5f6 03-Jan-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

implemented B_ITEMS_IN_MATRIX layout correctly. Small cleanups all around.


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


# 9a8540fb4ec52052c97b8bffa92c68d3ea7420ac 03-Jan-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Now menuitems are highlighted correctly, and submenus open, at least.


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


# 92aa9dcf8579e6bb7d506d7443a77eb150396cb8 31-Dec-2004 Stefano Ceccherini <stefano.ceccherini@gmail.com>

some more cleanups. The AddItem() variation which accepts a BRect parameter now calls the debugger if called when the layout is not B_ITEMS_IN_MATRIX.


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


# 9944a2998d722ab58cf6badb1948cf087f56285b 31-Dec-2004 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Now items are removed correctly. All RemoveItem() call pass now through the private RemoveItems() method. ComputeLayout now uses a switch block, and prints a warning if B_ITEMS_IN_MATRIX is used, since it's not supported yet. Some cleanups.


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


# efa306a09db500d8ee2d7096f9cda0a818ec8e60 30-Dec-2004 Stefano Ceccherini <stefano.ceccherini@gmail.com>

BMenu now does even work correctly and doesn't flicker anymore. Submenus does not yet, though, and sticky mode is not yed supported.


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


# b0d01b5f78336ce86555eed4d4824de02f5db163 30-Dec-2004 Stefano Ceccherini <stefano.ceccherini@gmail.com>

MenuWindow now uses the private window_feel "1025", which I guess we'll need to implement server side too, since it behaves differently than B_MODAL_WINDOW_FEEL. Menu items added to a menubar didn't appear immediately, so I forced an Invalidate(). Could be made better, I think.


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


# 31e911da16b7d9a49f86013d0982f2a7507ed0b7 30-Dec-2004 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Fixed BMenuBar drawing. Managed to have BMenu working (partially) with BMenuBar.


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


# 446b8c194e9ec252eaac62a62551800b9775b833 27-Dec-2004 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved BMenuWindow to its own file


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


# a87bf00703005530cef8bd1ea96d2e0396a035a0 09-Oct-2004 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Bare minimum stuff to have BPopupmenu working with our own BMenu


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


# ed52cdfd58e556bf2759598fd9f30cae374fda37 27-Jun-2004 Axel Dörfler <axeld@pinc-software.de>

Fixed the build by disabling MouseDown/Up/Moved() methods.
Added missing BMenu::sMenuInfo storage.


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


# 8e449e70e9da3d7c15138490b00ad0e722dda5c6 04-Sep-2003 haydentech <haydentech@nowhere.fake>

Eliminate one warning and one bug


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


# 40ceba30d6b162a3a59501900e73f236ccac92ab 03-Jun-2003 haydentech <haydentech@nowhere.fake>

Janitorial work and gcc3-related fixes


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


# af61f86fcbf7837efbb318a97e69ba727ad169f7 14-Nov-2002 Marc Flerackers <mflerackers@nowhere.fake>

Added headers


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


# 16cedc602ffb4e89792b5517d17360c93b07aaf8 14-Nov-2002 Marc Flerackers <mflerackers@nowhere.fake>

Initial Checkin


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