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

SizableDirectionButton.h

Go to the documentation of this file.
00001 //345678901234567890123456789012345678901234567890123456789012345678901234567890
00002 // SizableDirectionButton.h
00003 // Author: Richard van Balen
00004 
00005 #ifndef OglGui_SizableDirectionButton_h
00006 #define OglGui_SizableDirectionButton_h
00007 
00008 #ifndef OglGui_DirectionButton_h
00009 #include "OglGui/DirectionButton.h"
00010 #endif
00011 
00012 #ifndef OglGui_SizableWindow_h
00013 #include "OglGui/SizableWindow.h"
00014 #endif
00015 
00016 namespace OglGui {
00017 
00018 class SizableDirectionButton : public SizableWindow
00019 {
00020 public:
00021     SizableDirectionButton(Window* parent, int w, int h,
00022                            int dir, int brdType=BEV_RAISED) :
00023         SizableWindow(parent,w,h)
00024     {
00025         Init(w,h,dir,brdType);
00026     }
00027 
00028     SizableDirectionButton(Window* parent,int x,int y,int w,int h,
00029                            int dir, int brdType=BEV_RAISED) :
00030         SizableWindow(parent,x,y,w,h)
00031     {
00032         Init(w,h,dir,brdType);
00033     }
00034 
00035     void SetColors(ULONG col, ULONG highlightCol)
00036     {
00037         mColor = col;
00038         mHighlightColor = highlightCol;
00039     }
00040 
00041     DirectionButton* DirButton()
00042     {
00043         return mDirectionButton;
00044     }
00045 
00046     virtual void DisplayFunc()
00047     {
00048         ULONG col = GetState()==1 ? mColor : mHighlightColor;
00049         mDirectionButton->SetForeground(col);
00050         SizableWindow::DisplayFunc();
00051     }
00052 
00053 private:
00054     void Init(int w, int h, float dir, int brdType)
00055     {
00056         mDirectionButton = new DirectionButton(this,0,0,w,h,dir,brdType);
00057         mDirectionButton->SetMargin(1);
00058         mDirectionButton->ConnectTo(this);
00059         mDirectionButton->SetAllowScaling(false);
00060         SetColors(oglBLACK,oglBLACK);
00061         oglSys.SetNoMouseInput(mDirectionButton->GetOGLWND(),true);
00062     }
00063 
00064     DirectionButton*     mDirectionButton;
00065     ULONG                mColor;
00066     ULONG                mHighlightColor;
00067 };
00068 
00069 } // Namespace OglGui
00070 #endif
00071 

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