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

FXScrollPane.h

00001 /******************************************************************************** 00002 * * 00003 * S c r o l l i n g M e n u P a n e W i d g e t * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 1997,2005 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: FXScrollPane.h,v 1.8 2005/01/16 16:06:06 fox Exp $ * 00023 ********************************************************************************/ 00024 #ifndef FXSCROLLPANE_H 00025 #define FXSCROLLPANE_H 00026 00027 #ifndef FXMENUPANE_H 00028 #include "FXMenuPane.h" 00029 #endif 00030 00031 namespace FX { 00032 00033 class FXArrowButton; 00034 00035 /** 00036 * A Scroll Pane is a menu pane which provides scrolling of menu entries. 00037 * It is useful when menus are populated programmatically and it is not 00038 * known in advance how many entries will be added. 00039 */ 00040 class FXAPI FXScrollPane : public FXMenuPane { 00041 FXDECLARE(FXScrollPane) 00042 protected: 00043 FXArrowButton *dn; // Button to scroll down 00044 FXArrowButton *up; // Button to scroll up 00045 FXint visible; // Visible entries 00046 FXint top; // Top visible entry 00047 protected: 00048 FXScrollPane(); 00049 private: 00050 FXScrollPane(const FXScrollPane&); 00051 FXScrollPane &operator=(const FXScrollPane&); 00052 public: 00053 long onUpdIncrement(FXObject*,FXSelector,void*); 00054 long onCmdIncrement(FXObject*,FXSelector,void*); 00055 long onUpdDecrement(FXObject*,FXSelector,void*); 00056 long onCmdDecrement(FXObject*,FXSelector,void*); 00057 public: 00058 enum { 00059 ID_SCROLL_DN=FXMenuPane::ID_LAST, 00060 ID_SCROLL_UP, 00061 ID_LAST 00062 }; 00063 public: 00064 00065 /// Construct menu pane 00066 FXScrollPane(FXWindow* owner,FXint nvis,FXuint opts=0); 00067 00068 /// Return the default width of this window 00069 virtual FXint getDefaultWidth(); 00070 00071 /// Return the default height of this window 00072 virtual FXint getDefaultHeight(); 00073 00074 /// Show this window 00075 virtual void show(); 00076 00077 /// Perform layout 00078 virtual void layout(); 00079 00080 /// Get index of top most menu item 00081 FXint getTopItem() const { return top; } 00082 00083 /// Scroll item to top 00084 void setTopItem(FXint t); 00085 00086 /// Destroy 00087 virtual ~FXScrollPane(); 00088 }; 00089 00090 } 00091 00092 #endif

Copyright © 1997-2005 Jeroen van der Zijp