1 /* 2 * Copyright 2007, Haiku. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stefano Ceccherini (burton666@libero.it) 7 */ 8 #ifndef __SMARTTABVIEW_H 9 #define __SMARTTABVIEW_H 10 11 #include <TabView.h> 12 13 class BPopUpMenu; 14 class SmartTabView : public BTabView { 15 public: 16 SmartTabView(BRect frame, const char *name, 17 button_width width = B_WIDTH_AS_USUAL, 18 uint32 resizingMode = B_FOLLOW_ALL, 19 uint32 flags = B_FULL_UPDATE_ON_RESIZE | 20 B_WILL_DRAW | B_NAVIGABLE_JUMP | 21 B_FRAME_EVENTS | B_NAVIGABLE); 22 virtual ~SmartTabView(); 23 24 virtual void MouseDown(BPoint where); 25 26 virtual void AttachedToWindow(); 27 virtual void AllAttached(); 28 29 virtual void MessageReceived(BMessage *message); 30 31 virtual void Select(int32 tab); 32 33 void RemoveAndDeleteTab(int32 index); 34 35 virtual void AddTab(BView *target, BTab *tab = NULL); 36 virtual BTab* RemoveTab(int32 index); 37 38 virtual BRect DrawTabs(); 39 40 private: 41 int32 _ClickedTabIndex(const BPoint &point); 42 }; 43 44 #endif // __SMARTTABVIEW_H 45 46