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

FXDragCorner.h

00001 /********************************************************************************
00002 *                                                                               *
00003 *                       D r a g   C o r n e r   W i d g e t                     *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1997,2004 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: FXDragCorner.h,v 1.11 2004/02/08 17:17:33 fox Exp $                       *
00023 ********************************************************************************/
00024 #ifndef FXDRAGCORNER_H
00025 #define FXDRAGCORNER_H
00026 
00027 #ifndef FXWINDOW_H
00028 #include "FXWindow.h"
00029 #endif
00030 
00031 namespace FX {
00032 
00033 
00034 /**
00035 * A drag corner widget may be placed in the bottom right corner
00036 * so as to allow the window to be resized more easily.
00037 */
00038 class FXAPI FXDragCorner : public FXWindow {
00039   FXDECLARE(FXDragCorner)
00040 protected:
00041   FXColor hiliteColor;
00042   FXColor shadowColor;
00043   FXint   oldw;
00044   FXint   oldh;
00045   FXint   xoff;
00046   FXint   yoff;
00047 protected:
00048   FXDragCorner();
00049 private:
00050   FXDragCorner(const FXDragCorner&);
00051   FXDragCorner &operator=(const FXDragCorner&);
00052 public:
00053   long onPaint(FXObject*,FXSelector,void*);
00054   long onLeftBtnPress(FXObject*,FXSelector,void*);
00055   long onLeftBtnRelease(FXObject*,FXSelector,void*);
00056   long onMotion(FXObject*,FXSelector,void*);
00057 public:
00058 
00059   /// Construct a drag corner
00060   FXDragCorner(FXComposite* p);
00061 
00062   /// Get default width
00063   virtual FXint getDefaultWidth();
00064 
00065   /// Get default height
00066   virtual FXint getDefaultHeight();
00067 
00068   /// Change highlight color
00069   void setHiliteColor(FXColor clr);
00070 
00071   /// Return current highlight color
00072   FXColor getHiliteColor() const { return hiliteColor; }
00073 
00074   /// Change shadow color
00075   void setShadowColor(FXColor clr);
00076 
00077   /// Return current shadow color
00078   FXColor getShadowColor() const { return shadowColor; }
00079 
00080   /// Save drag corner to a stream
00081   virtual void save(FXStream& store) const;
00082 
00083   /// Load drag corner from a stream
00084   virtual void load(FXStream& store);
00085   };
00086 
00087 }
00088 
00089 #endif

Copyright © 1997-2004 Jeroen van der Zijp