Laxkit  0.0.7.1
scrolledwindow.h
1 //
2 //
3 // The Laxkit, a windowing toolkit
4 // Please consult http://laxkit.sourceforge.net about where to send any
5 // correspondence about this software.
6 //
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Library General Public
9 // License as published by the Free Software Foundation; either
10 // version 2 of the License, or (at your option) any later version.
11 //
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // Library General Public License for more details.
16 //
17 // You should have received a copy of the GNU Library General Public
18 // License along with this library; if not, write to the Free Software
19 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 //
21 // Copyright (C) 2004-2006,2010 by Tom Lechner
22 //
23 #ifndef _LAX_SCROLLEDWINDOW_H
24 #define _LAX_SCROLLEDWINDOW_H
25 
26 #include <lax/scroller.h>
27 #include <lax/pancontroller.h>
28 #include <lax/panpopup.h>
29 #include <lax/rectangles.h>
30 
31  // Put an x scroller on either top or bottom
32 #define SW_TOP (1<<16)
33 #define SW_BOTTOM (1<<17)
34  // Put a y scroller on either left or right
35 #define SW_LEFT (1<<18)
36 #define SW_RIGHT (1<<19)
37  // inlude a PanWindow in corner between the scrollers
38 #define SW_INCLUDE_PAN (1<<20)
39  // Always have x or y scrollers, they do not go away when not needed.
40 #define SW_ALWAYS_X (1<<21)
41 #define SW_ALWAYS_Y (1<<22)
42  // Allow scrolling in the x or y direction
43 #define SW_X_ZOOMABLE (1<<23)
44 #define SW_Y_ZOOMABLE (1<<24)
45  // When zooming, preserve the aspect ratio of the boxed area.
46 #define SW_SYNC_XY (1<<25)
47  // Move around a subwindow in response to scroll events,
48  // Otherwise default is to simply relay pan changes to thewindow.
49 #define SW_MOVE_WINDOW (1<<26)
50 
51 namespace Laxkit {
52 
53 class ScrolledWindow : public PanUser, public anXWindow
54 {
55  protected:
56  virtual void findoutrect();
57  virtual void adjustinrect();
58  public:
60  int scrollwidth;
61  PanPopup *panpopup;
62  anXWindow *thewindow;
63  Scroller *xscroller,*yscroller;
64  ScrolledWindow(anXWindow *parnt,const char *nname,const char *ntitle,unsigned long nstyle,
65  int xx,int yy,int ww,int hh,int brder,
66  anXWindow *prev,unsigned long nowner=0,const char *nsend=NULL,
67  PanController *pan=NULL);
68  virtual int init();
69  virtual int send();
70  virtual void syncWindows(int useinrect=0);
71  virtual int UseThisWindow(anXWindow *nwindow);
72  virtual int MoveResize(int nx,int ny,int nw,int nh);
73  virtual int Resize(int nw,int nh);
74  virtual int Event(const EventData *e,const char *mes);
75 };
76 
77 } // namespace Laxkit
78 
79 #endif
80 

Mon Feb 17 2014 11:52:57, Laxkit