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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
4e927588
Commit
4e927588
authored
Jun 22, 2015
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
visibility by group
parent
9799d523
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Fltk/onelabGroup.cpp
+31
-5
31 additions, 5 deletions
Fltk/onelabGroup.cpp
Fltk/viewButton.cpp
+3
-4
3 additions, 4 deletions
Fltk/viewButton.cpp
with
34 additions
and
9 deletions
Fltk/onelabGroup.cpp
+
31
−
5
View file @
4e927588
...
@@ -400,7 +400,8 @@ static void onelab_subtree_cb(Fl_Widget *w, void *data)
...
@@ -400,7 +400,8 @@ static void onelab_subtree_cb(Fl_Widget *w, void *data)
void
onelabGroup
::
_computeWidths
()
void
onelabGroup
::
_computeWidths
()
{
{
_baseWidth
=
_tree
->
w
()
-
_tree
->
marginleft
();
// "-FL_NORMAL_SIZE" to have space for a scrollbar to the right
_baseWidth
=
_tree
->
w
()
-
_tree
->
marginleft
()
-
FL_NORMAL_SIZE
;
// not sure why we have the "-2" correction at the end, but this is what is
// not sure why we have the "-2" correction at the end, but this is what is
// needed to make things pixel-correct.
// needed to make things pixel-correct.
_indent
=
_tree
->
connectorwidth
()
/
2.
+
_tree
->
openicon
()
->
w
()
/
2.
-
2.
;
_indent
=
_tree
->
connectorwidth
()
/
2.
+
_tree
->
openicon
()
->
w
()
/
2.
-
2.
;
...
@@ -557,7 +558,6 @@ void onelabGroup::_addParameter(T &p)
...
@@ -557,7 +558,6 @@ void onelabGroup::_addParameter(T &p)
void
onelabGroup
::
_addMenu
(
const
std
::
string
&
path
,
Fl_Callback
*
callback
,
void
*
data
)
void
onelabGroup
::
_addMenu
(
const
std
::
string
&
path
,
Fl_Callback
*
callback
,
void
*
data
)
{
{
Fl_Tree_Item
*
n
=
_tree
->
add
(
path
.
c_str
());
Fl_Tree_Item
*
n
=
_tree
->
add
(
path
.
c_str
());
//n->labelsize(FL_NORMAL_SIZE + 4);
_tree
->
begin
();
_tree
->
begin
();
int
ww
=
(
int
)(
_baseWidth
-
(
n
->
depth
()
+
1
)
*
_indent
);
int
ww
=
(
int
)(
_baseWidth
-
(
n
->
depth
()
+
1
)
*
_indent
);
int
hh
=
n
->
labelsize
()
+
4
;
int
hh
=
n
->
labelsize
()
+
4
;
...
@@ -1030,6 +1030,20 @@ static void onelab_region_input_cb(Fl_Widget *w, void *data)
...
@@ -1030,6 +1030,20 @@ static void onelab_region_input_cb(Fl_Widget *w, void *data)
}
}
}
}
static
void
view_group_cb
(
Fl_Widget
*
w
,
void
*
data
)
{
if
(
!
data
)
return
;
std
::
string
group
((
char
*
)
data
);
if
(
group
.
front
()
==
'/'
)
group
=
group
.
substr
(
1
);
if
(
group
.
back
()
==
'/'
)
group
.
pop_back
();
for
(
unsigned
int
i
=
0
;
i
<
PView
::
list
.
size
();
i
++
){
PViewOptions
*
opt
=
PView
::
list
[
i
]
->
getOptions
();
if
(
opt
->
group
.
find
(
group
)
==
0
)
opt_view_visible
(
i
,
GMSH_SET
|
GMSH_GUI
,
!
opt
->
visible
);
}
drawContext
::
global
()
->
draw
();
}
Fl_Widget
*
onelabGroup
::
_addParameterWidget
(
onelab
::
region
&
p
,
int
ww
,
int
hh
,
Fl_Widget
*
onelabGroup
::
_addParameterWidget
(
onelab
::
region
&
p
,
int
ww
,
int
hh
,
Fl_Tree_Item
*
n
,
bool
highlight
,
Fl_Color
c
)
Fl_Tree_Item
*
n
,
bool
highlight
,
Fl_Color
c
)
{
{
...
@@ -1160,17 +1174,29 @@ void onelabGroup::rebuildTree(bool deleteWidgets)
...
@@ -1160,17 +1174,29 @@ void onelabGroup::rebuildTree(bool deleteWidgets)
int
ww
=
(
int
)(
_baseWidth
-
(
n
->
depth
()
+
1
)
*
_indent
);
int
ww
=
(
int
)(
_baseWidth
-
(
n
->
depth
()
+
1
)
*
_indent
);
int
hh
=
n
->
labelsize
()
+
4
;
int
hh
=
n
->
labelsize
()
+
4
;
_tree
->
begin
();
_tree
->
begin
();
Fl_Widget
*
but
;
#if 0 // FIXME this can crash FLTK when submenus are intially closed (somehow
#if 0 // FIXME this can crash FLTK when submenus are intially closed (somehow
// the widget is badly positioned and overlaps the open icon, leading to
// the widget is badly positioned and overlaps the open icon, leading to
// a corrupted Fl_Tree_Item)
// a corrupted Fl_Tree_Item)
Fl_Button *
but = new Fl_Button(1, 1, ww, hh);
but = new Fl_Button(1, 1, ww, hh);
but->box(FL_NO_BOX);
but->box(FL_NO_BOX);
but->clear_visible_focus();
but->clear_visible_focus();
but->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
but->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
but->callback(onelab_subtree_cb, (void*)n);
but->callback(onelab_subtree_cb, (void*)n);
#else
#else
Fl_Box
*
but
=
new
Fl_Box
(
1
,
1
,
ww
,
hh
);
if
(
getPath
(
n
).
find
(
"0Modules/Post-processing"
)
!=
std
::
string
::
npos
){
but
=
new
Fl_Button
(
1
,
1
,
ww
,
hh
);
but
->
box
(
FL_NO_BOX
);
but
->
align
(
FL_ALIGN_LEFT
|
FL_ALIGN_INSIDE
);
but
->
tooltip
(
"Toggle visibility of child views"
);
char
*
group
=
strdup
(
getPath
(
n
).
substr
(
24
).
c_str
());
_treeStrings
.
push_back
(
group
);
but
->
callback
(
view_group_cb
,
(
void
*
)
group
);
}
else
{
but
=
new
Fl_Box
(
1
,
1
,
ww
,
hh
);
but
->
align
(
FL_ALIGN_LEFT
|
FL_ALIGN_INSIDE
);
but
->
align
(
FL_ALIGN_LEFT
|
FL_ALIGN_INSIDE
);
}
#endif
#endif
_treeWidgets
.
push_back
(
but
);
_treeWidgets
.
push_back
(
but
);
onelab
::
string
o
(
n
->
label
());
onelab
::
string
o
(
n
->
label
());
...
...
This diff is collapsed.
Click to expand it.
Fltk/viewButton.cpp
+
3
−
4
View file @
4e927588
...
@@ -268,8 +268,7 @@ viewButton::viewButton(int x, int y, int w, int h, int num, Fl_Color col)
...
@@ -268,8 +268,7 @@ viewButton::viewButton(int x, int y, int w, int h, int num, Fl_Color col)
PViewData
*
data
=
view
->
getData
();
PViewData
*
data
=
view
->
getData
();
PViewOptions
*
opt
=
view
->
getOptions
();
PViewOptions
*
opt
=
view
->
getOptions
();
int
ws
=
FL_NORMAL_SIZE
-
2
;
// right margin to allow for scrollbar
_toggle
=
new
Fl_Check_Button
(
x
,
y
,
w
-
popw
,
h
);
_toggle
=
new
Fl_Check_Button
(
x
,
y
,
w
-
popw
-
ws
,
h
);
_toggle
->
box
(
FL_FLAT_BOX
);
_toggle
->
box
(
FL_FLAT_BOX
);
_toggle
->
color
(
col
);
_toggle
->
color
(
col
);
_toggle
->
callback
(
view_toggle_cb
,
(
void
*
)
num
);
_toggle
->
callback
(
view_toggle_cb
,
(
void
*
)
num
);
...
@@ -281,13 +280,13 @@ viewButton::viewButton(int x, int y, int w, int h, int num, Fl_Color col)
...
@@ -281,13 +280,13 @@ viewButton::viewButton(int x, int y, int w, int h, int num, Fl_Color col)
strcpy
(
_tooltip
,
data
->
getFileName
().
c_str
());
strcpy
(
_tooltip
,
data
->
getFileName
().
c_str
());
_toggle
->
tooltip
(
_tooltip
);
_toggle
->
tooltip
(
_tooltip
);
_butt
=
new
Fl_Button
(
x
+
w
-
popw
-
ws
,
y
,
popw
,
h
,
"@>"
);
_butt
=
new
Fl_Button
(
x
+
w
-
popw
,
y
,
popw
,
h
,
"@>"
);
_butt
->
align
(
FL_ALIGN_RIGHT
|
FL_ALIGN_INSIDE
|
FL_ALIGN_CLIP
);
_butt
->
align
(
FL_ALIGN_RIGHT
|
FL_ALIGN_INSIDE
|
FL_ALIGN_CLIP
);
_butt
->
tooltip
(
"Show view options (Shift+w)"
);
_butt
->
tooltip
(
"Show view options (Shift+w)"
);
_butt
->
box
(
FL_FLAT_BOX
);
_butt
->
box
(
FL_FLAT_BOX
);
_butt
->
color
(
col
);
_butt
->
color
(
col
);
_butt
->
selection_color
(
col
);
_butt
->
selection_color
(
col
);
_popup
=
new
Fl_Menu_Button
(
x
+
w
-
popw
-
ws
,
y
,
popw
,
h
);
_popup
=
new
Fl_Menu_Button
(
x
+
w
-
popw
,
y
,
popw
,
h
);
_popup
->
type
(
Fl_Menu_Button
::
POPUP123
);
_popup
->
type
(
Fl_Menu_Button
::
POPUP123
);
_popup
->
add
(
"Options"
,
'o'
,
_popup
->
add
(
"Options"
,
'o'
,
...
...
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