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

Copyright © 1997-2005 Jeroen van der Zijp