Skip to content
Snippets Groups Projects
Commit 3624dc6d authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

refined the messages a little bit more, so that only valid choices are
displayed at any time. (This is wicked cool, man :-)

PS: this is probably my last commit for quite a while (in case you
wondered: I have to do a demo of gmsh tomorrow, hence all my work
the last couple of weeks...)
parent dc28f99e
No related branches found
No related tags found
No related merge requests found
// $Id: Callbacks.cpp,v 1.238 2004-05-19 03:56:08 geuzaine Exp $ // $Id: Callbacks.cpp,v 1.239 2004-05-19 04:50:40 geuzaine Exp $
// //
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// //
...@@ -1753,12 +1753,15 @@ static void _new_multiline(int type) ...@@ -1753,12 +1753,15 @@ static void _new_multiline(int type)
Draw(); Draw();
} }
Msg(ONSCREEN, "Select control points\n"
"[Press 'e' to end selection, 'u' to undo last selection or 'q' to abort]");
n = 0; n = 0;
while(1) { while(1) {
Msg(STATUS3N, "Creating curve"); Msg(STATUS3N, "Creating curve");
if(n == 0)
Msg(ONSCREEN, "Select control points\n"
"[Press 'e' to end selection or 'q' to abort]");
else
Msg(ONSCREEN, "Select control points\n"
"[Press 'e' to end selection, 'u' to undo last selection or 'q' to abort]");
char ib = SelectEntity(ENT_POINT, &v, &c, &s); char ib = SelectEntity(ENT_POINT, &v, &c, &s);
if(ib == 'l') { if(ib == 'l') {
p[n++] = v->Num; p[n++] = v->Num;
...@@ -1824,7 +1827,7 @@ void geometry_elementary_add_new_line_cb(CALLBACK_ARGS) ...@@ -1824,7 +1827,7 @@ void geometry_elementary_add_new_line_cb(CALLBACK_ARGS)
Msg(STATUS3N, "Creating straight line"); Msg(STATUS3N, "Creating straight line");
if(n == 0) if(n == 0)
Msg(ONSCREEN, "Select start point\n" Msg(ONSCREEN, "Select start point\n"
"[Press 'u' to undo last selection or 'q' to abort]"); "[Press 'q' to abort]");
if(n == 1) if(n == 1)
Msg(ONSCREEN, "Select end point\n" Msg(ONSCREEN, "Select end point\n"
"[Press 'u' to undo last selection or 'q' to abort]"); "[Press 'u' to undo last selection or 'q' to abort]");
...@@ -1883,7 +1886,7 @@ void geometry_elementary_add_new_circle_cb(CALLBACK_ARGS) ...@@ -1883,7 +1886,7 @@ void geometry_elementary_add_new_circle_cb(CALLBACK_ARGS)
Msg(STATUS3N, "Creating circle"); Msg(STATUS3N, "Creating circle");
if(n == 0) if(n == 0)
Msg(ONSCREEN, "Select start point\n" Msg(ONSCREEN, "Select start point\n"
"[Press 'u' to undo last selection or 'q' to abort]"); "[Press 'q' to abort]");
if(n == 1) if(n == 1)
Msg(ONSCREEN, "Select center point\n" Msg(ONSCREEN, "Select center point\n"
"[Press 'u' to undo last selection or 'q' to abort]"); "[Press 'u' to undo last selection or 'q' to abort]");
...@@ -1935,7 +1938,7 @@ void geometry_elementary_add_new_ellipse_cb(CALLBACK_ARGS) ...@@ -1935,7 +1938,7 @@ void geometry_elementary_add_new_ellipse_cb(CALLBACK_ARGS)
Msg(STATUS3N, "Creating ellipse"); Msg(STATUS3N, "Creating ellipse");
if(n == 0) if(n == 0)
Msg(ONSCREEN, "Select start point\n" Msg(ONSCREEN, "Select start point\n"
"[Press 'u' to undo last selection or 'q' to abort]"); "[Press 'q' to abort]");
if(n == 1) if(n == 1)
Msg(ONSCREEN, "Select center point\n" Msg(ONSCREEN, "Select center point\n"
"[Press 'u' to undo last selection or 'q' to abort]"); "[Press 'u' to undo last selection or 'q' to abort]");
...@@ -2005,11 +2008,19 @@ static void _new_surface_volume(int mode) ...@@ -2005,11 +2008,19 @@ static void _new_surface_volume(int mode)
while(1) { while(1) {
if(type == ENT_LINE){ if(type == ENT_LINE){
Msg(STATUS3N, "Creating surface"); Msg(STATUS3N, "Creating surface");
if(!List_Nbr(List1))
Msg(ONSCREEN, "Select surface boundary\n"
"[Press 'q' to abort]");
else
Msg(ONSCREEN, "Select surface boundary\n" Msg(ONSCREEN, "Select surface boundary\n"
"[Press 'u' to undo last selection or 'q' to abort]"); "[Press 'u' to undo last selection or 'q' to abort]");
} }
else{ else{
Msg(STATUS3N, "Creating volume"); Msg(STATUS3N, "Creating volume");
if(!List_Nbr(List1))
Msg(ONSCREEN, "Select volume boundary\n"
"[Press 'q' to abort]");
else
Msg(ONSCREEN, "Select volume boundary\n" Msg(ONSCREEN, "Select volume boundary\n"
"[Press 'u' to undo last selection or 'q' to abort]"); "[Press 'u' to undo last selection or 'q' to abort]");
} }
...@@ -2040,7 +2051,11 @@ static void _new_surface_volume(int mode) ...@@ -2040,7 +2051,11 @@ static void _new_surface_volume(int mode)
List_Reset(List1); List_Reset(List1);
List_Add(List2, &num); List_Add(List2, &num);
while(1) { while(1) {
if(!List_Nbr(List1))
Msg(ONSCREEN, "Select hole boundaries (if none, press 'e')\n" Msg(ONSCREEN, "Select hole boundaries (if none, press 'e')\n"
"[Press 'e' to end selection or 'q' to abort]");
else
Msg(ONSCREEN, "Select hole boundaries\n"
"[Press 'e' to end selection, 'u' to undo last selection or 'q' to abort]"); "[Press 'e' to end selection, 'u' to undo last selection or 'q' to abort]");
ib = SelectEntity(type, &v, &c, &s); ib = SelectEntity(type, &v, &c, &s);
if(ib == 'q') { if(ib == 'q') {
...@@ -2529,12 +2544,15 @@ static void _add_physical(char *what) ...@@ -2529,12 +2544,15 @@ static void _add_physical(char *what)
return; return;
} }
Msg(ONSCREEN, "Select %s\n"
"[Press 'e' to end selection, 'u' to undo last selection or 'q' to abort]", str);
List1 = List_Create(5, 5, sizeof(int)); List1 = List_Create(5, 5, sizeof(int));
while(1) { while(1) {
Msg(STATUS3N, "Creating physical %s", str); Msg(STATUS3N, "Creating physical %s", str);
if(!List_Nbr(List1))
Msg(ONSCREEN, "Select %s\n"
"[Press 'e' to end selection or 'q' to abort]", str);
else
Msg(ONSCREEN, "Select %s\n"
"[Press 'e' to end selection, 'u' to undo last selection or 'q' to abort]", str);
char ib = SelectEntity(type, &v, &c, &s); char ib = SelectEntity(type, &v, &c, &s);
if(ib == 'l') { if(ib == 'l') {
switch (type) { switch (type) {
...@@ -2674,11 +2692,14 @@ void mesh_define_length_cb(CALLBACK_ARGS) ...@@ -2674,11 +2692,14 @@ void mesh_define_length_cb(CALLBACK_ARGS)
WID->create_mesh_context_window(0); WID->create_mesh_context_window(0);
Msg(ONSCREEN, "Select points\n"
"[Press 'e' to end selection, 'u' to undo last selection or 'q' to abort]");
while(1) { while(1) {
Msg(STATUS3N, "Setting characteristic length"); Msg(STATUS3N, "Setting characteristic length");
if(n == 0)
Msg(ONSCREEN, "Select points\n"
"[Press 'e' to end selection or 'q' to abort]");
else
Msg(ONSCREEN, "Select points\n"
"[Press 'e' to end selection, 'u' to undo last selection or 'q' to abort]");
char ib = SelectEntity(ENT_POINT, &v, &c, &s); char ib = SelectEntity(ENT_POINT, &v, &c, &s);
if(ib == 'l') { if(ib == 'l') {
p[n++] = v->Num; p[n++] = v->Num;
...@@ -2719,12 +2740,15 @@ void mesh_define_recombine_cb(CALLBACK_ARGS) ...@@ -2719,12 +2740,15 @@ void mesh_define_recombine_cb(CALLBACK_ARGS)
Draw(); Draw();
} }
Msg(ONSCREEN, "Select surfaces\n"
"[Press 'e' to end selection, 'u' to undo last selection or 'q' to abort]");
n = 0; n = 0;
while(1) { while(1) {
Msg(STATUS3N, "Selecting recombined surfaces"); Msg(STATUS3N, "Selecting recombined surfaces");
if(n == 0)
Msg(ONSCREEN, "Select surfaces\n"
"[Press 'e' to end selection or 'q' to abort]");
else
Msg(ONSCREEN, "Select surfaces\n"
"[Press 'e' to end selection, 'u' to undo last selection or 'q' to abort]");
char ib = SelectEntity(ENT_SURFACE, &v, &c, &s); char ib = SelectEntity(ENT_SURFACE, &v, &c, &s);
if(ib == 'l') { if(ib == 'l') {
p[n++] = s->Num; p[n++] = s->Num;
...@@ -2797,6 +2821,10 @@ static void _add_transfinite(int dim) ...@@ -2797,6 +2821,10 @@ static void _add_transfinite(int dim)
Msg(STATUS3N, "Setting transfinite contraints"); Msg(STATUS3N, "Setting transfinite contraints");
switch (dim) { switch (dim) {
case 1: case 1:
if(n == 0)
Msg(ONSCREEN, "Select lines\n"
"[Press 'e' to end selection or 'q' to abort]");
else
Msg(ONSCREEN, "Select lines\n" Msg(ONSCREEN, "Select lines\n"
"[Press 'e' to end selection, 'u' to undo last selection or 'q' to abort]"); "[Press 'e' to end selection, 'u' to undo last selection or 'q' to abort]");
ib = SelectEntity(ENT_LINE, &v, &c, &s); ib = SelectEntity(ENT_LINE, &v, &c, &s);
...@@ -2845,7 +2873,11 @@ static void _add_transfinite(int dim) ...@@ -2845,7 +2873,11 @@ static void _add_transfinite(int dim)
p[n++] = s->Num; // fall-through p[n++] = s->Num; // fall-through
case 3: case 3:
while(1) { while(1) {
Msg(ONSCREEN, "Select boundary points (in order)\n" if(n == ((dim == 2) ? 1 : 0))
Msg(ONSCREEN, "Select (ordered) boundary points\n"
"[Press 'e' to end selection or 'q' to abort]");
else
Msg(ONSCREEN, "Select (ordered) boundary points\n"
"[Press 'e' to end selection, 'u' to undo last selection or 'q' to abort]"); "[Press 'e' to end selection, 'u' to undo last selection or 'q' to abort]");
ib = SelectEntity(ENT_POINT, &v, &c, &s); ib = SelectEntity(ENT_POINT, &v, &c, &s);
if(ib == 'l') { if(ib == 'l') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment