Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

WindowDocScroller.h

Go to the documentation of this file.
00001 //345678901234567890123456789012345678901234567890123456789012345678901234567890
00002 // Author: Richard van Balen, for University of Amsterdam
00004 
00005 #ifndef OglGui_WindowDocScroller_h
00006 #define OglGui_WindowDocScroller_h
00007 
00008 #ifndef OglGui_DocScroller_h
00009 #include "OglGui/DocScroller.h"
00010 #endif
00011 
00012 namespace OglGui {
00013 
00014 class WindowDocScroller : public DocScroller
00015 {
00016 public:
00017     WindowDocScroller(int x, int y, int w, int h, int sB=3+12) :
00018         DocScroller(x,y,w,h,sB)
00019     {
00020         Init(w,h);
00021     }
00022 
00023     WindowDocScroller(Window* parent, int w, int h, int sB=3+12) :
00024         DocScroller(parent,w,h,sB)
00025     {
00026         Init(w,h);
00027     }
00028 
00029     WindowDocScroller(Window* parent, int x, int y, int w, int h, int sB=3+12) :
00030         DocScroller(parent,x,y,w,h,sB)
00031     {
00032         Init(w,h);
00033     }
00034 /*
00035 void
00036 SetDocWindow(Window* wnd, DocDimensions* doc, int mapKeysToScrollBar=0)
00037 {
00038     if (wnd)
00039     {
00040         int y = HorizontalScrollBar() ? 16 : 2;
00041         int w = W() - (VerticalScrollBar() ? 18 : 2);
00042         int h = H() - (HorizontalScrollBar() ? 18 : 2);
00043         wnd->SetDimensions(2,y,w,h);
00044         wnd->ConnectTo(this);
00045         if (mapKeysToScrollBar)
00046             wnd->MapKeysTo(mapKeysToScrollBar==1 ? HorizontalScrollBar() :
00047                            VerticalScrollBar());
00048     }
00049     if (doc)
00050         SetDoc(doc);
00051 }
00052 */
00053     
00054     void
00055     SetDocWindow(Window* wnd, DocDimensions* doc, int mapKeysToScrollBar=0)
00056     {
00057         if (wnd)
00058         {
00059             int y = HorizontalScrollBar() ? 16 : 2;
00060             int w = W() - (VerticalScrollBar() ? 20 : 4);
00061             int h = H() - (HorizontalScrollBar() ? 20 : 4);
00062             wnd->SetDimensions(2,y,w,h);
00063             wnd->ConnectTo(this);
00064             wnd->SetAllowScaling(false);
00065             if (mapKeysToScrollBar)
00066                 wnd->MapKeysTo(mapKeysToScrollBar==1 ? HorizontalScrollBar() :
00067                                VerticalScrollBar());
00068         }
00069         if (doc)
00070             SetDoc(doc);
00071     }
00072 
00073 protected:
00074     Window*     mWnd;
00075 
00076 private:
00077     void Init(int w, int h)
00078     {
00079         mWnd = 0;
00080     }
00081 };
00082 } // namespace OglGui
00083 
00084 #endif

Generated on Fri Mar 19 09:31:41 2010 for ImpalaSrc by  doxygen 1.5.1