00001 #ifndef OglGui_SelectedViewControl_h
00002 #define OglGui_SelectedViewControl_h
00003
00004 #ifndef OglGui_ViewMoveControl_h
00005 #include "OglGui/ViewMoveControl.h"
00006 #endif
00007
00008 #ifndef OglGui_ViewRotateControl_h
00009 #include "OglGui/ViewRotateControl.h"
00010 #endif
00011
00012 #ifndef OglGui_ImMoveControl_h
00013 #include "OglGui/ImMoveControl.h"
00014 #endif
00015
00016 namespace OglGui
00017 {
00018
00019 class SelectedViewControl : public Window
00020 {
00021 public:
00022
00023 SelectedViewControl(int x, int y, int w, int h, Window* targetWnd) :
00024 Window(x, y, w, h)
00025 {
00026 Init(w,h,targetWnd);
00027 }
00028
00029 SelectedViewControl(Window *parent, int w, int h, Window* targetWnd=0) :
00030 Window(parent, w, h)
00031 {
00032 Init(w,h,targetWnd);
00033 }
00034
00035 SelectedViewControl(Window *parent, int x, int y, int w, int h,
00036 Window* targetWnd=0) :
00037 Window(parent, x, y, w, h)
00038 {
00039 Init(w,h,targetWnd);
00040 }
00041
00042
00043 void SetTargetWindow(Window* target)
00044 {
00045 mViewMover->SetTargetWindow(target);
00046 mViewRotator->SetTargetWindow(target);
00047 mImMover->SetTargetWindow(target);
00048 }
00049
00050 void SetGroupBorderShading(ULONG brdBg, int fillShaded)
00051 {
00052 mViewMover->SetGroupBorderShading(brdBg, fillShaded);
00053 mViewRotator->SetGroupBorderShading(brdBg, fillShaded);
00054 mImMover->SetGroupBorderShading(brdBg, fillShaded);
00055 }
00056
00057 static void PreferredSize(int& w, int &h)
00058 {
00059 w = 364;
00060 h = 174;
00061 }
00062
00063 ViewMoveControl* ViewMover()
00064 {
00065 return mViewMover;
00066 }
00067
00068 ViewRotateControl* ViewRotator()
00069 {
00070 return mViewRotator;
00071 }
00072
00073 ImMoveControl* ImMover()
00074 {
00075 return mImMover;
00076 }
00077
00078
00079
00080 private:
00081 ViewMoveControl* mViewMover;
00082 ViewRotateControl* mViewRotator;
00083 ImMoveControl* mImMover;
00084
00085 void Init(int w, int h, Window* targetWnd)
00086 {
00087 SetBorderType(BEV_ETCHED);
00088
00089 int pW, pH;
00090 PreferredSize(pW,pH);
00091 SetDimensions(pW, pH);
00092 mViewMover = new ViewMoveControl(this, 2, 2, pW/3, pH, targetWnd, true);
00093 mViewRotator = new ViewRotateControl(this, 2+pW/3, 2, pW/3, pH, targetWnd);
00094 mImMover = new ImMoveControl(this, 2+(2*pW)/3, 2, pW/3, pH, targetWnd);
00095
00096 ScaleChildren(0,true);
00097 SetAllowChildScaling(false);
00098 SetDimensions(w,h);
00099 }
00100 };
00101
00102 }
00103
00104 #endif