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
16d2db36
Commit
16d2db36
authored
Mar 17, 2001
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
fatal error messages + selection cursor
parent
9d3cbd15
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
Fltk/GUI.cpp
+11
-6
11 additions, 6 deletions
Fltk/GUI.cpp
Fltk/GUI.h
+3
-1
3 additions, 1 deletion
Fltk/GUI.h
Fltk/Message.cpp
+5
-2
5 additions, 2 deletions
Fltk/Message.cpp
Fltk/Opengl.cpp
+7
-3
7 additions, 3 deletions
Fltk/Opengl.cpp
Fltk/Opengl_Window.cpp
+6
-2
6 additions, 2 deletions
Fltk/Opengl_Window.cpp
with
32 additions
and
14 deletions
Fltk/GUI.cpp
+
11
−
6
View file @
16d2db36
// $Id: GUI.cpp,v 1.5
7
2001-03-1
0 19:55:06 remacl
e Exp $
// $Id: GUI.cpp,v 1.5
8
2001-03-1
7 21:33:13 geuzain
e Exp $
// To make the interface as visually consistent as possible, please:
// To make the interface as visually consistent as possible, please:
// - use the BH, BW, WB, IW values for button heights/widths, window borders, etc.
// - use the BH, BW, WB, IW values for button heights/widths, window borders, etc.
...
@@ -1656,11 +1656,11 @@ void GUI::add_message(char *msg){
...
@@ -1656,11 +1656,11 @@ void GUI::add_message(char *msg){
msg_browser
->
bottomline
(
msg_browser
->
size
());
msg_browser
->
bottomline
(
msg_browser
->
size
());
}
}
void
GUI
::
save_message
(
char
*
name
){
void
GUI
::
save_message
(
char
*
file
name
){
FILE
*
fp
;
FILE
*
fp
;
if
(
!
(
fp
=
fopen
(
name
,
"w"
)))
{
if
(
!
(
fp
=
fopen
(
file
name
,
"w"
)))
{
Msg
(
WARNING
,
"Unable to Open File '%s'"
,
name
);
Msg
(
WARNING
,
"Unable to Open File '%s'"
,
file
name
);
return
;
return
;
}
}
for
(
int
i
=
1
;
i
<=
msg_browser
->
size
()
;
i
++
){
for
(
int
i
=
1
;
i
<=
msg_browser
->
size
()
;
i
++
){
...
@@ -1669,11 +1669,16 @@ void GUI::save_message(char *name){
...
@@ -1669,11 +1669,16 @@ void GUI::save_message(char *name){
else
fprintf
(
fp
,
"%s
\n
"
,
c
);
else
fprintf
(
fp
,
"%s
\n
"
,
c
);
}
}
Msg
(
INFO
,
"Log Creation Complete '%s'"
,
name
);
Msg
(
INFO
,
"Log Creation Complete '%s'"
,
file
name
);
Msg
(
STATUS2
,
"Wrote '%s'"
,
name
);
Msg
(
STATUS2
,
"Wrote '%s'"
,
file
name
);
fclose
(
fp
);
fclose
(
fp
);
}
}
void
GUI
::
fatal_error
(
char
*
filename
){
fl_alert
(
"A fatal error has occurred, which will force Gmsh to exit "
"(all messages have been saved in the error log file '%s')"
,
filename
);
}
//******************************* Create the about window ******************************
//******************************* Create the about window ******************************
void
GUI
::
create_about_window
(){
void
GUI
::
create_about_window
(){
...
...
This diff is collapsed.
Click to expand it.
Fltk/GUI.h
+
3
−
1
View file @
16d2db36
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include
<FL/Fl_Browser.H>
#include
<FL/Fl_Browser.H>
#include
<FL/x.H>
#include
<FL/x.H>
#include
<FL/Fl_Color_Chooser.H>
#include
<FL/Fl_Color_Chooser.H>
#include
<FL/fl_ask.H>
#include
"Opengl_Window.h"
#include
"Opengl_Window.h"
#include
"Colorbar_Window.h"
#include
"Colorbar_Window.h"
...
@@ -202,12 +203,13 @@ public:
...
@@ -202,12 +203,13 @@ public:
void
set_status
(
char
*
msg
,
int
num
);
void
set_status
(
char
*
msg
,
int
num
);
void
add_message
(
char
*
msg
);
void
add_message
(
char
*
msg
);
void
save_message
(
char
*
filename
);
void
save_message
(
char
*
filename
);
void
fatal_error
(
char
*
filename
);
void
set_statistics
();
void
set_statistics
();
void
update_view_window
(
int
numview
);
void
update_view_window
(
int
numview
);
void
set_title
(
char
*
str
);
void
set_title
(
char
*
str
);
void
add_handler
();
void
add_handler
();
int
global_shortcuts
(
int
event
);
int
global_shortcuts
(
int
event
);
int
try_selection
,
quit_selection
,
end_selection
;
int
selection
,
try_selection
,
quit_selection
,
end_selection
;
};
};
...
...
This diff is collapsed.
Click to expand it.
Fltk/Message.cpp
+
5
−
2
View file @
16d2db36
// $Id: Message.cpp,v 1.1
5
2001-0
2-23 08:18:50
geuzaine Exp $
// $Id: Message.cpp,v 1.1
6
2001-0
3-17 21:33:13
geuzaine Exp $
#include
<signal.h>
#include
<signal.h>
#if !defined(WIN32) || defined(__CYGWIN__)
#if !defined(WIN32) || defined(__CYGWIN__)
...
@@ -129,7 +129,10 @@ void Msg(int level, char *fmt, ...){
...
@@ -129,7 +129,10 @@ void Msg(int level, char *fmt, ...){
}
}
if
(
abort
){
if
(
abort
){
if
(
WID
)
WID
->
save_message
(
CTX
.
error_filename
);
if
(
WID
){
WID
->
save_message
(
CTX
.
error_filename
);
WID
->
fatal_error
(
CTX
.
error_filename
);
}
Exit
(
1
);
Exit
(
1
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Fltk/Opengl.cpp
+
7
−
3
View file @
16d2db36
// $Id: Opengl.cpp,v 1.1
8
2001-0
2-04 15:52:26
geuzaine Exp $
// $Id: Opengl.cpp,v 1.1
9
2001-0
3-17 21:33:13
geuzaine Exp $
#include
"Gmsh.h"
#include
"Gmsh.h"
#include
"GmshUI.h"
#include
"GmshUI.h"
...
@@ -107,6 +107,7 @@ int SelectEntity(int type, Vertex **v, Curve **c, Surface **s){
...
@@ -107,6 +107,7 @@ int SelectEntity(int type, Vertex **v, Curve **c, Surface **s){
*
v
=
NULL
;
*
c
=
NULL
;
*
s
=
NULL
;
*
v
=
NULL
;
*
c
=
NULL
;
*
s
=
NULL
;
WID
->
selection
=
type
;
WID
->
try_selection
=
0
;
WID
->
try_selection
=
0
;
WID
->
quit_selection
=
0
;
WID
->
quit_selection
=
0
;
WID
->
end_selection
=
0
;
WID
->
end_selection
=
0
;
...
@@ -115,10 +116,12 @@ int SelectEntity(int type, Vertex **v, Curve **c, Surface **s){
...
@@ -115,10 +116,12 @@ int SelectEntity(int type, Vertex **v, Curve **c, Surface **s){
WID
->
wait
();
WID
->
wait
();
if
(
WID
->
quit_selection
){
if
(
WID
->
quit_selection
){
WID
->
quit_selection
=
0
;
WID
->
quit_selection
=
0
;
WID
->
selection
=
0
;
return
0
;
return
0
;
}
}
if
(
WID
->
end_selection
){
if
(
WID
->
end_selection
){
WID
->
end_selection
=
0
;
WID
->
end_selection
=
0
;
WID
->
selection
=
0
;
return
-
1
;
return
-
1
;
}
}
if
(
WID
->
try_selection
){
if
(
WID
->
try_selection
){
...
@@ -129,6 +132,7 @@ int SelectEntity(int type, Vertex **v, Curve **c, Surface **s){
...
@@ -129,6 +132,7 @@ int SelectEntity(int type, Vertex **v, Curve **c, Surface **s){
BeginHighlight
();
BeginHighlight
();
HighlightEntity
(
*
v
,
*
c
,
*
s
,
1
);
HighlightEntity
(
*
v
,
*
c
,
*
s
,
1
);
EndHighlight
(
1
);
EndHighlight
(
1
);
WID
->
selection
=
0
;
return
(
1
);
return
(
1
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Fltk/Opengl_Window.cpp
+
6
−
2
View file @
16d2db36
// $Id: Opengl_Window.cpp,v 1.1
3
2001-0
2-05 07:56:57
geuzaine Exp $
// $Id: Opengl_Window.cpp,v 1.1
4
2001-0
3-17 21:33:13
geuzaine Exp $
#include
"Gmsh.h"
#include
"Gmsh.h"
#include
"GmshUI.h"
#include
"GmshUI.h"
...
@@ -21,6 +21,7 @@ void Filter_SelectionBuffer(int n, GLuint *typ, GLuint *ient, Vertex **thev,
...
@@ -21,6 +21,7 @@ void Filter_SelectionBuffer(int n, GLuint *typ, GLuint *ient, Vertex **thev,
Curve
**
thec
,
Surface
**
thes
,
Mesh
*
m
);
Curve
**
thec
,
Surface
**
thes
,
Mesh
*
m
);
void
myZoom
(
GLdouble
X1
,
GLdouble
X2
,
GLdouble
Y1
,
GLdouble
Y2
,
void
myZoom
(
GLdouble
X1
,
GLdouble
X2
,
GLdouble
Y1
,
GLdouble
Y2
,
GLdouble
Xc1
,
GLdouble
Xc2
,
GLdouble
Yc1
,
GLdouble
Yc2
);
GLdouble
Xc1
,
GLdouble
Xc2
,
GLdouble
Yc1
,
GLdouble
Yc2
);
int
check_type
(
int
type
,
Vertex
*
v
,
Curve
*
c
,
Surface
*
s
);
static
int
ZOOM
=
0
;
static
int
ZOOM
=
0
;
static
double
ZOOM_X0
,
ZOOM_Y0
,
ZOOM_X1
,
ZOOM_Y1
;
static
double
ZOOM_X0
,
ZOOM_Y0
,
ZOOM_X1
,
ZOOM_Y1
;
...
@@ -262,8 +263,11 @@ int Opengl_Window::handle(int event) {
...
@@ -262,8 +263,11 @@ int Opengl_Window::handle(int event) {
Process_SelectionBuffer
(
Fl
::
event_x
(),
Fl
::
event_y
(),
&
hits
,
ii
,
jj
);
Process_SelectionBuffer
(
Fl
::
event_x
(),
Fl
::
event_y
(),
&
hits
,
ii
,
jj
);
ov
=
v
;
oc
=
c
;
os
=
s
;
v
=
NULL
;
c
=
NULL
;
s
=
NULL
;
ov
=
v
;
oc
=
c
;
os
=
s
;
v
=
NULL
;
c
=
NULL
;
s
=
NULL
;
Filter_SelectionBuffer
(
hits
,
ii
,
jj
,
&
v
,
&
c
,
&
s
,
&
M
);
Filter_SelectionBuffer
(
hits
,
ii
,
jj
,
&
v
,
&
c
,
&
s
,
&
M
);
if
(
ov
!=
v
||
oc
!=
c
||
os
!=
s
)
{
if
(
ov
!=
v
||
oc
!=
c
||
os
!=
s
)
{
if
(
check_type
(
WID
->
selection
,
v
,
c
,
s
))
WID
->
g_window
->
cursor
(
FL_CURSOR_CROSS
,
FL_BLACK
,
FL_WHITE
);
else
WID
->
g_window
->
cursor
(
FL_CURSOR_DEFAULT
,
FL_BLACK
,
FL_WHITE
);
BeginHighlight
();
BeginHighlight
();
HighlightEntity
(
v
,
c
,
s
,
0
);
HighlightEntity
(
v
,
c
,
s
,
0
);
EndHighlight
(
0
);
EndHighlight
(
0
);
...
...
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