WinGUI: Make the text output from com_hardcopy available immediately

by call to function UpdateMainText.

Enable color for postscript output.
This commit is contained in:
Holger Vogt 2021-03-02 12:15:23 +01:00
parent dec865cb30
commit 1f54a6add3
2 changed files with 16 additions and 1 deletions

View File

@ -69,6 +69,7 @@ extern int DevSwitch(char *devname);
extern int NewViewport(GRAPH *pgraph); extern int NewViewport(GRAPH *pgraph);
extern void com_hardcopy(wordlist *wl); extern void com_hardcopy(wordlist *wl);
extern void wincolor_graph(COLORREF* ColorTable, int noc, GRAPH* graph); extern void wincolor_graph(COLORREF* ColorTable, int noc, GRAPH* graph);
extern void UpdateMainText(void);
/* defines */ /* defines */
#define RAD_TO_DEG (180.0 / M_PI) #define RAD_TO_DEG (180.0 / M_PI)
@ -280,8 +281,14 @@ static int LType(int ColorIndex)
static LRESULT HcpyPlotPS(HWND hwnd) static LRESULT HcpyPlotPS(HWND hwnd)
{ {
NG_IGNORE(hwnd); NG_IGNORE(hwnd);
int i = 1;
cp_vset("hcopydevtype", CP_STRING, "postscript"); cp_vset("hcopydevtype", CP_STRING, "postscript");
/* If not set, the color will be b&w, i = 1 is white background */
cp_vset("hcopypscolor", CP_NUM, &i);
com_hardcopy(NULL); com_hardcopy(NULL);
/* update the text in the main window */
UpdateMainText();
SetFocus(swString);
return 0; return 0;
} }
@ -292,6 +299,9 @@ static LRESULT HcpyPlotSVG(HWND hwnd)
NG_IGNORE(hwnd); NG_IGNORE(hwnd);
cp_vset("hcopydevtype", CP_STRING, "svg"); cp_vset("hcopydevtype", CP_STRING, "svg");
com_hardcopy(NULL); com_hardcopy(NULL);
/* update the text in the main window */
UpdateMainText();
SetFocus(swString);
return 0; return 0;
} }

View File

@ -137,6 +137,8 @@ extern void cp_doquit(void);
static struct History_info *init_history(void); static struct History_info *init_history(void);
void UpdateMainText(void);
// ---------------------------<Message Handling>------------------------------- // ---------------------------<Message Handling>-------------------------------
// Warte, bis keine Messages mehr zu bearbeiten sind // Warte, bis keine Messages mehr zu bearbeiten sind
@ -1915,7 +1917,10 @@ winmessage(char *new_msg)
MessageBox(NULL, new_msg, "Ngspice Info", MB_OK | MB_ICONERROR); MessageBox(NULL, new_msg, "Ngspice Info", MB_OK | MB_ICONERROR);
} }
void
UpdateMainText(void) {
DisplayText();
}
#else /* HAS_WINGUI not defined */ #else /* HAS_WINGUI not defined */
/* Prevent warning regarding empty translation unit */ /* Prevent warning regarding empty translation unit */