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
183680d7
Commit
183680d7
authored
11 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
replace model chooser by simple menu
parent
9245e3b9
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Fltk/extraDialogs.cpp
+0
-58
0 additions, 58 deletions
Fltk/extraDialogs.cpp
Fltk/extraDialogs.h
+0
-1
0 additions, 1 deletion
Fltk/extraDialogs.h
Fltk/graphicWindow.cpp
+44
-7
44 additions, 7 deletions
Fltk/graphicWindow.cpp
with
44 additions
and
66 deletions
Fltk/extraDialogs.cpp
+
0
−
58
View file @
183680d7
...
@@ -89,64 +89,6 @@ int arrowEditor(const char *title, double &a, double &b, double &c)
...
@@ -89,64 +89,6 @@ int arrowEditor(const char *title, double &a, double &b, double &c)
return
0
;
return
0
;
}
}
// Model chooser
static
void
model_switch_cb
(
Fl_Widget
*
w
,
void
*
data
)
{
Fl_Select_Browser
*
b
=
(
Fl_Select_Browser
*
)
w
;
if
(
b
->
value
()){
GModel
::
current
(
b
->
value
()
-
1
);
SetBoundingBox
();
for
(
unsigned
int
i
=
0
;
i
<
GModel
::
list
.
size
();
i
++
)
GModel
::
list
[
i
]
->
setVisibility
(
0
);
GModel
::
current
()
->
setVisibility
(
1
);
}
if
(
w
->
window
())
w
->
window
()
->
hide
();
CTX
::
instance
()
->
mesh
.
changed
=
ENT_ALL
;
FlGui
::
instance
()
->
setGraphicTitle
(
GModel
::
current
()
->
getFileName
());
FlGui
::
instance
()
->
resetVisibility
();
drawContext
::
global
()
->
draw
();
}
int
modelChooser
()
{
struct
_menu
{
Fl_Menu_Window
*
window
;
Fl_Hold_Browser
*
browser
;
Fl_Check_Button
*
butt
;
};
static
_menu
*
menu
=
0
;
const
int
WW
=
200
;
if
(
!
menu
){
menu
=
new
_menu
;
menu
->
window
=
new
Fl_Menu_Window
(
WW
,
6
*
BH
);
if
(
CTX
::
instance
()
->
nonModalWindows
)
menu
->
window
->
set_non_modal
();
menu
->
window
->
border
(
0
);
Fl_Box
*
l
=
new
Fl_Box
(
0
,
0
,
WW
,
BH
,
"Select active model:"
);
l
->
align
(
FL_ALIGN_LEFT
|
FL_ALIGN_INSIDE
|
FL_ALIGN_CLIP
);
menu
->
browser
=
new
Fl_Hold_Browser
(
0
,
BH
,
WW
,
5
*
BH
);
menu
->
browser
->
callback
(
model_switch_cb
);
menu
->
browser
->
when
(
FL_WHEN_RELEASE_ALWAYS
);
menu
->
window
->
end
();
}
menu
->
window
->
hotspot
(
menu
->
window
);
menu
->
browser
->
clear
();
for
(
unsigned
int
i
=
0
;
i
<
GModel
::
list
.
size
();
i
++
){
char
tmp
[
256
];
sprintf
(
tmp
,
"Model [%d] <<%s>>"
,
i
,
GModel
::
list
[
i
]
->
getName
().
c_str
());
menu
->
browser
->
add
(
tmp
);
if
(
GModel
::
list
[
i
]
==
GModel
::
current
())
menu
->
browser
->
value
(
i
+
1
);
}
if
(
menu
->
window
->
non_modal
()
&&
!
menu
->
window
->
shown
())
menu
->
window
->
show
();
// fix ordering
menu
->
window
->
show
();
return
0
;
}
// Connection and pattern choosers
// Connection and pattern choosers
class
historyBrowser
:
public
Fl_Hold_Browser
{
class
historyBrowser
:
public
Fl_Hold_Browser
{
...
...
This diff is collapsed.
Click to expand it.
Fltk/extraDialogs.h
+
0
−
1
View file @
183680d7
...
@@ -10,7 +10,6 @@
...
@@ -10,7 +10,6 @@
int
arrowEditor
(
const
char
*
title
,
double
&
a
,
double
&
b
,
double
&
c
);
int
arrowEditor
(
const
char
*
title
,
double
&
a
,
double
&
b
,
double
&
c
);
int
modelChooser
();
std
::
string
connectionChooser
();
std
::
string
connectionChooser
();
std
::
string
patternChooser
();
std
::
string
patternChooser
();
...
...
This diff is collapsed.
Click to expand it.
Fltk/graphicWindow.cpp
+
44
−
7
View file @
183680d7
...
@@ -2394,22 +2394,59 @@ void quick_access_cb(Fl_Widget *w, void *data)
...
@@ -2394,22 +2394,59 @@ void quick_access_cb(Fl_Widget *w, void *data)
}
}
}
}
void
status_options
_cb
(
Fl_Widget
*
w
,
void
*
data
)
static
void
model_switch
_cb
(
Fl_Widget
*
w
,
void
*
data
)
{
{
const
char
*
str
=
(
const
char
*
)
data
;
int
index
=
(
intptr_t
)
data
;
if
(
!
strcmp
(
str
,
"model"
)){
// model selection
GModel
::
current
(
index
);
modelChooser
();
SetBoundingBox
();
for
(
unsigned
int
i
=
0
;
i
<
GModel
::
list
.
size
();
i
++
)
GModel
::
list
[
i
]
->
setVisibility
(
0
);
GModel
::
current
()
->
setVisibility
(
1
);
CTX
::
instance
()
->
mesh
.
changed
=
ENT_ALL
;
FlGui
::
instance
()
->
setGraphicTitle
(
GModel
::
current
()
->
getFileName
());
FlGui
::
instance
()
->
resetVisibility
();
drawContext
::
global
()
->
draw
();
}
}
else
if
(
!
strcmp
(
str
,
"?"
)){
// display options
void
status_options_cb
(
Fl_Widget
*
w
,
void
*
data
)
{
if
(
!
data
)
return
;
std
::
string
what
((
const
char
*
)
data
);
if
(
what
==
"model"
){
// model selection
std
::
vector
<
char
*>
tofree
;
std
::
vector
<
Fl_Menu_Item
>
menu
;
int
selected
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
GModel
::
list
.
size
();
i
++
){
char
tmp
[
256
];
sprintf
(
tmp
,
"Model [%d] <<%s>> "
,
i
,
GModel
::
list
[
i
]
->
getName
().
c_str
());
char
*
str
=
strdup
(
tmp
);
Fl_Menu_Item
menuItem
=
{
str
,
0
,
model_switch_cb
,
(
void
*
)
i
,
FL_MENU_RADIO
};
if
(
GModel
::
list
[
i
]
==
GModel
::
current
()){
selected
=
i
;
menuItem
.
flags
|=
FL_MENU_VALUE
;
}
menu
.
push_back
(
menuItem
);
tofree
.
push_back
(
str
);
}
Fl_Menu_Item
it
=
{
0
};
menu
.
push_back
(
it
);
Fl_Menu_Item
*
m
=
(
Fl_Menu_Item
*
)(
&
menu
[
0
])
->
popup
(
Fl
::
event_x
(),
Fl
::
event_y
(),
0
,
&
menu
[
selected
],
0
);
if
(
m
)
m
->
do_callback
(
0
);
for
(
unsigned
int
i
=
0
;
i
<
tofree
.
size
();
i
++
)
free
(
tofree
[
i
]);
drawContext
::
global
()
->
draw
();
}
else
if
(
what
==
"?"
){
// display options
help_options_cb
(
0
,
0
);
help_options_cb
(
0
,
0
);
FlGui
::
instance
()
->
help
->
options
->
show
();
FlGui
::
instance
()
->
help
->
options
->
show
();
}
}
else
if
(
!
strcmp
(
str
,
"p"
)
)
{
// toggle projection mode
else
if
(
what
==
"p"
){
// toggle projection mode
opt_general_orthographic
(
0
,
GMSH_SET
|
GMSH_GUI
,
opt_general_orthographic
(
0
,
GMSH_SET
|
GMSH_GUI
,
!
opt_general_orthographic
(
0
,
GMSH_GET
,
0
));
!
opt_general_orthographic
(
0
,
GMSH_GET
,
0
));
drawContext
::
global
()
->
draw
();
drawContext
::
global
()
->
draw
();
}
}
else
if
(
!
strcmp
(
str
,
"quick_access"
)
)
{
// quick access menu
else
if
(
what
==
"quick_access"
){
// quick access menu
static
Fl_Menu_Item
menu
[]
=
{
static
Fl_Menu_Item
menu
[]
=
{
{
"Axes"
,
0
,
quick_access_cb
,
(
void
*
)
"axes"
,
{
"Axes"
,
0
,
quick_access_cb
,
(
void
*
)
"axes"
,
FL_MENU_TOGGLE
},
FL_MENU_TOGGLE
},
...
@@ -2507,7 +2544,7 @@ void status_options_cb(Fl_Widget *w, void *data)
...
@@ -2507,7 +2544,7 @@ void status_options_cb(Fl_Widget *w, void *data)
if
(
picked
&&
picked
->
callback
())
picked
->
do_callback
(
0
,
picked
->
user_data
());
if
(
picked
&&
picked
->
callback
())
picked
->
do_callback
(
0
,
picked
->
user_data
());
drawContext
::
global
()
->
draw
();
drawContext
::
global
()
->
draw
();
}
}
else
if
(
!
strcmp
(
str
,
"S"
)
)
{
// mouse selection
else
if
(
what
==
"S"
){
// mouse selection
if
(
CTX
::
instance
()
->
mouseSelection
){
if
(
CTX
::
instance
()
->
mouseSelection
){
opt_general_mouse_selection
(
0
,
GMSH_SET
|
GMSH_GUI
,
0
);
opt_general_mouse_selection
(
0
,
GMSH_SET
|
GMSH_GUI
,
0
);
for
(
unsigned
int
i
=
0
;
i
<
FlGui
::
instance
()
->
graph
.
size
();
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
FlGui
::
instance
()
->
graph
.
size
();
i
++
)
...
...
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