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
+143 -100
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
// copy of this software and associated documentation files (the "Software"),
@@ -25,28 +25,16 @@
// activate it.
//------------------------------------------------------------------------------
// Standard Includes -----------------------------------------------------------
#include "typeinfo.h"
// System Includes -------------------------------------------------------------
#include "PopUpMenu.h"
#include "MenuItem.h"
// Project Includes ------------------------------------------------------------
// Local Includes --------------------------------------------------------------
// Local Defines ---------------------------------------------------------------
// Globals ---------------------------------------------------------------------
//------------------------------------------------------------------------------
BPopUpMenu::BPopUpMenu(const char *title, bool radioMode, bool autoRename,
menu_layout layout)
: BMenu(title, layout),
fUseWhere(false),
fAutoDestruct(false),
fTrackThread(-1)
menu_layout layout)
: BMenu(title, layout),
fUseWhere(false),
fAutoDestruct(false),
fTrackThread(-1)
{
if (radioMode)
SetRadioMode(true);
@@ -54,15 +42,17 @@ BPopUpMenu::BPopUpMenu(const char *title, bool radioMode, bool autoRename,
if (autoRename)
SetLabelFromMarked(true);
}
//------------------------------------------------------------------------------
BPopUpMenu::BPopUpMenu(BMessage *archive)
: BMenu(archive),
fUseWhere(false),
fAutoDestruct(false),
fTrackThread(-1)
: BMenu(archive),
fUseWhere(false),
fAutoDestruct(false),
fTrackThread(-1)
{
}
//------------------------------------------------------------------------------
BPopUpMenu::~BPopUpMenu()
{
/*if (fTrackThread != 0)
@@ -70,139 +60,179 @@ BPopUpMenu::~BPopUpMenu()
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);
}
//------------------------------------------------------------------------------
BArchivable *BPopUpMenu::Instantiate(BMessage *data)
BArchivable *
BPopUpMenu::Instantiate(BMessage *data)
{
if (validate_instantiation(data, "BPopUpMenu"))
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);
if (async)
{
if (async) {
fWhere = where;
fUseWhere = true;
Show();
}
else
{
}
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;
}
//------------------------------------------------------------------------------
void BPopUpMenu::MessageReceived(BMessage *msg)
void
BPopUpMenu::MessageReceived(BMessage *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();
}
//------------------------------------------------------------------------------
void BPopUpMenu::DetachedFromWindow()
void
BPopUpMenu::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,
const char *property)
BHandler *
BPopUpMenu::ResolveSpecifier(BMessage *msg, int32 index, BMessage *specifier,
int32 form, const char *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);
}
//------------------------------------------------------------------------------
status_t BPopUpMenu::Perform(perform_code d, void *arg)
status_t
BPopUpMenu::Perform(perform_code d, void *arg)
{
return BMenu::Perform(d, arg);
}
//------------------------------------------------------------------------------
void BPopUpMenu::ResizeToPreferred()
void
BPopUpMenu::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);
}
//------------------------------------------------------------------------------
void BPopUpMenu::AllAttached()
void
BPopUpMenu::AllAttached()
{
BMenu::AllAttached();
}
//------------------------------------------------------------------------------
void BPopUpMenu::AllDetached()
void
BPopUpMenu::AllDetached()
{
BMenu::AllDetached();
}
//------------------------------------------------------------------------------
void BPopUpMenu::SetAsyncAutoDestruct(bool state)
void
BPopUpMenu::SetAsyncAutoDestruct(bool state)
{
fAutoDestruct = state;
}
//------------------------------------------------------------------------------
bool BPopUpMenu::AsyncAutoDestruct() const
bool
BPopUpMenu::AsyncAutoDestruct() const
{
return fAutoDestruct;
}
//------------------------------------------------------------------------------
BPoint BPopUpMenu::ScreenLocation()
BPoint
BPopUpMenu::ScreenLocation()
{
if (fUseWhere)
return fWhere;
@@ -220,31 +250,44 @@ BPoint BPopUpMenu::ScreenLocation()
return point;
}
//------------------------------------------------------------------------------
// #pragma mark -
// private methods
void BPopUpMenu::_ReservedPopUpMenu1() {}
void BPopUpMenu::_ReservedPopUpMenu2() {}
void BPopUpMenu::_ReservedPopUpMenu3() {}
//------------------------------------------------------------------------------
BPopUpMenu &BPopUpMenu::operator=(const BPopUpMenu &)
BPopUpMenu &
BPopUpMenu::operator=(const BPopUpMenu &)
{
return *this;
}
//------------------------------------------------------------------------------
BMenuItem *BPopUpMenu::_go(BPoint where, bool autoInvoke,
bool start_opened, BRect *special_rect,
bool async)
BMenuItem *
BPopUpMenu::_go(BPoint where, bool autoInvoke, bool startOpened,
BRect *_specialRect, bool async)
{
return NULL;
}
//------------------------------------------------------------------------------
int32 BPopUpMenu::entry(void *)
int32
BPopUpMenu::entry(void *)
{
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;
}
//------------------------------------------------------------------------------