From aedd91735f15c4ed206a35a633760f48454037ae Mon Sep 17 00:00:00 2001 From: Jonathan Westhues Date: Sun, 27 Apr 2008 01:31:56 -0800 Subject: [PATCH] Text window was double-buffered, but background was still getting erased before redraw, which caused a bit of flicker on show. And hide debug prints in solver. [git-p4: depot-paths = "//depot/solvespace/": change = 1693] --- system.cpp | 7 ++++--- win32/w32main.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/system.cpp b/system.cpp index c51aab3..40449a5 100644 --- a/system.cpp +++ b/system.cpp @@ -207,23 +207,24 @@ bool System::NewtonSolve(int tag) { bool System::Solve(void) { int i, j; +/* dbp("%d equations", eq.n); for(i = 0; i < eq.n; i++) { dbp(" %s = 0", eq.elem[i].e->Print()); } - dbp("%d parameters", param.n); + dbp("%d parameters", param.n); */ param.ClearTags(); eq.ClearTags(); WriteJacobian(0, 0); EvalJacobian(); - +/* for(i = 0; i < mat.m; i++) { for(j = 0; j < mat.n; j++) { dbp("A[%d][%d] = %.3f", i, j, mat.A.num[i][j]); } - } + } */ GaussJordan(); diff --git a/win32/w32main.cpp b/win32/w32main.cpp index 8b0589a..d32557d 100644 --- a/win32/w32main.cpp +++ b/win32/w32main.cpp @@ -108,7 +108,6 @@ static void PaintTextWnd(HDC hdc) RECT rect; GetClientRect(TextWnd, &rect); - // Set up the back-buffer HDC backDc = CreateCompatibleDC(hdc); int width = rect.right - rect.left; @@ -206,6 +205,9 @@ void HandleTextWindowScrollBar(WPARAM wParam, LPARAM lParam) LRESULT CALLBACK TextWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { + case WM_ERASEBKGND: + break; + case WM_CLOSE: case WM_DESTROY: PostQuitMessage(0); @@ -698,8 +700,7 @@ static void CreateMainWindows(void) // We get the desired Alt+Tab behaviour by specifying that the text // window is a child of the graphics window. TextWnd = CreateWindowEx(0, - "TextWnd", "SolveSpace (Text Window)", - WS_THICKFRAME | WS_CLIPCHILDREN, + "TextWnd", "SolveSpace (Text Window)", WS_THICKFRAME | WS_CLIPCHILDREN, 10, 10, 600, 300, GraphicsWnd, (HMENU)NULL, Instance, NULL); if(!TextWnd) oops();