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

FXScrollWindow.h
Go to the documentation of this file.
1 /********************************************************************************
2 * *
3 * S c r o l l W i n d o w W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1997,2006 by Jeroen van der Zijp. 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: FXScrollWindow.h,v 1.21 2006/01/22 17:58:09 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXSCROLLWINDOW_H
25 #define FXSCROLLWINDOW_H
26 
27 #ifndef FXSCROLLAREA_H
28 #include "FXScrollArea.h"
29 #endif
30 
31 namespace FX {
32 
33 
34 /**
35 * The scroll window widget scrolls an arbitrary child window.
36 * Use the scroll window when parts of the user interface itself
37 * need to be scrolled, for example when applications need to run
38 * on small screens. The scroll window observes some layout hints of
39 * its content-window; it observes LAYOUT_FIX_WIDTH, LAYOUT_FIX_HEIGHT
40 * at all times. The hints LAYOUT_FILL_X, LAYOUT_LEFT, LAYOUT_RIGHT,
41 * LAYOUT_CENTER_X, as well as LAYOUT_FILL_Y, LAYOUT_TOP, LAYOUT_BOTTOM,
42 * LAYOUT_CENTER_Y are however only interpreted if the content size
43 * is smaller than the viewport size, because if the content size is
44 * larger than the viewport size, then content must be scrolled.
45 * Note that this means that the content window's position is not
46 * necessarily equal to the scroll position of the scroll window!
47 */
50 protected:
51  FXScrollWindow(){}
52  virtual void moveContents(FXint x,FXint y);
53 private:
55  FXScrollWindow &operator=(const FXScrollWindow&);
56 public:
57  long onKeyPress(FXObject*,FXSelector,void*);
58  long onKeyRelease(FXObject*,FXSelector,void*);
59  long onFocusSelf(FXObject*,FXSelector,void*);
60 public:
61 
62  /// Construct a scroll window
63  FXScrollWindow(FXComposite* p,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
64 
65  /// Perform layout
66  virtual void layout();
67 
68  /// Return a pointer to the contents window
69  FXWindow* contentWindow() const;
70 
71  /// Return the width of the contents
72  virtual FXint getContentWidth();
73 
74  /// Return the height of the contents
75  virtual FXint getContentHeight();
76  };
77 
78 }
79 
80 #endif
Base class for all windows.
Definition: FXWindow.h:115
unsigned int FXuint
Definition: fxdefs.h:396
FXuint FXSelector
Association key.
Definition: FXObject.h:53
#define FXAPI
Definition: fxdefs.h:122
The scroll window widget scrolls an arbitrary child window.
Definition: FXScrollWindow.h:48
Base composite.
Definition: FXComposite.h:35
int FXint
Definition: fxdefs.h:397
The scroll area widget manages a content area and a viewport area through which the content is viewed...
Definition: FXScrollArea.h:75
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:166
#define FXDECLARE(classname)
Macro to set up class declaration.
Definition: FXObject.h:92

Copyright © 1997-2005 Jeroen van der Zijp