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

FXScrollWindow.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                     S c r o l l W i n d o w   W i d g e t                     *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1997,2006 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (at your option) any later version.            *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: FXScrollWindow.h,v 1.21 2006/01/22 17:58:09 fox Exp $                    *
00023 ********************************************************************************/
00024 #ifndef FXSCROLLWINDOW_H
00025 #define FXSCROLLWINDOW_H
00026 
00027 #ifndef FXSCROLLAREA_H
00028 #include "FXScrollArea.h"
00029 #endif
00030 
00031 namespace FX {
00032 
00033 
00034 /**
00035 * The scroll window widget scrolls an arbitrary child window.
00036 * Use the scroll window when parts of the user interface itself
00037 * need to be scrolled, for example when applications need to run
00038 * on small screens.  The scroll window observes some layout hints of
00039 * its content-window; it observes LAYOUT_FIX_WIDTH, LAYOUT_FIX_HEIGHT
00040 * at all times.  The hints LAYOUT_FILL_X, LAYOUT_LEFT, LAYOUT_RIGHT,
00041 * LAYOUT_CENTER_X, as well as LAYOUT_FILL_Y, LAYOUT_TOP, LAYOUT_BOTTOM,
00042 * LAYOUT_CENTER_Y are however only interpreted if the content size
00043 * is smaller than the viewport size, because if the content size is
00044 * larger than the viewport size, then content must be scrolled.
00045 * Note that this means that the content window's position is not
00046 * necessarily equal to the scroll position of the scroll window!
00047 */
00048 class FXAPI FXScrollWindow : public FXScrollArea {
00049   FXDECLARE(FXScrollWindow)
00050 protected:
00051   FXScrollWindow(){}
00052   virtual void moveContents(FXint x,FXint y);
00053 private:
00054   FXScrollWindow(const FXScrollWindow&);
00055   FXScrollWindow &operator=(const FXScrollWindow&);
00056 public:
00057   long onKeyPress(FXObject*,FXSelector,void*);
00058   long onKeyRelease(FXObject*,FXSelector,void*);
00059   long onFocusSelf(FXObject*,FXSelector,void*);
00060 public:
00061 
00062   /// Construct a scroll window
00063   FXScrollWindow(FXComposite* p,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00064 
00065   /// Perform layout
00066   virtual void layout();
00067 
00068   /// Return a pointer to the contents window
00069   FXWindow* contentWindow() const;
00070 
00071   /// Return the width of the contents
00072   virtual FXint getContentWidth();
00073 
00074   /// Return the height of the contents
00075   virtual FXint getContentHeight();
00076   };
00077 
00078 }
00079 
00080 #endif

Copyright © 1997-2005 Jeroen van der Zijp