Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 89 lines (75 sloc) 2.939 kb
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
1 /***********************************************************************
2 * FXRuby -- the Ruby language bindings for the FOX GUI toolkit.
b8219ec @lylejohnson Updated copyright notice for all SWIG interface files
lylejohnson authored
3 * Copyright (c) 2001-2009 by Lyle Johnson. All Rights Reserved.
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * For further information please contact the author by e-mail
a934547 @lylejohnson Replaced e-mail address "lyle@users.sourceforge.net" with
lylejohnson authored
20 * at "lyle@lylejohnson.name".
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
21 ***********************************************************************/
22
23 class FXImage;
24
25
26 /// Image alignment styles
27 enum {
28 IMAGEVIEW_NORMAL = 0, /// Normal mode is centered
29 IMAGEVIEW_CENTER_X = 0, /// Centered horizontally
30 IMAGEVIEW_LEFT = 0x00100000, /// Left-aligned
31 IMAGEVIEW_RIGHT = 0x00200000, /// Right-aligned
32 IMAGEVIEW_CENTER_Y = 0, /// Centered vertically
33 IMAGEVIEW_TOP = 0x00400000, /// Top-aligned
34 IMAGEVIEW_BOTTOM = 0x00800000 /// Bottom-aligned
35 };
36
37
38 /**
39 * The Image View widget display a scrollable view of an image.
40 */
41 class FXImageView : public FXScrollArea {
42 protected:
43 FXImage *image; // Image to view
44 FXint grabx; // Grab point x
45 FXint graby; // Grab point y
46 protected:
47 FXImageView();
48 public:
49 long onPaint(FXObject*,FXSelector,void* PTR_EVENT);
50 long onMotion(FXObject*,FXSelector,void* PTR_EVENT);
51 long onRightBtnPress(FXObject*,FXSelector,void* PTR_EVENT);
52 long onRightBtnRelease(FXObject*,FXSelector,void* PTR_EVENT);
53 public:
54 enum {
55 ID_XYZ=FXScrollArea::ID_LAST,
56 ID_LAST
57 };
58 public:
59 %extend {
60 /// Construct a scroll window
61 FXImageView(FXComposite* p,FXImage* img=NULL,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0){
62 return new FXRbImageView(p,img,tgt,sel,opts,x,y,w,h);
63 }
64 }
65
66 /// Change image
67 void setImage(FXImage* img);
bea4cad @larskanis Strip all whitespaces on line endings
authored
68
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
69 /// Return image
70 FXImage* getImage() const;
71
72 /// Set the current alignment.
73 void setAlignment(FXuint mode);
74
75 /// Get the current alignment.
76 FXuint getAlignment() const;
77
78 /// Destroy
79 virtual ~FXImageView();
80 };
81
82
83 DECLARE_FXOBJECT_VIRTUALS(FXImageView)
84 DECLARE_FXID_VIRTUALS(FXImageView)
85 DECLARE_FXDRAWABLE_VIRTUALS(FXImageView)
86 DECLARE_FXWINDOW_VIRTUALS(FXImageView)
87 DECLARE_FXSCROLLAREA_VIRTUALS(FXImageView)
88
Something went wrong with that request. Please try again.