![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
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,2009 by H. J. Daniel III. 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: FXImageFrame.h,v 1.12 2009/01/06 13:07:25 fox Exp $ * 00022 ********************************************************************************/ 00023 #ifndef FXIMAGEFRAME_H 00024 #define FXIMAGEFRAME_H 00025 00026 #ifndef FXFRAME_H 00027 #include "FXFrame.h" 00028 #endif 00029 00030 namespace FX { 00031 00032 00033 /** 00034 * The image frame is a simple frame widget displaying 00035 * an image; the image is not owned by the image frame so 00036 * it must be explicitly deleted elsewhere. 00037 */ 00038 class FXAPI FXImageFrame : public FXFrame { 00039 FXDECLARE(FXImageFrame) 00040 protected: 00041 FXImage* image; // The image being displayed 00042 protected: 00043 FXImageFrame(); 00044 private: 00045 FXImageFrame(const FXImageFrame&); 00046 FXImageFrame &operator=(const FXImageFrame&); 00047 public: 00048 long onPaint(FXObject*,FXSelector,void* ptr); 00049 public: 00050 00051 /// Construct image frame and pass it an image 00052 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); 00053 00054 /// Create window 00055 virtual void create(); 00056 00057 /// Get default width 00058 virtual FXint getDefaultWidth(); 00059 00060 /// Get default height 00061 virtual FXint getDefaultHeight(); 00062 00063 /// Change the image being displayed 00064 void setImage(FXImage* img); 00065 00066 /// Return the current image 00067 FXImage* getImage() const { return image; } 00068 00069 /// Set the current justification mode. 00070 void setJustify(FXuint mode); 00071 00072 /// Get the current justification mode. 00073 FXuint getJustify() const; 00074 00075 /// Save to stream 00076 virtual void save(FXStream& store) const; 00077 00078 /// Load from stream 00079 virtual void load(FXStream& store); 00080 00081 /// Destroy the widget, but do not destroy the image 00082 virtual ~FXImageFrame(); 00083 }; 00084 00085 } 00086 00087 00088 #endif
![]() |