Author: axeld Date: 2011-05-06 22:04:55 +0200 (Fri, 06 May 2011) New Revision: 41350 Changeset: https://dev.haiku-os.org/changeset/41350 Modified: haiku/trunk/headers/os/interface/MenuField.h haiku/trunk/src/kits/interface/MenuField.cpp Log: * 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. Modified: haiku/trunk/headers/os/interface/MenuField.h =================================================================== --- haiku/trunk/headers/os/interface/MenuField.h 2011-05-06 20:03:15 UTC (rev 41349) +++ haiku/trunk/headers/os/interface/MenuField.h 2011-05-06 20:04:55 UTC (rev 41350) @@ -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 @@ 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 @@ 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); Modified: haiku/trunk/src/kits/interface/MenuField.cpp =================================================================== --- haiku/trunk/src/kits/interface/MenuField.cpp 2011-05-06 20:03:15 UTC (rev 41349) +++ haiku/trunk/src/kits/interface/MenuField.cpp 2011-05-06 20:04:55 UTC (rev 41350) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2009, Haiku, Inc. + * Copyright 2001-2011, Haiku, Inc. * Distributed under the terms of the MIT License. * * Authors: @@ -168,6 +168,32 @@ 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) : BView(name, flags | B_FRAME_EVENTS) @@ -180,6 +206,7 @@ } +//! 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 @@ int32 align; if (data->FindInt32("_align", &align) == B_OK) SetAlignment((alignment)align); - + if (!BUnarchiver::IsArchiveManaged(data)) _InitMenuBar(data); unarchiver.Finish();