Commit Graph

22 Commits

Author SHA1 Message Date
Stefano Ceccherini 18af47f5c4 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
2008-04-11 08:53:25 +00:00
Stefano Ceccherini 10f4d0679a 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
2008-04-11 08:22:09 +00:00
Stefano Ceccherini dc93a6b1ee 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
2008-03-01 22:15:23 +00:00
Stefano Ceccherini d01f3af185 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
2008-01-15 13:40:13 +00:00
Stefano Ceccherini 6e11b3f991 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
2008-01-11 12:08:21 +00:00
Stefano Ceccherini 9e64a7ed1b 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
2008-01-03 07:30:05 +00:00
Stefano Ceccherini afd60167e3 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
2007-11-07 09:38:55 +00:00
Axel Dörfler f6e4cbb952 * Rewrote BeBuild.h which had "a few" consequences (got rid of all those class
definitions).
* Minor cleanup here and there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22577 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-15 20:13:55 +00:00
Axel Dörfler 083de48a4b * 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
2007-09-30 10:52:45 +00:00
Ingo Weinhold 4fa167e12d * 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
2007-06-17 01:15:05 +00:00
Stefano Ceccherini 37ddfd14ab 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
2007-06-12 12:28:06 +00:00
Stefano Ceccherini fbe2f227ca 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
2007-06-12 09:10:08 +00:00
Stefano Ceccherini 68fb266820 get rid of the now useless trackTime parameter
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19828 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-16 15:22:31 +00:00
Stefano Ceccherini 8b91b40ae6 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
2006-12-12 16:05:16 +00:00
Axel Dörfler 2628e60cbc 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
2006-11-22 11:52:18 +00:00
Axel Dörfler fe23fb6699 * 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
2006-10-29 11:22:14 +00:00
Stefano Ceccherini e061d1bae5 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
2006-05-27 09:57:14 +00:00
Stefano Ceccherini 925479d7b3 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
2006-05-09 21:48:51 +00:00
Stefano Ceccherini 2191a09a93 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
2006-04-11 20:20:41 +00:00
Stefano Ceccherini 65b4fb8ab1 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
2006-03-20 20:20:29 +00:00
haydentech 30fd51473f Minor header-related changes
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3246 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-05-14 17:21:46 +00:00
beveloper d734a8ce5a some header files to be R5 compatible
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1617 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-23 13:54:44 +00:00