bool TBarMenuBar::AddTeamMenu() { if (CountItems() > 1) return false; BRect frame(Frame()); delete fAppListMenuItem; fAppListMenuItem = new TBarMenuTitle(0.0f, 0.0f, AppResSet()->FindBitmap(B_MESSAGE_TYPE, R_TeamIcon), new TTeamMenu()); bool added = AddItem(fAppListMenuItem); if (added) SmartResize(frame.Width() - 1.0f, frame.Height()); else SmartResize(frame.Width(), frame.Height()); return added; }
void TBarMenuBar::AddTeamMenu() { if (CountItems() > 1) return; BRect frame(Frame()); delete fAppListMenuItem; fAppListMenuItem = new TBarMenuTitle(0.0f, 0.0f, AppResSet()->FindBitmap(B_MESSAGE_TYPE, R_TeamIcon), new TTeamMenu()); AddItem(fAppListMenuItem); SmartResize(frame.Width() - 1.0f, frame.Height()); }
void TBarMenuBar::RemoveTeamMenu() { if (CountItems() < 2) return; if (fAppListMenuItem) { RemoveItem((BMenuItem*)fAppListMenuItem); delete fAppListMenuItem; fAppListMenuItem = NULL; } BRect frame = Frame(); SmartResize(frame.Width(), frame.Height()); }
bool TBarMenuBar::RemoveSeperatorItem() { if (CountItems() < 2) return false; bool removed = false; if (fSeparatorItem != NULL && RemoveItem(fSeparatorItem)) { delete fSeparatorItem; fSeparatorItem = NULL; SmartResize(-1, -1); removed = true; } return removed; }
bool TBarMenuBar::RemoveTeamMenu() { if (CountItems() < 2) return false; bool removed = false; if (fAppListMenuItem != NULL && RemoveItem(fAppListMenuItem)) { delete fAppListMenuItem; fAppListMenuItem = NULL; SmartResize(-1, -1); removed = true; } return removed; }