Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXTabBook.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                         T a b   B o o k   W i d g e t                         *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1997,2006 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (at your option) any later version.            *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: FXTabBook.h,v 1.10 2006/01/22 17:58:10 fox Exp $                          *
00023 ********************************************************************************/
00024 #ifndef FXTABBOOK_H
00025 #define FXTABBOOK_H
00026 
00027 #ifndef FXTABBAR_H
00028 #include "FXTabBar.h"
00029 #endif
00030 
00031 namespace FX {
00032 
00033 
00034 /**
00035 * The tab book layout manager arranges pairs of children;
00036 * the even numbered children (0,2,4,...) are usually tab items,
00037 * and are placed on the top.  The odd numbered children are
00038 * usually layout managers, and are placed below; all the odd
00039 * numbered children are placed on top of each other, similar
00040 * to the switcher widget.  When the user presses one of the
00041 * tab items, the tab item is raised above the neighboring tabs,
00042 * and the corresponding panel is raised to the top.
00043 * Thus, a tab book can be used to present many GUI controls
00044 * in a small space by placing several panels on top of each
00045 * other and using tab items to select the desired panel.
00046 * When one of the tab items is pressed, the tab book's setCurrent()
00047 * is called with notify=TRUE.  Thus causes the tab book to send a
00048 * SEL_COMMAND message to its target.
00049 */
00050 class FXAPI FXTabBook : public FXTabBar {
00051   FXDECLARE(FXTabBook)
00052 protected:
00053   FXTabBook(){}
00054 private:
00055   FXTabBook(const FXTabBook&);
00056   FXTabBook& operator=(const FXTabBook&);
00057 public:
00058   long onPaint(FXObject*,FXSelector,void*);
00059   long onFocusNext(FXObject*,FXSelector,void*);
00060   long onFocusPrev(FXObject*,FXSelector,void*);
00061   long onFocusUp(FXObject*,FXSelector,void*);
00062   long onFocusDown(FXObject*,FXSelector,void*);
00063   long onFocusLeft(FXObject*,FXSelector,void*);
00064   long onFocusRight(FXObject*,FXSelector,void*);
00065   long onCmdOpenItem(FXObject*,FXSelector,void*);
00066 public:
00067 
00068   /// Construct tab book
00069   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);
00070 
00071   /// Perform layout
00072   virtual void layout();
00073 
00074   /// Return default width
00075   virtual FXint getDefaultWidth();
00076 
00077   /// Return default height
00078   virtual FXint getDefaultHeight();
00079   };
00080 
00081 }
00082 
00083 #endif

Copyright © 1997-2005 Jeroen van der Zijp