Page MenuHomeHEPForge

FROG_Window_Control_Button_Toogle.h
No OneTemporary

FROG_Window_Control_Button_Toogle.h

#ifndef _FROG_WINDOW_CONTROL_BUTTON_TOOGLE_H__
#define _FROG_WINDOW_CONTROL_BUTTON_TOOGLE_H__
#include "FROG_Window_Control_Button.h"
class FROG_Window_Control_Button_Toogle: public FROG_Window_Control_Button{
public:
unsigned char txt_pos_;
bool* stateP_;
bool state_;
public :
FROG_Window_Control_Button_Toogle(int x,int y,int w,int h, char* name=NULL, FROG_Viewport* parent=NULL):FROG_Window_Control_Button(x,y,w,h,name,parent){
txt_pos_ = 0+3*1;
stateP_ = NULL;
state_ = false;
}
virtual ~FROG_Window_Control_Button_Toogle(){
}
virtual int minimal_width(){
return (FROG_Window_Control_Button::minimal_width()+20);
}
void setRefState(bool* refstate){
stateP_ = refstate;
}
void setState(bool state){
if(stateP_){
(*stateP_) = state;
}else{
state_ = state;
}
}
virtual bool Callback_Display(void){
if(!visible_)return false;
bool toReturn = FROG_Window_Control_Button::Callback_Display();
glViewport(x_, y_, w_, h_);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, w_,0, h_, -1, 1);
glMatrixMode (GL_MODELVIEW);
glLoadIdentity ();
glColor4f(0,0,0,1.0f);
glBegin(GL_LINE_LOOP);
glVertex2i(w_-18,2 );
glVertex2i(w_-2 ,2 );
glVertex2i(w_-2 ,h_-2);
glVertex2i(w_-18,h_-2);
glEnd();
if((stateP_ && (*stateP_)) || (!stateP_ && (state_)) ){
glBegin(GL_QUADS);
glVertex2i(w_-15,5 );
glVertex2i(w_-5 ,5 );
glVertex2i(w_-5 ,h_-5);
glVertex2i(w_-15,h_-5);
glEnd();
}
return toReturn;
}
};
#endif

File Metadata

Mime Type
text/x-c++
Expires
Sat, Dec 21, 3:59 PM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4023367
Default Alt Text
FROG_Window_Control_Button_Toogle.h (1 KB)

Event Timeline