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

FXDragCorner.h

Go to the documentation of this file.
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,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: FXDragCorner.h,v 1.21 2009/01/06 13:07:23 fox Exp $                      *
00022 ********************************************************************************/
00023 #ifndef FXDRAGCORNER_H
00024 #define FXDRAGCORNER_H
00025 
00026 #ifndef FXWINDOW_H
00027 #include "FXWindow.h"
00028 #endif
00029 
00030 namespace FX {
00031 
00032 
00033 /**
00034 * A drag corner widget may be placed in the bottom right corner
00035 * so as to allow the window to be resized more easily.
00036 */
00037 class FXAPI FXDragCorner : public FXWindow {
00038   FXDECLARE(FXDragCorner)
00039 protected:
00040   FXColor hiliteColor;
00041   FXColor shadowColor;
00042   FXint   oldw;
00043   FXint   oldh;
00044   FXint   xoff;
00045   FXint   yoff;
00046   FXbool  ewmh;
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   /// Create all of the server-side resources for this window
00069   virtual void create();
00070 
00071   /// Change highlight color
00072   void setHiliteColor(FXColor clr);
00073 
00074   /// Return current highlight color
00075   FXColor getHiliteColor() const { return hiliteColor; }
00076 
00077   /// Change shadow color
00078   void setShadowColor(FXColor clr);
00079 
00080   /// Return current shadow color
00081   FXColor getShadowColor() const { return shadowColor; }
00082 
00083   /// Save drag corner to a stream
00084   virtual void save(FXStream& store) const;
00085 
00086   /// Load drag corner from a stream
00087   virtual void load(FXStream& store);
00088   };
00089 
00090 }
00091 
00092 #endif

Copyright © 1997-2009 Jeroen van der Zijp