* Made the messed up BMessage* constructors private - since it only affects the

layout API, we probably can just phase it out after a while.
* Introduced new constructors, and added missing flags to one of them to make
  it more convenient to use.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41350 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2011-05-06 20:04:55 +00:00
parent 10dfe8970c
commit 4296233f0e
2 changed files with 39 additions and 6 deletions
+10 -4
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2009, Haiku, Inc. All rights reserved.
* Copyright 2006-2011, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _MENU_FIELD_H
@@ -25,10 +25,9 @@ public:
uint32 flags = B_WILL_DRAW | B_NAVIGABLE);
BMenuField(const char* name,
const char* label, BMenu* menu,
BMessage* message = NULL,
uint32 flags = B_WILL_DRAW | B_NAVIGABLE);
BMenuField(const char* label,
BMenu* menu, BMessage* message = NULL);
BMenuField(const char* label, BMenu* menu,
uint32 flags = B_WILL_DRAW | B_NAVIGABLE);
BMenuField(BMessage* data);
virtual ~BMenuField();
@@ -113,6 +112,13 @@ private:
friend class MenuBarLayoutItem;
friend class LayoutData;
BMenuField(const char* name,
const char* label, BMenu* menu,
BMessage* message,
uint32 flags);
BMenuField(const char* label,
BMenu* menu, BMessage* message);
void InitObject(const char* label);
void InitObject2();
void DrawLabel(BRect bounds, BRect update);
+29 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2001-2009, Haiku, Inc.
* Copyright 2001-2011, Haiku, Inc.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -167,6 +167,32 @@ BMenuField::BMenuField(BRect frame, const char* name, const char* label,
}
BMenuField::BMenuField(const char* name, const char* label, BMenu* menu,
uint32 flags)
:
BView(name, flags | B_FRAME_EVENTS)
{
InitObject(label);
_InitMenuBar(menu, BRect(0, 0, 100, 15), true);
InitObject2();
}
BMenuField::BMenuField(const char* label, BMenu* menu, uint32 flags)
:
BView(NULL, flags | B_FRAME_EVENTS)
{
InitObject(label);
_InitMenuBar(menu, BRect(0, 0, 100, 15), true);
InitObject2();
}
//! Copy&Paste error, should be removed at some point (already private)
BMenuField::BMenuField(const char* name, const char* label, BMenu* menu,
BMessage* message, uint32 flags)
:
@@ -180,6 +206,7 @@ BMenuField::BMenuField(const char* name, const char* label, BMenu* menu,
}
//! Copy&Paste error, should be removed at some point (already private)
BMenuField::BMenuField(const char* label, BMenu* menu, BMessage* message)
:
BView(NULL, B_WILL_DRAW | B_NAVIGABLE | B_FRAME_EVENTS)
@@ -207,7 +234,7 @@ BMenuField::BMenuField(BMessage* data)
int32 align;
if (data->FindInt32("_align", &align) == B_OK)
SetAlignment((alignment)align);
if (!BUnarchiver::IsArchiveManaged(data))
_InitMenuBar(data);
unarchiver.Finish();