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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXToolBarShell.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                    T o o l   B a r   S h e l l   W i d g e t                  *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2000,2012 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 #ifndef FXTOOLBARSHELL_H
00022 #define FXTOOLBARSHELL_H
00023 
00024 #ifndef FXTOPWINDOW_H
00025 #include "FXTopWindow.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00044 class FXAPI FXToolBarShell : public FXTopWindow {
00045   FXDECLARE(FXToolBarShell)
00046 protected:
00047   FXColor   baseColor;          // Base color
00048   FXColor   hiliteColor;        // Highlight color
00049   FXColor   shadowColor;        // Shadow color
00050   FXColor   borderColor;        // Border color
00051   FXint     border;             // Border width
00052   FXint     gripx;              // Grip offset x
00053   FXint     gripy;              // Grip offset y
00054   FXint     xopp;               // Opposite x
00055   FXint     yopp;               // Opposite y
00056   FXuchar   mode;               // Dragging mode
00057 protected:
00058   static const FXDefaultCursor cursorType[16];
00059 private:
00060   FXToolBarShell(const FXToolBarShell&);
00061   FXToolBarShell &operator=(const FXToolBarShell&);
00062 protected:
00063   FXToolBarShell();
00064   FXuchar where(FXint x,FXint y) const;
00065   void drawBorderRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00066   void drawRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00067   void drawSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00068   void drawRidgeRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00069   void drawGrooveRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00070   void drawDoubleRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00071   void drawDoubleSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00072   void drawFrame(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
00073 protected:
00074   enum {
00075     DRAG_NONE        = 0,
00076     DRAG_TOP         = 1,
00077     DRAG_BOTTOM      = 2,
00078     DRAG_LEFT        = 4,
00079     DRAG_RIGHT       = 8,
00080     DRAG_TOPLEFT     = (DRAG_TOP|DRAG_LEFT),
00081     DRAG_TOPRIGHT    = (DRAG_TOP|DRAG_RIGHT),
00082     DRAG_BOTTOMLEFT  = (DRAG_BOTTOM|DRAG_LEFT),
00083     DRAG_BOTTOMRIGHT = (DRAG_BOTTOM|DRAG_RIGHT),
00084     DRAG_WHOLE       = (DRAG_TOP|DRAG_BOTTOM|DRAG_LEFT|DRAG_RIGHT)
00085     };
00086 public:
00087   long onPaint(FXObject*,FXSelector,void*);
00088   long onEnter(FXObject*,FXSelector,void*);
00089   long onLeave(FXObject*,FXSelector,void*);
00090   long onMotion(FXObject*,FXSelector,void*);
00091   long onLeftBtnPress(FXObject*,FXSelector,void*);
00092   long onLeftBtnRelease(FXObject*,FXSelector,void*);
00093   long onLayout(FXObject*,FXSelector,void*);
00094 public:
00095 
00097   FXToolBarShell(FXWindow* owner,FXuint opts=FRAME_RAISED|FRAME_THICK,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint hs=4,FXint vs=4);
00098 
00100   virtual void create();
00101 
00103   virtual void layout();
00104 
00106   virtual FXint getDefaultWidth();
00107 
00109   virtual FXint getDefaultHeight();
00110 
00112   void setFrameStyle(FXuint style);
00113 
00115   FXuint getFrameStyle() const;
00116 
00118   FXint getBorderWidth() const { return border; }
00119 
00121   void setHiliteColor(FXColor clr);
00122 
00124   FXColor getHiliteColor() const { return hiliteColor; }
00125 
00127   void setShadowColor(FXColor clr);
00128 
00130   FXColor getShadowColor() const { return shadowColor; }
00131 
00133   void setBorderColor(FXColor clr);
00134 
00136   FXColor getBorderColor() const { return borderColor; }
00137 
00139   void setBaseColor(FXColor clr);
00140 
00142   FXColor getBaseColor() const { return baseColor; }
00143 
00145   virtual void save(FXStream& store) const;
00146 
00148   virtual void load(FXStream& store);
00149   };
00150 
00151 }
00152 
00153 #endif

Copyright © 1997-2011 Jeroen van der Zijp