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
03909a7a
Commit
03909a7a
authored
16 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
more refinements to partion stuff
parent
867f98c8
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Common/Message.cpp
+4
-28
4 additions, 28 deletions
Common/Message.cpp
Fltk/GUI_Extras.cpp
+6
-7
6 additions, 7 deletions
Fltk/GUI_Extras.cpp
contrib/Chaco/Makefile
+1
-1
1 addition, 1 deletion
contrib/Chaco/Makefile
contrib/Chaco/main/Gmsh_printf.cpp
+20
-2
20 additions, 2 deletions
contrib/Chaco/main/Gmsh_printf.cpp
with
31 additions
and
38 deletions
Common/Message.cpp
+
4
−
28
View file @
03909a7a
...
@@ -270,36 +270,12 @@ void Message::Direct(int level, const char *fmt, ...)
...
@@ -270,36 +270,12 @@ void Message::Direct(int level, const char *fmt, ...)
#if defined(HAVE_FLTK)
#if defined(HAVE_FLTK)
if
(
WID
){
if
(
WID
){
WID
->
check
();
WID
->
check
();
const
char
*
const
last
=
str
+
std
::
max
(
0u
,
std
::
strlen
(
str
)
-
1
);
std
::
string
tmp
;
char
_buf
[
1029
];
if
(
level
<
3
)
if
(
level
<
3
)
std
::
str
cpy
(
_buf
,
"@C1@."
);
tmp
=
std
::
str
ing
(
"@C1@."
)
+
str
;
else
else
std
::
strcpy
(
_buf
,
"@C4@."
);
tmp
=
std
::
string
(
"@C4@."
)
+
str
;
char
*
const
buf
=
_buf
+
5
;
WID
->
add_message
(
tmp
.
c_str
());
char
*
p
=
std
::
strtok
(
str
,
"
\n
"
);
if
(
p
)
{
// If more than 1 leading '\n', print a blank line
if
(
p
-
str
>
1
)
{
buf
[
0
]
=
' '
;
buf
[
1
]
=
'\0'
;
WID
->
add_message
(
_buf
);
}
std
::
strcpy
(
buf
,
p
);
WID
->
add_message
(
_buf
);
// New line for each interior '\n'
while
(
p
=
std
::
strtok
(
NULL
,
"
\n
"
))
{
std
::
strcpy
(
buf
,
p
);
WID
->
add_message
(
_buf
);
}
}
// If more than 1 trailing '\n', or only "\n" in the string, print a blank
// line.
if
(
*
last
==
'\n'
)
{
buf
[
0
]
=
' '
;
buf
[
1
]
=
'\0'
;
WID
->
add_message
(
_buf
);
}
if
(
level
==
1
)
if
(
level
==
1
)
WID
->
create_message_window
();
WID
->
create_message_window
();
}
}
...
...
This diff is collapsed.
Click to expand it.
Fltk/GUI_Extras.cpp
+
6
−
7
View file @
03909a7a
...
@@ -1415,11 +1415,10 @@ void partition_defaults_cb(Fl_Widget *widget, void *data)
...
@@ -1415,11 +1415,10 @@ void partition_defaults_cb(Fl_Widget *widget, void *data)
dlg
->
read_all_options
();
dlg
->
read_all_options
();
partition_select_groups_cb
(
dlg
->
choicePartitioner
,
data
);
partition_select_groups_cb
(
dlg
->
choicePartitioner
,
data
);
}
}
void
partition_partition_cb
(
Fl_Widget
*
widget
,
void
*
data
)
void
partition_partition_cb
(
Fl_Widget
*
widget
,
void
*
data
)
{
{
PartitionDialog
*
dlg
=
static_cast
<
PartitionDialog
*>
(
data
);
PartitionDialog
*
dlg
=
static_cast
<
PartitionDialog
*>
(
data
);
Fl_Window
*
const
w
=
widget
->
window
();
w
->
hide
();
// Write all options
// Write all options
dlg
->
write_all_options
();
dlg
->
write_all_options
();
...
@@ -1430,13 +1429,14 @@ void partition_partition_cb(Fl_Widget *widget, void *data)
...
@@ -1430,13 +1429,14 @@ void partition_partition_cb(Fl_Widget *widget, void *data)
// Update the screen
// Update the screen
if
(
!
ier
)
{
if
(
!
ier
)
{
opt_mesh_color_carousel
(
0
,
GMSH_SET
|
GMSH_GUI
,
3.
);
opt_mesh_color_carousel
(
0
,
GMSH_SET
|
GMSH_GUI
,
3.
);
CTX
.
mesh
.
changed
=
ENT_ALL
;
Draw
();
Draw
();
}
}
Fl
::
delete_widget
(
widget
->
window
());
}
}
void
partition_cancel_cb
(
Fl_Widget
*
widget
,
void
*
data
)
void
partition_cancel_cb
(
Fl_Widget
*
widget
,
void
*
data
)
{
{
widget
->
window
()
->
hide
();
Fl
::
delete_widget
(
widget
->
window
());
Fl
::
delete_widget
(
widget
->
window
());
}
}
...
@@ -1581,8 +1581,8 @@ int partition_dialog()
...
@@ -1581,8 +1581,8 @@ int partition_dialog()
const
int
w
=
3
*
BB
+
IW
+
3
*
WB
;
// Window width
const
int
w
=
3
*
BB
+
IW
+
3
*
WB
;
// Window width
int
y
=
0
;
int
y
=
0
;
Fl_Double
_Window
*
const
window
=
Dialog
_Window
*
const
window
=
new
Dialog_Window
(
w
,
h
,
CTX
.
non_modal_windows
,
new
Fl_Double_Window
(
w
,
h
,
"Partitioner Options"
);
"Partitioner Options"
);
window
->
box
(
GMSH_WINDOW_BOX
);
window
->
box
(
GMSH_WINDOW_BOX
);
// Main options group [0]
// Main options group [0]
...
@@ -1882,7 +1882,6 @@ int partition_dialog()
...
@@ -1882,7 +1882,6 @@ int partition_dialog()
g
->
show
();
g
->
show
();
}
}
window
->
set_modal
();
window
->
end
();
window
->
end
();
window
->
hotspot
(
window
);
window
->
hotspot
(
window
);
...
...
This diff is collapsed.
Click to expand it.
contrib/Chaco/Makefile
+
1
−
1
View file @
03909a7a
...
@@ -3,7 +3,7 @@ include ../../variables
...
@@ -3,7 +3,7 @@ include ../../variables
LIB
=
../../lib/libGmshChaco
${
LIBEXT
}
LIB
=
../../lib/libGmshChaco
${
LIBEXT
}
INC
=
${
DASH
}
Imain
INC
=
${
DASH
}
Imain
${
DASH
}
I../../Common
CFLAGS
=
${
OPTIM
}
${
FLAGS
}
${
INC
}
${
SYSINCLUDE
}
CFLAGS
=
${
OPTIM
}
${
FLAGS
}
${
INC
}
${
SYSINCLUDE
}
...
...
This diff is collapsed.
Click to expand it.
contrib/Chaco/main/Gmsh_printf.cpp
+
20
−
2
View file @
03909a7a
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
// See the LICENSE.txt file for license information. Please report all
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
// bugs and problems to <gmsh@geuz.org>.
#include
"
../../../Common/
Message.h"
#include
"Message.h"
// Overload the printf statements in Chaco to write using Msg::Direct in gmsh
// Overload the printf statements in Chaco to write using Msg::Direct in gmsh
...
@@ -14,5 +14,23 @@ extern "C" int Gmsh_printf(const char *fmt, ...)
...
@@ -14,5 +14,23 @@ extern "C" int Gmsh_printf(const char *fmt, ...)
va_start
(
args
,
fmt
);
va_start
(
args
,
fmt
);
vsnprintf
(
str
,
sizeof
(
str
),
fmt
,
args
);
vsnprintf
(
str
,
sizeof
(
str
),
fmt
,
args
);
va_end
(
args
);
va_end
(
args
);
Msg
::
Direct
(
3
,
str
);
// deal with multi-line messages
const
char
*
const
last
=
str
+
std
::
max
(
0
,
(
int
)
std
::
strlen
(
str
)
-
1
);
char
buf
[
1024
];
char
*
p
=
std
::
strtok
(
str
,
"
\n
"
);
if
(
p
)
{
// If more than 1 leading '\n', print a blank line
if
(
p
-
str
>
1
)
Msg
::
Direct
(
" "
);
std
::
strcpy
(
buf
,
p
);
Msg
::
Direct
(
buf
);
// New line for each interior '\n'
while
(
p
=
std
::
strtok
(
NULL
,
"
\n
"
))
{
std
::
strcpy
(
buf
,
p
);
Msg
::
Direct
(
buf
);
}
}
// If more than 1 trailing '\n', or only "\n" in the string, print a blank
// line.
if
(
*
last
==
'\n'
)
Msg
::
Direct
(
" "
);
}
}
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