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

FXBitmapFrame.h
Go to the documentation of this file.
1 /********************************************************************************
2 * *
3 * B i t m a p F r a m e W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2001,2006 by H. J. Daniel III. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Lesser General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2.1 of the License, or (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
21 *********************************************************************************
22 * $Id: FXBitmapFrame.h,v 1.6 2006/01/22 17:57:59 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXBITMAPFRAME_H
25 #define FXBITMAPFRAME_H
26 
27 #ifndef FXFRAME_H
28 #include "FXFrame.h"
29 #endif
30 
31 namespace FX {
32 
33 
34 /**
35 * The bitmap frame is a simple frame widget displaying an monochrome bitmap
36 * image; the bitmap is not owned by the bitmap frame so it must be explicitly
37 * deleted elsewhere.
38 */
39 class FXAPI FXBitmapFrame : public FXFrame {
41 protected:
42  FXBitmap *bitmap; // The bitmap being displayed
43  FXColor onColor; // Color for on pixels
44  FXColor offColor; // Color for off pixels
45 protected:
46  FXBitmapFrame();
47 private:
49  FXBitmapFrame &operator=(const FXBitmapFrame&);
50 public:
51  long onPaint(FXObject*,FXSelector,void* ptr);
52 public:
53 
54  /// Construct image frame and pass it an image
55  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);
56 
57  /// Create window
58  virtual void create();
59 
60  /// Get default width
61  virtual FXint getDefaultWidth();
62 
63  /// Get default height
64  virtual FXint getDefaultHeight();
65 
66  /// Change the image being displayed
67  void setBitmap(FXBitmap* bmp);
68 
69  /// Return the current image
70  FXBitmap* getBitmap() const { return bitmap; }
71 
72  /// Set on color
73  void setOnColor(FXColor clr);
74 
75  /// Get on color
76  FXColor getOnColor() const { return onColor; }
77 
78  /// Set off color
79  void setOffColor(FXColor clr);
80 
81  /// Get off color
82  FXColor getOffColor() const { return offColor; }
83 
84  /// Set the current justification mode.
85  void setJustify(FXuint mode);
86 
87  /// Get the current justification mode.
88  FXuint getJustify() const;
89 
90  /// Save to stream
91  virtual void save(FXStream& store) const;
92 
93  /// Load from stream
94  virtual void load(FXStream& store);
95 
96  /// Destroy the widget, but do not destroy the image
97  virtual ~FXBitmapFrame();
98  };
99 
100 }
101 
102 
103 #endif
A Bitmap is a rectangular array of pixels.
Definition: FXBitmap.h:64
The Frame widget provides borders around some contents.
Definition: FXFrame.h:73
unsigned int FXuint
Definition: fxdefs.h:396
FXuint FXSelector
Association key.
Definition: FXObject.h:53
#define FXAPI
Definition: fxdefs.h:122
Sunken border.
Definition: FXWindow.h:76
Base composite.
Definition: FXComposite.h:35
FXuint FXColor
Definition: fxdefs.h:454
Definition: FX4Splitter.h:31
int FXint
Definition: fxdefs.h:397
The bitmap frame is a simple frame widget displaying an monochrome bitmap image; the bitmap is not ow...
Definition: FXBitmapFrame.h:39
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:166
Thick border.
Definition: FXWindow.h:78
#define FXDECLARE(classname)
Macro to set up class declaration.
Definition: FXObject.h:92

Copyright © 1997-2005 Jeroen van der Zijp