1 /******************************************************************************** 2 * * 3 * T a b B o o k W i d g e t * 4 * * 5 ********************************************************************************* 6 * Copyright (C) 1997,2005 by Jeroen van der Zijp. All Rights Reserved. * 7 ********************************************************************************* 8 * This library is free software; you can redistribute it and/or * 9 * modify it under the terms of the GNU Lesser General Public * 10 * License as published by the Free Software Foundation; either * 11 * version 2.1 of the License, or (at your option) any later version. * 12 * * 13 * This library is distributed in the hope that it will be useful, * 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 16 * Lesser General Public License for more details. * 17 * * 18 * You should have received a copy of the GNU Lesser General Public * 19 * License along with this library; if not, write to the Free Software * 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * 21 ********************************************************************************* 22 * $Id: FXTabBook.h,v 1.8 2005/01/16 16:06:06 fox Exp $ * 23 ********************************************************************************/ 24 #ifndef FXTABBOOK_H 25 #define FXTABBOOK_H 26 27 #ifndef FXTABBAR_H 28 #include "FXTabBar.h" 29 #endif 30 31 namespace FX { 32 33 34 /** 35 * The tab book layout manager arranges pairs of children; 36 * the even numbered children (0,2,4,...) are usually tab items, 37 * and are placed on the top. The odd numbered children are 38 * usually layout managers, and are placed below; all the odd 39 * numbered children are placed on top of each other, similar 40 * to the switcher widget. When the user presses one of the 41 * tab items, the tab item is raised above the neighboring tabs, 42 * and the corresponding panel is raised to the top. 43 * Thus, a tab book can be used to present many GUI controls 44 * in a small space by placing several panels on top of each 45 * other and using tab items to select the desired panel. 46 */ 47 class FXAPI FXTabBook : public FXTabBar { FXDECLARE(FXTabBook)48 FXDECLARE(FXTabBook) 49 protected: 50 FXTabBook(){} 51 private: 52 FXTabBook(const FXTabBook&); 53 FXTabBook& operator=(const FXTabBook&); 54 public: 55 long onPaint(FXObject*,FXSelector,void*); 56 long onFocusNext(FXObject*,FXSelector,void*); 57 long onFocusPrev(FXObject*,FXSelector,void*); 58 long onFocusUp(FXObject*,FXSelector,void*); 59 long onFocusDown(FXObject*,FXSelector,void*); 60 long onFocusLeft(FXObject*,FXSelector,void*); 61 long onFocusRight(FXObject*,FXSelector,void*); 62 long onCmdOpenItem(FXObject*,FXSelector,void*); 63 public: 64 65 /// Construct tab book 66 FXTabBook(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=TABBOOK_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_SPACING,FXint pr=DEFAULT_SPACING,FXint pt=DEFAULT_SPACING,FXint pb=DEFAULT_SPACING); 67 68 /// Perform layout 69 virtual void layout(); 70 71 /// Return default width 72 virtual FXint getDefaultWidth(); 73 74 /// Return default height 75 virtual FXint getDefaultHeight(); 76 }; 77 78 } 79 80 #endif 81