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
c3a3579c
Commit
c3a3579c
authored
11 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
New PGF file format contributed by Sebastian Eiser
parent
94c8183f
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
Fltk/fileDialogs.cpp
+81
-0
81 additions, 0 deletions
Fltk/fileDialogs.cpp
Fltk/fileDialogs.h
+1
-0
1 addition, 0 deletions
Fltk/fileDialogs.h
with
82 additions
and
0 deletions
Fltk/fileDialogs.cpp
+
81
−
0
View file @
c3a3579c
...
...
@@ -5,6 +5,7 @@
//
// Contributor(s):
// Stephen Guzik
// Sebastian Eiser
//
#include
<limits>
...
...
@@ -312,6 +313,86 @@ int genericBitmapFileDialog(const char *name, const char *title, int format)
return
0
;
}
// pgf dialog
int
pgfBitmapFileDialog
(
const
char
*
name
,
const
char
*
title
,
int
format
)
{
struct
_pgfBitmapFileDialog
{
Fl_Window
*
window
;
Fl_Value_Slider
*
s
[
2
];
Fl_Check_Button
*
b
[
3
];
Fl_Value_Input
*
v
[
2
];
Fl_Button
*
ok
,
*
cancel
;
};
static
_pgfBitmapFileDialog
*
dialog
=
NULL
;
if
(
!
dialog
){
dialog
=
new
_pgfBitmapFileDialog
;
int
h
=
3
*
WB
+
5
*
BH
,
w
=
2
*
BB
+
3
*
WB
,
y
=
WB
;
dialog
->
window
=
new
Fl_Double_Window
(
w
,
h
);
dialog
->
window
->
box
(
GMSH_WINDOW_BOX
);
dialog
->
window
->
set_modal
();
dialog
->
b
[
0
]
=
new
Fl_Check_Button
(
WB
,
y
,
2
*
BB
+
WB
,
BH
,
"Flat graphics"
);
y
+=
BH
;
dialog
->
b
[
0
]
->
type
(
FL_TOGGLE_BUTTON
);
dialog
->
b
[
1
]
=
new
Fl_Check_Button
(
WB
,
y
,
2
*
BB
+
WB
,
BH
,
"Export axis (for entire fig)"
);
y
+=
BH
;
dialog
->
b
[
1
]
->
type
(
FL_TOGGLE_BUTTON
);
dialog
->
b
[
2
]
=
new
Fl_Check_Button
(
WB
,
y
,
2
*
BB
+
WB
,
BH
,
"Horizontal colorbar"
);
y
+=
BH
;
dialog
->
b
[
2
]
->
type
(
FL_TOGGLE_BUTTON
);
dialog
->
v
[
0
]
=
new
Fl_Value_Input
(
WB
,
y
,
BB
/
2
,
BH
);
dialog
->
v
[
0
]
->
minimum
(
-
1
);
dialog
->
v
[
0
]
->
maximum
(
5000
);
dialog
->
v
[
0
]
->
step
(
1
);
dialog
->
v
[
1
]
=
new
Fl_Value_Input
(
WB
+
BB
/
2
,
y
,
BB
-
BB
/
2
,
BH
,
"Dimensions"
);
y
+=
BH
;
dialog
->
v
[
1
]
->
minimum
(
-
1
);
dialog
->
v
[
1
]
->
maximum
(
5000
);
dialog
->
v
[
1
]
->
step
(
1
);
dialog
->
v
[
1
]
->
align
(
FL_ALIGN_RIGHT
);
dialog
->
ok
=
new
Fl_Return_Button
(
WB
,
y
+
WB
,
BB
,
BH
,
"OK"
);
dialog
->
cancel
=
new
Fl_Button
(
2
*
WB
+
BB
,
y
+
WB
,
BB
,
BH
,
"Cancel"
);
dialog
->
window
->
end
();
dialog
->
window
->
hotspot
(
dialog
->
window
);
}
dialog
->
window
->
label
(
title
);
dialog
->
b
[
0
]
->
value
(
CTX
::
instance
()
->
print
.
pgfTwoDim
);
dialog
->
b
[
1
]
->
value
(
CTX
::
instance
()
->
print
.
pgfExportAxis
);
dialog
->
b
[
2
]
->
value
(
CTX
::
instance
()
->
print
.
pgfHorizBar
);
dialog
->
v
[
0
]
->
value
(
CTX
::
instance
()
->
print
.
width
);
dialog
->
v
[
1
]
->
value
(
CTX
::
instance
()
->
print
.
height
);
dialog
->
window
->
show
();
while
(
dialog
->
window
->
shown
()){
Fl
::
wait
();
for
(;;)
{
Fl_Widget
*
o
=
Fl
::
readqueue
();
if
(
!
o
)
break
;
if
(
o
==
dialog
->
ok
)
{
opt_print_text
(
0
,
GMSH_SET
|
GMSH_GUI
,
0
);
// never print any text
opt_print_pgf_two_dim
(
0
,
GMSH_SET
|
GMSH_GUI
,
(
int
)
dialog
->
b
[
0
]
->
value
());
opt_print_background
(
0
,
GMSH_SET
|
GMSH_GUI
,
0
);
// never print background
opt_print_pgf_export_axis
(
0
,
GMSH_SET
|
GMSH_GUI
,
(
int
)
dialog
->
b
[
1
]
->
value
());
opt_print_pgf_horiz_bar
(
0
,
GMSH_SET
|
GMSH_GUI
,
(
int
)
dialog
->
b
[
2
]
->
value
());
opt_print_composite_windows
(
0
,
GMSH_SET
|
GMSH_GUI
,
0
);
// never do compositing print
opt_print_width
(
0
,
GMSH_SET
|
GMSH_GUI
,
(
int
)
dialog
->
v
[
0
]
->
value
());
opt_print_height
(
0
,
GMSH_SET
|
GMSH_GUI
,
(
int
)
dialog
->
v
[
1
]
->
value
());
CreateOutputFile
(
name
,
format
);
dialog
->
window
->
hide
();
return
1
;
}
if
(
o
==
dialog
->
window
||
o
==
dialog
->
cancel
){
dialog
->
window
->
hide
();
return
0
;
}
}
}
return
0
;
}
// TeX dialog
int
latexFileDialog
(
const
char
*
name
)
...
...
This diff is collapsed.
Click to expand it.
Fltk/fileDialogs.h
+
1
−
0
View file @
c3a3579c
...
...
@@ -25,6 +25,7 @@ int mpegFileDialog(const char *filename);
int
gifFileDialog
(
const
char
*
filename
);
int
geoFileDialog
(
const
char
*
filename
);
int
genericBitmapFileDialog
(
const
char
*
filename
,
const
char
*
title
,
int
format
);
int
pgfBitmapFileDialog
(
const
char
*
filename
,
const
char
*
title
,
int
format
);
int
genericMeshFileDialog
(
const
char
*
filename
,
const
char
*
title
,
int
format
,
bool
binary_support
,
bool
element_tag_support
);
int
posFileDialog
(
const
char
*
name
);
...
...
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