Fixed compilation and applied our style guide.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8220 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2004-06-28 13:12:06 +00:00
parent af53a136d1
commit 2847a12df4
+133 -90
View File
@@ -1,5 +1,5 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Copyright (c) 2001-2002, OpenBeOS // Copyright (c) 2001-2004, Haiku
// //
// Permission is hereby granted, free of charge, to any person obtaining a // Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"), // copy of this software and associated documentation files (the "Software"),
@@ -25,22 +25,10 @@
// activate it. // activate it.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Standard Includes -----------------------------------------------------------
#include "typeinfo.h"
// System Includes -------------------------------------------------------------
#include "PopUpMenu.h" #include "PopUpMenu.h"
#include "MenuItem.h" #include "MenuItem.h"
// Project Includes ------------------------------------------------------------
// Local Includes --------------------------------------------------------------
// Local Defines ---------------------------------------------------------------
// Globals ---------------------------------------------------------------------
//------------------------------------------------------------------------------
BPopUpMenu::BPopUpMenu(const char *title, bool radioMode, bool autoRename, BPopUpMenu::BPopUpMenu(const char *title, bool radioMode, bool autoRename,
menu_layout layout) menu_layout layout)
: BMenu(title, layout), : BMenu(title, layout),
@@ -54,7 +42,8 @@ BPopUpMenu::BPopUpMenu(const char *title, bool radioMode, bool autoRename,
if (autoRename) if (autoRename)
SetLabelFromMarked(true); SetLabelFromMarked(true);
} }
//------------------------------------------------------------------------------
BPopUpMenu::BPopUpMenu(BMessage *archive) BPopUpMenu::BPopUpMenu(BMessage *archive)
: BMenu(archive), : BMenu(archive),
fUseWhere(false), fUseWhere(false),
@@ -62,7 +51,8 @@ BPopUpMenu::BPopUpMenu(BMessage *archive)
fTrackThread(-1) fTrackThread(-1)
{ {
} }
//------------------------------------------------------------------------------
BPopUpMenu::~BPopUpMenu() BPopUpMenu::~BPopUpMenu()
{ {
/*if (fTrackThread != 0) /*if (fTrackThread != 0)
@@ -70,139 +60,179 @@ BPopUpMenu::~BPopUpMenu()
while (wait_for_thread() == ); while (wait_for_thread() == );
}*/ }*/
} }
//------------------------------------------------------------------------------
status_t BPopUpMenu::Archive(BMessage *data, bool deep) const
status_t
BPopUpMenu::Archive(BMessage *data, bool deep) const
{ {
return BMenu::Archive(data, deep); return BMenu::Archive(data, deep);
} }
//------------------------------------------------------------------------------
BArchivable *BPopUpMenu::Instantiate(BMessage *data)
BArchivable *
BPopUpMenu::Instantiate(BMessage *data)
{ {
if (validate_instantiation(data, "BPopUpMenu")) if (validate_instantiation(data, "BPopUpMenu"))
return new BPopUpMenu(data); return new BPopUpMenu(data);
else
return NULL; return NULL;
} }
//------------------------------------------------------------------------------
BMenuItem *BPopUpMenu::Go(BPoint where, bool delivers_message, bool open_anyway,
bool async) BMenuItem *
BPopUpMenu::Go(BPoint where, bool delivers_message, bool open_anyway, bool async)
{ {
//return _go(where, delivers_message, open_anyway, NULL, async); //return _go(where, delivers_message, open_anyway, NULL, async);
if (async) if (async) {
{
fWhere = where; fWhere = where;
fUseWhere = true; fUseWhere = true;
Show(); Show();
} }
else
{
}
return NULL; return NULL;
} }
//------------------------------------------------------------------------------
BMenuItem *BPopUpMenu::Go(BPoint where, bool delivers_message, bool open_anyway,
BRect click_to_open, bool async) BMenuItem *
BPopUpMenu::Go(BPoint where, bool deliversMessage, bool openAnyway,
BRect clickToOpen, bool async)
{ {
//return _go(where, delivers_message, open_anyway, click_to_open, async); //return _go(where, deliversMessage, openAnyway, clickToOpen, async);
return NULL; return NULL;
} }
//------------------------------------------------------------------------------
void BPopUpMenu::MessageReceived(BMessage *msg)
void
BPopUpMenu::MessageReceived(BMessage *msg)
{ {
BMenu::MessageReceived(msg); BMenu::MessageReceived(msg);
} }
//------------------------------------------------------------------------------
void BPopUpMenu::MouseDown(BPoint pt)
void
BPopUpMenu::MouseDown(BPoint point)
{ {
BMenu::MouseDown(pt); BMenu::MouseDown(point);
} }
//------------------------------------------------------------------------------
void BPopUpMenu::MouseUp(BPoint pt)
void
BPopUpMenu::MouseUp(BPoint point)
{ {
BMenu::MouseUp(pt); BMenu::MouseUp(point);
} }
//------------------------------------------------------------------------------
void BPopUpMenu::MouseMoved(BPoint pt, uint32 code, const BMessage *msg)
void
BPopUpMenu::MouseMoved(BPoint point, uint32 code, const BMessage *msg)
{ {
BMenu::MouseMoved(pt, code, msg); BMenu::MouseMoved(point, code, msg);
} }
//------------------------------------------------------------------------------
void BPopUpMenu::AttachedToWindow()
void
BPopUpMenu::AttachedToWindow()
{ {
BMenu::AttachedToWindow(); BMenu::AttachedToWindow();
} }
//------------------------------------------------------------------------------
void BPopUpMenu::DetachedFromWindow()
void
BPopUpMenu::DetachedFromWindow()
{ {
BMenu::DetachedFromWindow(); BMenu::DetachedFromWindow();
} }
//------------------------------------------------------------------------------
void BPopUpMenu::FrameMoved(BPoint new_position)
void
BPopUpMenu::FrameMoved(BPoint newPosition)
{ {
BMenu::FrameMoved(new_position); BMenu::FrameMoved(newPosition);
} }
//------------------------------------------------------------------------------
void BPopUpMenu::FrameResized(float new_width, float new_height)
void
BPopUpMenu::FrameResized(float newWidth, float newHeight)
{ {
BMenu::FrameResized(new_width, new_height); BMenu::FrameResized(newWidth, newHeight);
} }
//------------------------------------------------------------------------------
BHandler *BPopUpMenu::ResolveSpecifier(BMessage *msg, int32 index,
BMessage *specifier, int32 form, BHandler *
const char *property) BPopUpMenu::ResolveSpecifier(BMessage *msg, int32 index, BMessage *specifier,
int32 form, const char *property)
{ {
return BMenu::ResolveSpecifier(msg, index, specifier, form, property); return BMenu::ResolveSpecifier(msg, index, specifier, form, property);
} }
//------------------------------------------------------------------------------
status_t BPopUpMenu::GetSupportedSuites(BMessage *data)
status_t
BPopUpMenu::GetSupportedSuites(BMessage *data)
{ {
return BMenu::GetSupportedSuites(data); return BMenu::GetSupportedSuites(data);
} }
//------------------------------------------------------------------------------
status_t BPopUpMenu::Perform(perform_code d, void *arg)
status_t
BPopUpMenu::Perform(perform_code d, void *arg)
{ {
return BMenu::Perform(d, arg); return BMenu::Perform(d, arg);
} }
//------------------------------------------------------------------------------
void BPopUpMenu::ResizeToPreferred()
void
BPopUpMenu::ResizeToPreferred()
{ {
BMenu::ResizeToPreferred(); BMenu::ResizeToPreferred();
} }
//------------------------------------------------------------------------------
void BPopUpMenu::GetPreferredSize(float *width, float *height)
void
BPopUpMenu::GetPreferredSize(float *_width, float *_height)
{ {
BMenu::GetPreferredSize(width, height); BMenu::GetPreferredSize(_width, _height);
} }
//------------------------------------------------------------------------------
void BPopUpMenu::MakeFocus(bool state)
void
BPopUpMenu::MakeFocus(bool state)
{ {
BMenu::MakeFocus(state); BMenu::MakeFocus(state);
} }
//------------------------------------------------------------------------------
void BPopUpMenu::AllAttached()
void
BPopUpMenu::AllAttached()
{ {
BMenu::AllAttached(); BMenu::AllAttached();
} }
//------------------------------------------------------------------------------
void BPopUpMenu::AllDetached()
void
BPopUpMenu::AllDetached()
{ {
BMenu::AllDetached(); BMenu::AllDetached();
} }
//------------------------------------------------------------------------------
void BPopUpMenu::SetAsyncAutoDestruct(bool state)
void
BPopUpMenu::SetAsyncAutoDestruct(bool state)
{ {
fAutoDestruct = state; fAutoDestruct = state;
} }
//------------------------------------------------------------------------------
bool BPopUpMenu::AsyncAutoDestruct() const
bool
BPopUpMenu::AsyncAutoDestruct() const
{ {
return fAutoDestruct; return fAutoDestruct;
} }
//------------------------------------------------------------------------------
BPoint BPopUpMenu::ScreenLocation()
BPoint
BPopUpMenu::ScreenLocation()
{ {
if (fUseWhere) if (fUseWhere)
return fWhere; return fWhere;
@@ -220,31 +250,44 @@ BPoint BPopUpMenu::ScreenLocation()
return point; return point;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// #pragma mark -
// private methods
void BPopUpMenu::_ReservedPopUpMenu1() {} void BPopUpMenu::_ReservedPopUpMenu1() {}
void BPopUpMenu::_ReservedPopUpMenu2() {} void BPopUpMenu::_ReservedPopUpMenu2() {}
void BPopUpMenu::_ReservedPopUpMenu3() {} void BPopUpMenu::_ReservedPopUpMenu3() {}
//------------------------------------------------------------------------------
BPopUpMenu &BPopUpMenu::operator=(const BPopUpMenu &)
BPopUpMenu &
BPopUpMenu::operator=(const BPopUpMenu &)
{ {
return *this; return *this;
} }
//------------------------------------------------------------------------------
BMenuItem *BPopUpMenu::_go(BPoint where, bool autoInvoke,
bool start_opened, BRect *special_rect, BMenuItem *
bool async) BPopUpMenu::_go(BPoint where, bool autoInvoke, bool startOpened,
BRect *_specialRect, bool async)
{ {
return NULL; return NULL;
} }
//------------------------------------------------------------------------------
int32 BPopUpMenu::entry(void *)
int32
BPopUpMenu::entry(void *)
{ {
return -1; return -1;
} }
//------------------------------------------------------------------------------
BMenuItem *BPopUpMenu::start_track(BPoint where, bool autoInvoke,
bool start_opened, BRect *special_rect) BMenuItem *
BPopUpMenu::start_track(BPoint where, bool autoInvoke,
bool startOpened, BRect *_specialRect)
{ {
return NULL; return NULL;
} }
//------------------------------------------------------------------------------