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

FXTabItem.h

00001 /********************************************************************************
00002 *                                                                               *
00003 *                           T a b   I t e m    W i d g e t                      *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1997,2002 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: FXTabItem.h,v 1.3 2002/01/18 22:42:55 jeroen Exp $                       *
00023 ********************************************************************************/
00024 #ifndef FXTABITEM_H
00025 #define FXTABITEM_H
00026 
00027 #ifndef FXLABEL_H
00028 #include "FXLabel.h"
00029 #endif
00030 
00031 
00032 
00033 // Tab Item orientations which affect border
00034 enum {
00035   TAB_TOP          = 0,           // Top side tabs
00036   TAB_LEFT         = 0x00800000,  // Left side tabs
00037   TAB_RIGHT        = 0x01000000,  // Right side tabs
00038   TAB_BOTTOM       = 0x01800000,  // Bottom side tabs
00039   TAB_TOP_NORMAL   = JUSTIFY_NORMAL|ICON_BEFORE_TEXT|TAB_TOP|FRAME_RAISED|FRAME_THICK,
00040   TAB_BOTTOM_NORMAL= JUSTIFY_NORMAL|ICON_BEFORE_TEXT|TAB_BOTTOM|FRAME_RAISED|FRAME_THICK,
00041   TAB_LEFT_NORMAL  = JUSTIFY_LEFT|JUSTIFY_CENTER_Y|ICON_BEFORE_TEXT|TAB_LEFT|FRAME_RAISED|FRAME_THICK,
00042   TAB_RIGHT_NORMAL = JUSTIFY_LEFT|JUSTIFY_CENTER_Y|ICON_BEFORE_TEXT|TAB_RIGHT|FRAME_RAISED|FRAME_THICK
00043   };
00044 
00045 
00046 class FXTabBar;
00047 
00048 
00049 /**
00050 * A tab item is placed in a tab bar or tab book.
00051 * When selected, the tab item sends a message to its
00052 * parent, and causes itself to become the active tab,
00053 * and raised slightly above the other tabs.
00054 * In the tab book, activating a tab item also causes
00055 * the corresponding panel to be raised to the top.
00056 */
00057 class FXAPI FXTabItem : public FXLabel {
00058   FXDECLARE(FXTabItem)
00059 protected:
00060   FXTabItem(){}
00061 private:
00062   FXTabItem(const FXTabItem&);
00063   FXTabItem& operator=(const FXTabItem&);
00064 public:
00065   long onPaint(FXObject*,FXSelector,void*);
00066   long onFocusIn(FXObject*,FXSelector,void*);
00067   long onFocusOut(FXObject*,FXSelector,void*);
00068   long onUngrabbed(FXObject*,FXSelector,void*);
00069   long onLeftBtnPress(FXObject*,FXSelector,void*);
00070   long onLeftBtnRelease(FXObject*,FXSelector,void*);
00071   long onKeyPress(FXObject*,FXSelector,void*);
00072   long onKeyRelease(FXObject*,FXSelector,void*);
00073   long onHotKeyPress(FXObject*,FXSelector,void*);
00074   long onHotKeyRelease(FXObject*,FXSelector,void*);
00075 public:
00076 
00077   /// Construct a tab item
00078   FXTabItem(FXTabBar* p,const FXString& text,FXIcon* ic=0,FXuint opts=TAB_TOP_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
00079 
00080   /// Returns true because a tab item can receive focus
00081   virtual FXbool canFocus() const;
00082 
00083   /// Return current tab item orientation
00084   FXuint getTabOrientation() const;
00085 
00086   /// Change tab item orientation
00087   void setTabOrientation(FXuint style);
00088   };
00089 
00090 #endif