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

FXBitmapFrame.h
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,2024 by H. J. Daniel III. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (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 *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXBITMAPFRAME_H
22 #define FXBITMAPFRAME_H
23 
24 #ifndef FXFRAME_H
25 #include "FXFrame.h"
26 #endif
27 
28 namespace FX {
29 
30 
36 class FXAPI FXBitmapFrame : public FXFrame {
37  FXDECLARE(FXBitmapFrame)
38 protected:
39  FXBitmap *bitmap; // The bitmap being displayed
40  FXColor onColor; // Color for on pixels
41  FXColor offColor; // Color for off pixels
42 protected:
43  FXBitmapFrame();
44 private:
46  FXBitmapFrame &operator=(const FXBitmapFrame&);
47 public:
48  long onPaint(FXObject*,FXSelector,void* ptr);
49 public:
50 
52  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);
53 
55  virtual void create();
56 
58  virtual FXint getDefaultWidth();
59 
61  virtual FXint getDefaultHeight();
62 
64  void setBitmap(FXBitmap* bmp);
65 
67  FXBitmap* getBitmap() const { return bitmap; }
68 
70  void setOnColor(FXColor clr);
71 
73  FXColor getOnColor() const { return onColor; }
74 
76  void setOffColor(FXColor clr);
77 
79  FXColor getOffColor() const { return offColor; }
80 
82  void setJustify(FXuint mode);
83 
85  FXuint getJustify() const;
86 
88  virtual void save(FXStream& store) const;
89 
91  virtual void load(FXStream& store);
92 
94  virtual ~FXBitmapFrame();
95  };
96 
97 }
98 
99 
100 #endif
A Bitmap is a rectangular array of pixels.
Definition: FXBitmap.h:55
The Frame widget provides borders around some contents.
Definition: FXFrame.h:58
FXColor getOnColor() const
Get on color.
Definition: FXBitmapFrame.h:73
Base composite.
Definition: FXComposite.h:32
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
Definition: FX4Splitter.h:28
The bitmap frame is a simple frame widget displaying an monochrome bitmap image; the bitmap is not ow...
Definition: FXBitmapFrame.h:36
FXBitmap * getBitmap() const
Return the current image.
Definition: FXBitmapFrame.h:67
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:134
FXColor getOffColor() const
Get off color.
Definition: FXBitmapFrame.h:79

Copyright © 1997-2022 Jeroen van der Zijp