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

FXImageFrame.h
Go to the documentation of this file.
1 /********************************************************************************
2 * *
3 * I m a g e 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: FXImageFrame.h,v 1.8 2006/01/22 17:58:05 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXIMAGEFRAME_H
25 #define FXIMAGEFRAME_H
26 
27 #ifndef FXFRAME_H
28 #include "FXFrame.h"
29 #endif
30 
31 namespace FX {
32 
33 
34 /**
35 * The image frame is a simple frame widget displaying
36 * an image; the image is not owned by the image frame so
37 * it must be explicitly deleted elsewhere.
38 */
39 class FXAPI FXImageFrame : public FXFrame {
41 protected:
42  FXImage* image; // The image being displayed
43 protected:
44  FXImageFrame();
45 private:
46  FXImageFrame(const FXImageFrame&);
47  FXImageFrame &operator=(const FXImageFrame&);
48 public:
49  long onPaint(FXObject*,FXSelector,void* ptr);
50 public:
51 
52  /// Construct image frame and pass it an image
53  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);
54 
55  /// Create window
56  virtual void create();
57 
58  /// Get default width
59  virtual FXint getDefaultWidth();
60 
61  /// Get default height
62  virtual FXint getDefaultHeight();
63 
64  /// Change the image being displayed
65  void setImage(FXImage* img);
66 
67  /// Return the current image
68  FXImage* getImage() const { return image; }
69 
70  /// Set the current justification mode.
71  void setJustify(FXuint mode);
72 
73  /// Get the current justification mode.
74  FXuint getJustify() const;
75 
76  /// Save to stream
77  virtual void save(FXStream& store) const;
78 
79  /// Load from stream
80  virtual void load(FXStream& store);
81 
82  /// Destroy the widget, but do not destroy the image
83  virtual ~FXImageFrame();
84  };
85 
86 }
87 
88 
89 #endif
The Frame widget provides borders around some contents.
Definition: FXFrame.h:73
unsigned int FXuint
Definition: fxdefs.h:389
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
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:99
Definition: FX4Splitter.h:31
int FXint
Definition: fxdefs.h:390
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:166
The image frame is a simple frame widget displaying an image; the image is not owned by the image fra...
Definition: FXImageFrame.h:39
An Image is a rectangular array of pixels.
Definition: FXImage.h:67
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