00001 #ifndef OglGui_WindowScrollBar_h
00002 #define OglGui_WindowScrollBar_h
00003
00004
00005 #ifndef OglGui_ScrollBar_h
00006 #include "OglGui/ScrollBar.h"
00007 #endif
00008
00009 namespace OglGui
00010 {
00011
00017 class WindowScrollBar : public ScrollBar
00018 {
00019 public:
00020
00021 WindowScrollBar(Window* parent, bool horizontal, bool stdSide=true,
00022 int wide=16, int leaveRoom=0, int leaveBorderRoom=0)
00023 : ScrollBar(parent, 0, 0, wide, wide, horizontal)
00024 {
00025 int x = leaveBorderRoom;
00026 int y = leaveBorderRoom;
00027 int conMode = TPARENT;
00028
00029 SetAllowScaling(false);
00030 if (horizontal)
00031 {
00032 int w = parent->WndWidth() - abs(leaveRoom) - 2*leaveBorderRoom;
00033 if (leaveRoom < 0)
00034 x -= leaveRoom;
00035 if (!stdSide)
00036 y = parent->WndHeight() - wide - leaveBorderRoom;
00037 SetPosition(x, y, w, wide);
00038 conMode |= stdSide ? L2L|R2R|B2B|T2B : L2L|R2R|T2T|B2T;
00039 ConnectTo(parent, conMode);
00040 }
00041 else
00042 {
00043 int h = parent->WndHeight() - abs(leaveRoom) - 2*leaveBorderRoom;
00044 if (leaveRoom > 0)
00045 y += leaveRoom;
00046 if (stdSide)
00047 x = parent->WndWidth() - wide - leaveBorderRoom;
00048 SetPosition(x, y, wide, h);
00049 conMode |= stdSide ? T2T|B2B|R2R|L2R : T2T|B2B|L2L|R2L;
00050 ConnectTo(parent, conMode);
00051 }
00052 }
00053
00054 };
00055
00056 }
00057
00058 #endif // WindowScrollBar_h