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

FXImageFrame.h

00001 /******************************************************************************** 00002 * * 00003 * I m a g e F r a m e W i d g e t * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 2001,2005 by H. J. Daniel III. 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: FXImageFrame.h,v 1.7 2005/01/16 16:06:06 fox Exp $ * 00023 ********************************************************************************/ 00024 #ifndef FXIMAGEFRAME_H 00025 #define FXIMAGEFRAME_H 00026 00027 #ifndef FXFRAME_H 00028 #include "FXFrame.h" 00029 #endif 00030 00031 namespace FX { 00032 00033 00034 /** 00035 * The image frame is a simple frame widget displaying 00036 * an image; the image is not owned by the image frame so 00037 * it must be explicitly deleted elsewhere. 00038 */ 00039 class FXAPI FXImageFrame : public FXFrame { 00040 FXDECLARE(FXImageFrame) 00041 protected: 00042 FXImage* image; // The image being displayed 00043 protected: 00044 FXImageFrame(); 00045 private: 00046 FXImageFrame(const FXImageFrame&); 00047 FXImageFrame &operator=(const FXImageFrame&); 00048 public: 00049 long onPaint(FXObject*,FXSelector,void* ptr); 00050 public: 00051 00052 /// Construct image frame and pass it an image 00053 FXImageFrame(FXComposite* p,FXImage *img,FXuint opts=FRAME_SUNKEN|FRAME_THICK,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=0,FXint pr=0,FXint pt=0,FXint pb=0); 00054 00055 /// Create window 00056 virtual void create(); 00057 00058 /// Get default width 00059 virtual FXint getDefaultWidth(); 00060 00061 /// Get default height 00062 virtual FXint getDefaultHeight(); 00063 00064 /// Change the image being displayed 00065 void setImage(FXImage* img); 00066 00067 /// Return the current image 00068 FXImage* getImage() const { return image; } 00069 00070 /// Set the current justification mode. 00071 void setJustify(FXuint mode); 00072 00073 /// Get the current justification mode. 00074 FXuint getJustify() const; 00075 00076 /// Save to stream 00077 virtual void save(FXStream& store) const; 00078 00079 /// Load from stream 00080 virtual void load(FXStream& store); 00081 00082 /// Destroy the widget, but do not destroy the image 00083 virtual ~FXImageFrame(); 00084 }; 00085 00086 } 00087 00088 00089 #endif

Copyright © 1997-2005 Jeroen van der Zijp