Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
ofxImGui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wt
ofxImGui
Commits
bd655e50
Commit
bd655e50
authored
Dec 07, 2019
by
w4t
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Text helper and no label option to AddText() method
parent
645f3a6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
imHelpers.h
src/imHelpers.h
+18
-0
No files found.
src/imHelpers.h
View file @
bd655e50
...
@@ -149,6 +149,9 @@ namespace ofxImGui
...
@@ -149,6 +149,9 @@ namespace ofxImGui
template
<
typename
ParameterType
>
template
<
typename
ParameterType
>
bool
AddParameter
(
ofParameter
<
ParameterType
>&
parameter
);
bool
AddParameter
(
ofParameter
<
ParameterType
>&
parameter
);
template
<
typename
ParameterType
>
bool
AddText
(
ofParameter
<
ParameterType
>&
parameter
,
bool
label
=
true
);
bool
AddRadio
(
ofParameter
<
int
>&
parameter
,
std
::
vector
<
std
::
string
>
labels
,
int
columns
=
1
);
bool
AddRadio
(
ofParameter
<
int
>&
parameter
,
std
::
vector
<
std
::
string
>
labels
,
int
columns
=
1
);
bool
AddCombo
(
ofParameter
<
int
>&
parameter
,
std
::
vector
<
std
::
string
>
labels
);
bool
AddCombo
(
ofParameter
<
int
>&
parameter
,
std
::
vector
<
std
::
string
>
labels
);
bool
AddStepper
(
ofParameter
<
int
>&
parameter
,
int
step
=
1
,
int
stepFast
=
100
);
bool
AddStepper
(
ofParameter
<
int
>&
parameter
,
int
step
=
1
,
int
stepFast
=
100
);
...
@@ -239,6 +242,21 @@ bool ofxImGui::AddParameter(ofParameter<ParameterType>& parameter)
...
@@ -239,6 +242,21 @@ bool ofxImGui::AddParameter(ofParameter<ParameterType>& parameter)
return
false
;
return
false
;
}
}
//--------------------------------------------------------------
template
<
typename
ParameterType
>
bool
ofxImGui
::
AddText
(
ofParameter
<
ParameterType
>&
parameter
,
bool
label
)
{
if
(
label
)
{
ImGui
::
LabelText
(
parameter
.
getName
().
c_str
(),
ofToString
(
parameter
.
get
()).
c_str
());
}
else
{
ImGui
::
Text
(
ofToString
(
parameter
.
get
()).
c_str
());
}
return
true
;
}
//--------------------------------------------------------------
//--------------------------------------------------------------
template
<
typename
DataType
>
template
<
typename
DataType
>
bool
ofxImGui
::
AddValues
(
const
std
::
string
&
name
,
std
::
vector
<
DataType
>&
values
,
DataType
minValue
,
DataType
maxValue
)
bool
ofxImGui
::
AddValues
(
const
std
::
string
&
name
,
std
::
vector
<
DataType
>&
values
,
DataType
minValue
,
DataType
maxValue
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment