Auto-show the text window when stepping a dimension, in addition to
auto-showing when a solve fails. And accept expressions, not just numbers, for that new dimension value. [git-p4: depot-paths = "//depot/solvespace/": change = 1877]solver
parent
69cf8d6484
commit
23a4ce3697
6
draw.cpp
6
draw.cpp
|
@ -924,10 +924,8 @@ void GraphicsWindow::Paint(int w, int h) {
|
|||
} else {
|
||||
// Draw a red background whenever we're having solve problems.
|
||||
glClearColor(0.4f, 0, 0, 1.0f);
|
||||
if(!showTextWindow) {
|
||||
showTextWindow = true;
|
||||
ShowTextWindow(TRUE);
|
||||
}
|
||||
// And show the text window, which has info to debug it
|
||||
ForceTextWindowShown();
|
||||
}
|
||||
|
||||
glClearDepth(1.0);
|
||||
|
|
|
@ -430,6 +430,14 @@ bool GraphicsWindow::LockedInWorkplane(void) {
|
|||
return (SS.GW.ActiveWorkplane().v != Entity::FREE_IN_3D.v);
|
||||
}
|
||||
|
||||
void GraphicsWindow::ForceTextWindowShown(void) {
|
||||
if(!showTextWindow) {
|
||||
showTextWindow = true;
|
||||
CheckMenuById(MNU_SHOW_TEXT_WND, true);
|
||||
ShowTextWindow(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
void GraphicsWindow::MenuEdit(int id) {
|
||||
switch(id) {
|
||||
case MNU_UNSELECT_ALL:
|
||||
|
|
|
@ -373,6 +373,10 @@ void SolveSpace::MenuAnalyze(int id) {
|
|||
SS.TW.shown.constraint = c->h;
|
||||
SS.TW.shown.screen = TextWindow::SCREEN_STEP_DIMENSION;
|
||||
|
||||
// The step params are specified in the text window,
|
||||
// so force that to be shown.
|
||||
SS.GW.ForceTextWindowShown();
|
||||
|
||||
SS.later.showTW = true;
|
||||
SS.GW.ClearSelection();
|
||||
} else {
|
||||
|
|
|
@ -929,13 +929,19 @@ void TextWindow::EditControlDone(char *s) {
|
|||
break;
|
||||
}
|
||||
|
||||
case EDIT_STEP_DIM_FINISH:
|
||||
case EDIT_STEP_DIM_FINISH: {
|
||||
Expr *e = Expr::From(s);
|
||||
if(!e) {
|
||||
Error("Not a valid number or expression: '%s'", s);
|
||||
break;
|
||||
}
|
||||
if(shown.dimIsDistance) {
|
||||
shown.dimFinish = SS.StringToMm(s);
|
||||
shown.dimFinish = SS.ExprToMm(e);
|
||||
} else {
|
||||
shown.dimFinish = atof(s);
|
||||
shown.dimFinish = e->Eval();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case EDIT_STEP_DIM_STEPS:
|
||||
shown.dimSteps = min(300, max(1, atoi(s)));
|
||||
|
|
1
ui.h
1
ui.h
|
@ -292,6 +292,7 @@ public:
|
|||
bool LockedInWorkplane(void);
|
||||
void SetWorkplaneFreeIn3d(void);
|
||||
hEntity ActiveWorkplane(void);
|
||||
void ForceTextWindowShown(void);
|
||||
|
||||
// Operations that must be completed by doing something with the mouse
|
||||
// are noted here. These occupy the same space as the menu ids.
|
||||
|
|
Loading…
Reference in New Issue