Small style changes
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10537 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -25,7 +25,6 @@
|
|||||||
// Description: BPopUpMenu represents a menu that pops up when you
|
// Description: BPopUpMenu represents a menu that pops up when you
|
||||||
// activate it.
|
// activate it.
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Looper.h>
|
#include <Looper.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
@@ -43,9 +42,9 @@ struct popup_menu_data
|
|||||||
BRect rect;
|
BRect rect;
|
||||||
|
|
||||||
bool async;
|
bool async;
|
||||||
bool auto_invoke;
|
bool autoInvoke;
|
||||||
bool start_opened;
|
bool startOpened;
|
||||||
bool use_rect;
|
bool useRect;
|
||||||
|
|
||||||
sem_id lock;
|
sem_id lock;
|
||||||
};
|
};
|
||||||
@@ -252,7 +251,7 @@ BPopUpMenu::ScreenLocation()
|
|||||||
{
|
{
|
||||||
if (fUseWhere)
|
if (fUseWhere)
|
||||||
return fWhere;
|
return fWhere;
|
||||||
|
|
||||||
BMenuItem *item = Superitem();
|
BMenuItem *item = Superitem();
|
||||||
BMenu *menu = Supermenu();
|
BMenu *menu = Supermenu();
|
||||||
BMenuItem *selectedItem = FindItem(item->Label());
|
BMenuItem *selectedItem = FindItem(item->Label());
|
||||||
@@ -295,6 +294,9 @@ BPopUpMenu::_go(BPoint where, bool autoInvoke, bool startOpened,
|
|||||||
BLooper *looper = BLooper::LooperForThread(find_thread(NULL));
|
BLooper *looper = BLooper::LooperForThread(find_thread(NULL));
|
||||||
BWindow *window = dynamic_cast<BWindow *>(looper);
|
BWindow *window = dynamic_cast<BWindow *>(looper);
|
||||||
|
|
||||||
|
if (window == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
popup_menu_data *data = new popup_menu_data;
|
popup_menu_data *data = new popup_menu_data;
|
||||||
sem_id sem = create_sem(0, "window close lock");
|
sem_id sem = create_sem(0, "window close lock");
|
||||||
|
|
||||||
@@ -306,13 +308,13 @@ BPopUpMenu::_go(BPoint where, bool autoInvoke, bool startOpened,
|
|||||||
}
|
}
|
||||||
|
|
||||||
data->object = this;
|
data->object = this;
|
||||||
data->auto_invoke = autoInvoke;
|
data->autoInvoke = autoInvoke;
|
||||||
data->use_rect = _specialRect != NULL;
|
data->useRect = _specialRect != NULL;
|
||||||
if (_specialRect != NULL)
|
if (_specialRect != NULL)
|
||||||
data->rect = *_specialRect;
|
data->rect = *_specialRect;
|
||||||
data->async = async;
|
data->async = async;
|
||||||
data->where = where;
|
data->where = where;
|
||||||
data->start_opened = startOpened;
|
data->startOpened = startOpened;
|
||||||
data->window = NULL;
|
data->window = NULL;
|
||||||
data->selected = selected;
|
data->selected = selected;
|
||||||
data->lock = sem;
|
data->lock = sem;
|
||||||
@@ -363,14 +365,14 @@ BPopUpMenu::entry(void *arg)
|
|||||||
|
|
||||||
BPoint where = data->where;
|
BPoint where = data->where;
|
||||||
BRect *rect = NULL;
|
BRect *rect = NULL;
|
||||||
bool auto_invoke = data->auto_invoke;
|
bool autoInvoke = data->autoInvoke;
|
||||||
bool start_opened = data->start_opened;
|
bool startOpened = data->startOpened;
|
||||||
|
|
||||||
if (data->use_rect)
|
if (data->useRect)
|
||||||
rect = &data->rect;
|
rect = &data->rect;
|
||||||
|
|
||||||
BMenuItem *selected = menu->start_track(where, auto_invoke,
|
BMenuItem *selected = menu->start_track(where, autoInvoke,
|
||||||
start_opened, rect);
|
startOpened, rect);
|
||||||
|
|
||||||
// Put the selected item in the shared struct.
|
// Put the selected item in the shared struct.
|
||||||
data->selected = selected;
|
data->selected = selected;
|
||||||
|
|||||||
Reference in New Issue
Block a user