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 void SetInsets(float left, float top, float right, float bottom); 25 26 virtual void MouseDown(BPoint where); 27 28 virtual void AttachedToWindow(); 29 virtual void AllAttached(); 30 31 virtual void MessageReceived(BMessage *message); 32 33 virtual void Select(int32 tab); 34 35 virtual void RemoveAndDeleteTab(int32 index); 36 37 virtual void AddTab(BView *target, BTab *tab = NULL); 38 virtual BTab* RemoveTab(int32 index); 39 40 virtual BRect DrawTabs(); 41 42 private: 43 int32 _ClickedTabIndex(const BPoint &point); 44 45 private: 46 BRect fInsets; 47 }; 48 49 #endif // __SMARTTABVIEW_H 50 51