diff --git a/ChangeLog b/ChangeLog index 1f981381c..eb9ccb649 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,10 @@ in mingw and MS Visual Studio. gnuplot.c: small update, call to gnuplot tested up to ver. 4.2.6, does not work for Windows and gnuplot 4.4. + * x11.c: add xfont parameter + * windisp.c: add wfont and wfont_size parameter + * winmain.c: use SystemParametersInfo() to get screen size to + improve placement of GUI on the screen. 2010-01-01 Holger Vogt * spinit.in: Small update diff --git a/src/frontend/plotting/x11.c b/src/frontend/plotting/x11.c index 44f75739c..1d14f3255 100644 --- a/src/frontend/plotting/x11.c +++ b/src/frontend/plotting/x11.c @@ -410,7 +410,7 @@ X11_NewViewport(GRAPH *graph) XtAddCallback(DEVDEP(graph).buttons[1], XtNcallback, (XtCallbackProc) hardcopy, graph); /* set up fonts */ - if (!cp_getvar("font", VT_STRING, fontname)) { + if (!cp_getvar("xfont", VT_STRING, fontname)) { (void) strcpy(fontname, DEF_FONT); } diff --git a/src/frontend/wdisp/windisp.c b/src/frontend/wdisp/windisp.c index 01da75ed3..1d0e8a9b9 100644 --- a/src/frontend/wdisp/windisp.c +++ b/src/frontend/wdisp/windisp.c @@ -69,6 +69,8 @@ extern int NewViewport(GRAPH *pgraph); #define M_LN10 2.30258509299404568402 #endif +#define DEF_FONTW "Courier" + /* local variables */ static int IsRegistered = 0; /* 1 if window class is registered */ #define NumWinColors 23 /* predefined colors */ @@ -815,8 +817,16 @@ int WIN_Text( char * text, int x, int y, int CentiDegrees) lf.lfClipPrecision = 0 ; lf.lfQuality = 0 ; lf.lfPitchAndFamily = 0 ; + + /* set up fonts */ + if (!cp_getvar("wfont", VT_STRING, lf.lfFaceName)) { + (void) lstrcpy(lf.lfFaceName, DEF_FONTW); + } + if (!cp_getvar("wfont_size", VT_NUM, (char *) &(lf.lfHeight))) { + lf.lfHeight = (int) (1.1 * currentgraph->fontheight) ; + } - lstrcpy (lf.lfFaceName, "Courier"/*"Times New Roman"*/) ; +// lstrcpy (lf.lfFaceName, "Courier"/*"Times New Roman"*/) ; hfont = CreateFontIndirect (&lf); SelectObject(wd->hDC, hfont); diff --git a/src/winmain.c b/src/winmain.c index 0fa236be2..f04678643 100644 --- a/src/winmain.c +++ b/src/winmain.c @@ -8,14 +8,14 @@ #include "config.h" #ifdef HAS_WINDOWS -#define STRICT // strikte Typpruefung +#define STRICT // strict type checking #define WIN32_LEAN_AND_MEAN -#include // normale Windows-Aufrufe -#include // Win32 Message Cracker -#include // sprintf und co -#include // exit-codes -#include // var. argumente -#include // assert-macro +#include // standard Windows calls +#include // Win32 message cracker +#include // sprintf and co +#include // exit codes +#include // var. arguments +#include // assert macro #include "misc/stringutil.h" // copy #include // _read @@ -29,13 +29,13 @@ #include "misc/misc_time.h" /* timediff */ /* Constants */ -#define TBufSize 8192 // Groesze des Textbuffers -#define CR VK_RETURN // Carriage Return +#define TBufSize 8192 // size of text buffer +#define CR VK_RETURN // Carriage Return #define LF 10 // Line Feed #define SE 0 // String termination -#define BorderSize 8 // Umrandung des Stringfeldes -#define SBufSize 100 // Groesze des Stringbuffers -#define IOBufSize 4096 // Groesze des printf-Buffers +#define BorderSize 8 // Umrandung des Stringfeldes +#define SBufSize 100 // Groesze des Stringbuffers +#define IOBufSize 4096 // Groesze des printf-Buffers #define HistSize 20 // Zeilen History-Buffer #define StatusHeight 25 // Hoehe des Status Bars #define StatusFrame 2 // Abstand Statusbar / StatusElement @@ -774,6 +774,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLi int argc; char **argv; + RECT wsize; /* size of usable window */ + /* fill global variables */ hInst = hInstance; nShowState = nCmdShow; @@ -829,9 +831,13 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLi if (!RegisterClass( &hwElementClass)) goto THE_END; /*Create main window */ - iy = GetSystemMetrics( SM_CYSCREEN); - iyt = GetSystemMetrics( SM_CYSCREEN) / 3; - ix = GetSystemMetrics( SM_CXSCREEN); + SystemParametersInfo(SPI_GETWORKAREA, 0, &wsize, NULL); + iy = wsize.bottom; + iyt = iy / 3; + ix = wsize.right; +// iy = GetSystemMetrics( SM_CYSCREEN); +// iyt = GetSystemMetrics( SM_CYSCREEN) / 3; +// ix = GetSystemMetrics( SM_CXSCREEN); hwMain = CreateWindow( hwClassName, hwWindowName, WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, 0, iyt * 2, ix, iyt, NULL, NULL, hInst, NULL); if (!hwMain) goto THE_END; @@ -898,7 +904,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLi Size of windows allows display of 80 character line. Limit window to screen size (if only VGA). */ if (ix < WinLineWidth) WinLineWidth = ix; - MoveWindow( hwMain, 0, (iyt * 2 - 22), WinLineWidth, iyt, FALSE); + MoveWindow( hwMain, 0, (iyt * 2), WinLineWidth, iyt, FALSE); ShowWindow( hwMain, nShowState); ShowWindow( twText, SW_SHOWNORMAL); ShowWindow( swString, SW_SHOWNORMAL);