Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
e34b7a51
Commit
e34b7a51
authored
13 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
onelab
parent
5fd0dc0a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Common/onelab.h
+3
-4
3 additions, 4 deletions
Common/onelab.h
Fltk/graphicWindow.cpp
+9
-7
9 additions, 7 deletions
Fltk/graphicWindow.cpp
Fltk/onelabWindow.cpp
+23
-2
23 additions, 2 deletions
Fltk/onelabWindow.cpp
with
35 additions
and
13 deletions
Common/onelab.h
+
3
−
4
View file @
e34b7a51
...
@@ -38,10 +38,9 @@ namespace onelab{
...
@@ -38,10 +38,9 @@ namespace onelab{
// The base parameter class.
// The base parameter class.
class
parameter
{
class
parameter
{
private:
private:
// the name of the parameter, including its "path" in the
// the name of the parameter, including its '/'-separated path in
// parameter hierarchy. The path separator '/' can be followed by
// the parameter hierarchy. Parameters or subpaths can start with
// a number to force ordering (hence a parameter name cannot start
// numbers to force their relative ordering.
// with a number).
std
::
string
_name
;
std
::
string
_name
;
// optional help strings
// optional help strings
std
::
string
_shortHelp
,
_help
;
std
::
string
_shortHelp
,
_help
;
...
...
This diff is collapsed.
Click to expand it.
Fltk/graphicWindow.cpp
+
9
−
7
View file @
e34b7a51
...
@@ -772,13 +772,15 @@ void graphicWindow::resizeMessages(int dh)
...
@@ -772,13 +772,15 @@ void graphicWindow::resizeMessages(int dh)
void
graphicWindow
::
showMessages
()
void
graphicWindow
::
showMessages
()
{
{
int
height
=
_savedMessageHeight
;
if
(
!
win
->
shown
())
return
;
if
(
height
<
10
)
height
=
100
;
if
(
browser
->
h
()
<
10
){
int
maxh
=
win
->
h
()
-
bottom
->
h
();
int
height
=
_savedMessageHeight
;
if
(
height
>
maxh
)
height
=
maxh
/
2
;
if
(
height
<
1
)
height
=
100
;
resizeMessages
(
height
-
browser
->
h
());
int
maxh
=
win
->
h
()
-
bottom
->
h
();
if
(
browser
->
h
())
if
(
height
>
maxh
)
height
=
maxh
/
2
;
browser
->
bottomline
(
browser
->
size
());
resizeMessages
(
height
-
browser
->
h
());
}
browser
->
bottomline
(
browser
->
size
());
}
}
void
graphicWindow
::
hideMessages
()
void
graphicWindow
::
hideMessages
()
...
...
This diff is collapsed.
Click to expand it.
Fltk/onelabWindow.cpp
+
23
−
2
View file @
e34b7a51
...
@@ -340,16 +340,22 @@ onelabWindow::onelabWindow(int deltaFontSize)
...
@@ -340,16 +340,22 @@ onelabWindow::onelabWindow(int deltaFontSize)
static
std
::
string
getShortName
(
const
std
::
string
&
name
)
static
std
::
string
getShortName
(
const
std
::
string
&
name
)
{
{
std
::
string
s
=
name
;
// remove path
std
::
string
::
size_type
last
=
name
.
find_last_of
(
'/'
);
std
::
string
::
size_type
last
=
name
.
find_last_of
(
'/'
);
if
(
last
!=
std
::
string
::
npos
)
if
(
last
!=
std
::
string
::
npos
)
return
name
.
substr
(
last
+
1
);
s
=
name
.
substr
(
last
+
1
);
return
name
;
// remove starting numbers
while
(
s
.
size
()
&&
s
[
0
]
>=
'0'
&&
s
[
0
]
<=
'9'
)
s
=
s
.
substr
(
1
);
return
s
;
}
}
void
onelabWindow
::
rebuildTree
()
void
onelabWindow
::
rebuildTree
()
{
{
_tree
->
clear
();
_tree
->
clear
();
_tree
->
sortorder
(
FL_TREE_SORT_ASCENDING
);
_tree
->
sortorder
(
FL_TREE_SORT_ASCENDING
);
_tree
->
selectmode
(
FL_TREE_SELECT_NONE
);
for
(
unsigned
int
i
=
0
;
i
<
_treeWidgets
.
size
();
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
_treeWidgets
.
size
();
i
++
)
Fl
::
delete_widget
(
_treeWidgets
[
i
]);
Fl
::
delete_widget
(
_treeWidgets
[
i
]);
_treeWidgets
.
clear
();
_treeWidgets
.
clear
();
...
@@ -358,6 +364,7 @@ void onelabWindow::rebuildTree()
...
@@ -358,6 +364,7 @@ void onelabWindow::rebuildTree()
onelab
::
server
::
instance
()
->
get
(
numbers
);
onelab
::
server
::
instance
()
->
get
(
numbers
);
for
(
unsigned
int
i
=
0
;
i
<
numbers
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
numbers
.
size
();
i
++
){
Fl_Tree_Item
*
n
=
_tree
->
add
(
numbers
[
i
].
getName
().
c_str
());
Fl_Tree_Item
*
n
=
_tree
->
add
(
numbers
[
i
].
getName
().
c_str
());
n
->
labelsize
(
FL_NORMAL_SIZE
+
2
);
std
::
string
label
=
numbers
[
i
].
getShortHelp
();
std
::
string
label
=
numbers
[
i
].
getShortHelp
();
if
(
label
.
empty
())
label
=
getShortName
(
numbers
[
i
].
getName
());
if
(
label
.
empty
())
label
=
getShortName
(
numbers
[
i
].
getName
());
_tree
->
begin
();
_tree
->
begin
();
...
@@ -393,6 +400,7 @@ void onelabWindow::rebuildTree()
...
@@ -393,6 +400,7 @@ void onelabWindow::rebuildTree()
onelab
::
server
::
instance
()
->
get
(
strings
);
onelab
::
server
::
instance
()
->
get
(
strings
);
for
(
unsigned
int
i
=
0
;
i
<
strings
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
strings
.
size
();
i
++
){
Fl_Tree_Item
*
n
=
_tree
->
add
(
strings
[
i
].
getName
().
c_str
());
Fl_Tree_Item
*
n
=
_tree
->
add
(
strings
[
i
].
getName
().
c_str
());
n
->
labelsize
(
FL_NORMAL_SIZE
+
2
);
std
::
string
label
=
strings
[
i
].
getShortHelp
();
std
::
string
label
=
strings
[
i
].
getShortHelp
();
if
(
label
.
empty
())
label
=
getShortName
(
strings
[
i
].
getName
());
if
(
label
.
empty
())
label
=
getShortName
(
strings
[
i
].
getName
());
_tree
->
begin
();
_tree
->
begin
();
...
@@ -408,8 +416,21 @@ void onelabWindow::rebuildTree()
...
@@ -408,8 +416,21 @@ void onelabWindow::rebuildTree()
n
->
widget
(
but
);
n
->
widget
(
but
);
_tree
->
end
();
_tree
->
end
();
}
}
for
(
Fl_Tree_Item
*
n
=
_tree
->
first
();
n
;
n
=
n
->
next
()){
if
(
n
->
has_children
()){
_tree
->
begin
();
Fl_Box
*
but
=
new
Fl_Box
(
1
,
1
,
IW
,
1
);
but
->
align
(
FL_ALIGN_LEFT
|
FL_ALIGN_INSIDE
);
_treeWidgets
.
push_back
(
but
);
but
->
copy_label
(
getShortName
(
n
->
label
()).
c_str
());
n
->
widget
(
but
);
_tree
->
end
();
}
}
_tree
->
redraw
();
_tree
->
redraw
();
}
}
#endif
#endif
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