Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plugin-GUI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
yehaojie
plugin-GUI
Commits
106333df
Commit
106333df
authored
12 years ago
by
jsiegle
Browse files
Options
Downloads
Patches
Plain Diff
ControlPanel is now free of OpenGL
parent
0eec8696
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/UI/ControlPanel.cpp
+17
-33
17 additions, 33 deletions
Source/UI/ControlPanel.cpp
Source/UI/ControlPanel.h
+3
-10
3 additions, 10 deletions
Source/UI/ControlPanel.h
with
20 additions
and
43 deletions
Source/UI/ControlPanel.cpp
+
17
−
33
View file @
106333df
...
...
@@ -217,10 +217,6 @@ void Clock::drawTime(Graphics& g)
}
String
timeString
=
""
;
// if (m < 10)
// String timeString = " ";
// else if (m < 100)
timeString
+=
m
;
timeString
+=
" min "
;
...
...
@@ -231,12 +227,6 @@ void Clock::drawTime(Graphics& g)
g
.
setFont
(
30
);
g
.
drawText
(
timeString
,
0
,
0
,
getWidth
(),
getHeight
(),
Justification
::
left
,
false
);
// glRasterPos2f(8.0/getWidth(),0.75f);
// getFont(cpmono_light)->FaceSize(23);
// getFont(cpmono_light)->Render(timeString);
}
void
Clock
::
start
()
...
...
@@ -292,41 +282,35 @@ ControlPanelButton::~ControlPanelButton()
}
void
ControlPanelButton
::
newOpenGLContextCreated
(
)
void
ControlPanelButton
::
paint
(
Graphics
&
g
)
{
g
.
fillAll
(
Colour
(
58
,
58
,
58
));
setUp2DCanvas
();
activateAntiAliasing
();
setClearColor
(
darkgrey
);
}
void
ControlPanelButton
::
renderOpenGL
()
{
glClear
(
GL_COLOR_BUFFER_BIT
);
drawButton
();
}
g
.
setColour
(
Colours
::
white
);
void
ControlPanelButton
::
drawButton
()
{
glColor4f
(
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
);
glLineWidth
(
1.0
f
);
Path
p
;
glBegin
(
GL_LINE_LOOP
);
float
h
=
getHeight
();
float
w
=
getWidth
();
if
(
open
)
{
glVertex2f
(
0.5
,
0.8
);
glVertex2f
(
0.2
,
0.2
);
p
.
addTriangle
(
0.5
f
*
w
,
0.8
f
*
h
,
0.2
f
*
w
,
0.2
f
*
h
,
0.8
f
*
w
,
0.2
f
*
h
);
}
else
{
glVertex2f
(
0.8
,
0.8
);
glVertex2f
(
0.2
,
0.5
);
p
.
addTriangle
(
0.8
f
*
w
,
0.8
f
*
h
,
0.2
f
*
w
,
0.5
f
*
h
,
0.8
f
*
w
,
0.2
f
*
h
);
}
glVertex2f
(
0.8
,
0.2
);
glEnd
();
PathStrokeType
pst
=
PathStrokeType
(
1.0
f
,
PathStrokeType
::
curved
,
PathStrokeType
::
rounded
);
g
.
strokePath
(
p
,
pst
);
}
void
ControlPanelButton
::
mouseDown
(
const
MouseEvent
&
e
)
{
open
=
!
open
;
...
...
This diff is collapsed.
Click to expand it.
Source/UI/ControlPanel.h
+
3
−
10
View file @
106333df
...
...
@@ -196,7 +196,7 @@ class Clock : public Component
/** Sets the cumulative recording time to zero.*/
void
resetRecordTime
();
/**
Draw
s the c
urrent time
.*/
/**
Render
s the c
lock
.*/
void
paint
(
Graphics
&
g
);
private:
...
...
@@ -214,7 +214,6 @@ class Clock : public Component
Font
clockFont
;
//FTPixmapFont* font;
};
/**
...
...
@@ -229,7 +228,7 @@ class Clock : public Component
*/
class
ControlPanelButton
:
public
OpenGLCanvas
class
ControlPanelButton
:
public
Component
{
public:
ControlPanelButton
(
ControlPanel
*
cp_
);
...
...
@@ -241,14 +240,8 @@ public:
/** Toggles the open/closed state of the ControlPanelButton.*/
void
toggleState
();
/** Initializes an OpenGL context in which drawing occurs.*/
void
newOpenGLContextCreated
();
/** Draws the button. */
void
renderOpenGL
();
/** Draws the button. */
void
drawButton
();
void
paint
(
Graphics
&
g
);
/** Responds to mouse clicks within the button. */
void
mouseDown
(
const
MouseEvent
&
e
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment