* 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
This commit is contained in:
Axel Dörfler
2007-09-30 10:52:45 +00:00
parent 05bcaa5a60
commit 083de48a4b
5 changed files with 676 additions and 797 deletions
+4 -4
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2006, Haiku, Inc. All Rights Reserved.
* Copyright 2006-2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _MENU_ITEM_H
@@ -65,7 +65,7 @@ class BMenuItem : public BArchivable, public BInvoker {
void Uninstall();
void SetSuper(BMenu* superMenu);
void Select(bool select);
void SetAutomaticTrigger(char trigger);
void SetAutomaticTrigger(int32 index, uint32 trigger);
protected:
virtual status_t Invoke(BMessage *msg = NULL);
@@ -91,13 +91,13 @@ class BMenuItem : public BArchivable, public BInvoker {
float fCachedWidth;
int16 fTriggerIndex;
char fUserTrigger;
char fAutomaticTrigger;
char fShortcutChar;
bool fMark;
bool fEnabled;
bool fSelected;
uint32 fTrigger;
uint32 _reserved[4];
uint32 _reserved[3];
};
// BSeparatorItem now has its own declaration file, but for source