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

FXBitmapFrame.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                       B i t m a p   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: FXBitmapFrame.h,v 1.10 2009/01/06 13:07:22 fox Exp $                      *
00022 ********************************************************************************/
00023 #ifndef FXBITMAPFRAME_H
00024 #define FXBITMAPFRAME_H
00025 
00026 #ifndef FXFRAME_H
00027 #include "FXFrame.h"
00028 #endif
00029 
00030 namespace FX {
00031 
00032 
00033 /**
00034 * The bitmap frame is a simple frame widget displaying an monochrome bitmap
00035 * image; the bitmap is not owned by the bitmap frame so it must be explicitly
00036 * deleted elsewhere.
00037 */
00038 class FXAPI FXBitmapFrame : public FXFrame {
00039   FXDECLARE(FXBitmapFrame)
00040 protected:
00041   FXBitmap *bitmap;     // The bitmap being displayed
00042   FXColor   onColor;    // Color for on pixels
00043   FXColor   offColor;   // Color for off pixels
00044 protected:
00045   FXBitmapFrame();
00046 private:
00047   FXBitmapFrame(const FXBitmapFrame&);
00048   FXBitmapFrame &operator=(const FXBitmapFrame&);
00049 public:
00050   long onPaint(FXObject*,FXSelector,void* ptr);
00051 public:
00052 
00053   /// Construct image frame and pass it an image
00054   FXBitmapFrame(FXComposite* p,FXBitmap *bmp,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);
00055 
00056   /// Create window
00057   virtual void create();
00058 
00059   /// Get default width
00060   virtual FXint getDefaultWidth();
00061 
00062   /// Get default height
00063   virtual FXint getDefaultHeight();
00064 
00065   /// Change the image being displayed
00066   void setBitmap(FXBitmap* bmp);
00067 
00068   /// Return the current image
00069   FXBitmap* getBitmap() const { return bitmap; }
00070 
00071   /// Set on color
00072   void setOnColor(FXColor clr);
00073 
00074   /// Get on color
00075   FXColor getOnColor() const { return onColor; }
00076 
00077   /// Set off color
00078   void setOffColor(FXColor clr);
00079 
00080   /// Get off color
00081   FXColor getOffColor() const { return offColor; }
00082 
00083   /// Set the current justification mode.
00084   void setJustify(FXuint mode);
00085 
00086   /// Get the current justification mode.
00087   FXuint getJustify() const;
00088 
00089   /// Save to stream
00090   virtual void save(FXStream& store) const;
00091 
00092   /// Load from stream
00093   virtual void load(FXStream& store);
00094 
00095   /// Destroy the widget, but do not destroy the image
00096   virtual ~FXBitmapFrame();
00097   };
00098 
00099 }
00100 
00101 
00102 #endif

Copyright © 1997-2009 Jeroen van der Zijp