Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F8309625
FROG_Window_Control_Button_Toogle.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
FROG_Window_Control_Button_Toogle.h
View Options
#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
Details
Attached
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)
Attached To
rFROGSVN frogsvn
Event Timeline
Log In to Comment