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,2009 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (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                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 *********************************************************************************
00021 * $Id: FXTabBook.h,v 1.15 2009/01/06 13:07:28 fox Exp $                         *
00022 ********************************************************************************/
00023 #ifndef FXTABBOOK_H
00024 #define FXTABBOOK_H
00025 
00026 #ifndef FXTABBAR_H
00027 #include "FXTabBar.h"
00028 #endif
00029 
00030 namespace FX {
00031 
00032 
00033 /**
00034 * The tab book layout manager arranges pairs of children;
00035 * the even numbered children (0,2,4,...) are usually tab items,
00036 * and are placed on the top.  The odd numbered children are
00037 * usually layout managers, and are placed below; all the odd
00038 * numbered children are placed on top of each other, similar
00039 * to the switcher widget.  When the user presses one of the
00040 * tab items, the tab item is raised above the neighboring tabs,
00041 * and the corresponding panel is raised to the top.
00042 * Thus, a tab book can be used to present many GUI controls
00043 * in a small space by placing several panels on top of each
00044 * other and using tab items to select the desired panel.
00045 * When one of the tab items is pressed, the tab book's setCurrent()
00046 * is called with notify=true.  Thus causes the tab book to send a
00047 * SEL_COMMAND message to its target.
00048 */
00049 class FXAPI FXTabBook : public FXTabBar {
00050   FXDECLARE(FXTabBook)
00051 protected:
00052   FXTabBook(){}
00053 private:
00054   FXTabBook(const FXTabBook&);
00055   FXTabBook& operator=(const FXTabBook&);
00056 public:
00057   long onPaint(FXObject*,FXSelector,void*);
00058   long onFocusNext(FXObject*,FXSelector,void*);
00059   long onFocusPrev(FXObject*,FXSelector,void*);
00060   long onFocusUp(FXObject*,FXSelector,void*);
00061   long onFocusDown(FXObject*,FXSelector,void*);
00062   long onFocusLeft(FXObject*,FXSelector,void*);
00063   long onFocusRight(FXObject*,FXSelector,void*);
00064   long onCmdOpenItem(FXObject*,FXSelector,void*);
00065 public:
00066 
00067   /// Construct tab book
00068   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);
00069 
00070   /// Perform layout
00071   virtual void layout();
00072 
00073   /// Return default width
00074   virtual FXint getDefaultWidth();
00075 
00076   /// Return default height
00077   virtual FXint getDefaultHeight();
00078   };
00079 
00080 }
00081 
00082 #endif

Copyright © 1997-2009 Jeroen van der Zijp