Browse Source

WinGUI: Make the text output from com_hardcopy available immediately

by call to function UpdateMainText.

Enable color for postscript output.
pre-master-46
Holger Vogt 5 years ago
parent
commit
1f54a6add3
  1. 10
      src/frontend/wdisp/windisp.c
  2. 7
      src/winmain.c

10
src/frontend/wdisp/windisp.c

@ -69,6 +69,7 @@ extern int DevSwitch(char *devname);
extern int NewViewport(GRAPH *pgraph);
extern void com_hardcopy(wordlist *wl);
extern void wincolor_graph(COLORREF* ColorTable, int noc, GRAPH* graph);
extern void UpdateMainText(void);
/* defines */
#define RAD_TO_DEG (180.0 / M_PI)
@ -280,8 +281,14 @@ static int LType(int ColorIndex)
static LRESULT HcpyPlotPS(HWND hwnd)
{
NG_IGNORE(hwnd);
int i = 1;
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);
/* update the text in the main window */
UpdateMainText();
SetFocus(swString);
return 0;
}
@ -292,6 +299,9 @@ static LRESULT HcpyPlotSVG(HWND hwnd)
NG_IGNORE(hwnd);
cp_vset("hcopydevtype", CP_STRING, "svg");
com_hardcopy(NULL);
/* update the text in the main window */
UpdateMainText();
SetFocus(swString);
return 0;
}

7
src/winmain.c

@ -137,6 +137,8 @@ extern void cp_doquit(void);
static struct History_info *init_history(void);
void UpdateMainText(void);
// ---------------------------<Message Handling>-------------------------------
// 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);
}
void
UpdateMainText(void) {
DisplayText();
}
#else /* HAS_WINGUI not defined */
/* Prevent warning regarding empty translation unit */

Loading…
Cancel
Save