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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXImageView.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                       I m a g e   V i e w   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 FXIMAGEVIEW_H
00022 #define FXIMAGEVIEW_H
00023 
00024 #ifndef FXSCROLLAREA_H
00025 #include "FXScrollArea.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00031 class FXImage;
00032 
00033 
00035 enum {
00036   IMAGEVIEW_NORMAL    = 0,              
00037   IMAGEVIEW_CENTER_X  = 0,              
00038   IMAGEVIEW_LEFT      = 0x00100000,     
00039   IMAGEVIEW_RIGHT     = 0x00200000,     
00040   IMAGEVIEW_CENTER_Y  = 0,              
00041   IMAGEVIEW_TOP       = 0x00400000,     
00042   IMAGEVIEW_BOTTOM    = 0x00800000      
00043   };
00044 
00045 
00049 class FXAPI FXImageView : public FXScrollArea {
00050   FXDECLARE(FXImageView)
00051 protected:
00052   FXImage *image;         // Image to view
00053   FXint    grabx;         // Grab point x
00054   FXint    graby;         // Grab point y
00055 protected:
00056   FXImageView();
00057 private:
00058   FXImageView(const FXImageView&);
00059   FXImageView &operator=(const FXImageView&);
00060 public:
00061   long onPaint(FXObject*,FXSelector,void*);
00062   long onMotion(FXObject*,FXSelector,void*);
00063   long onRightBtnPress(FXObject*,FXSelector,void*);
00064   long onRightBtnRelease(FXObject*,FXSelector,void*);
00065 public:
00066   enum {
00067     ID_XYZ=FXScrollArea::ID_LAST,
00068     ID_LAST
00069     };
00070 public:
00071 
00073   FXImageView(FXComposite* p,FXImage* img=NULL,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00074 
00076   virtual void create();
00077 
00079   virtual void detach();
00080 
00082   virtual void layout();
00083 
00085   virtual FXbool canFocus() const;
00086 
00088   virtual FXint getContentWidth();
00089 
00091   virtual FXint getContentHeight();
00092 
00094   void setImage(FXImage* img);
00095 
00097   FXImage* getImage() const { return image; }
00098 
00100   void setAlignment(FXuint mode);
00101 
00103   FXuint getAlignment() const;
00104 
00106   virtual void save(FXStream& store) const;
00107 
00109   virtual void load(FXStream& store);
00110 
00112   virtual ~FXImageView();
00113   };
00114 
00115 }
00116 
00117 #endif

Copyright © 1997-2011 Jeroen van der Zijp