Author: MarkieB
Date: Sat Aug 29 13:47:46 2009
New Revision: 9500
URL:
http://source.netsurf-browser.org?rev=9500&view=rev
Log:
redraw local history
Modified:
branches/MarkieB/windows/windows/localhistory.c
Modified: branches/MarkieB/windows/windows/localhistory.c
URL:
http://source.netsurf-browser.org/branches/MarkieB/windows/windows/localh...
==============================================================================
--- branches/MarkieB/windows/windows/localhistory.c (original)
+++ branches/MarkieB/windows/windows/localhistory.c Sat Aug 29 13:47:46 2009
@@ -108,9 +108,9 @@
RegisterClassEx(&we);
LOG(("creating local history window for hInstance %p", hinstance));
hwnd = CreateWindow(localhistorywindowclassname,
- "NetSurf History", WS_OVERLAPPEDWINDOW /*WS_THICKFRAME | WS_HSCROLL |
+ "NetSurf History",WS_THICKFRAME | WS_HSCROLL |
WS_VSCROLL | WS_CLIPCHILDREN | WS_CLIPSIBLINGS |
- CS_DBLCLKS */ , r.left + margin/2, r.top + margin/2,
+ CS_DBLCLKS, r.left + margin/2, r.top + margin/2,
localhistory.guiwidth, localhistory.guiheight, NULL,
NULL, hinstance, NULL);
LOG(("gui_window %p width %d height %d hwnd %p", w,
@@ -159,7 +159,8 @@
voffset = gui_window_voffset(w);
GetWindowRect(hwnd, &r);
GetWindowRect(current_hwnd, &rmain);
- gui_window_redraw(w, MIN(r.top - rmain.top - voffset, 0),
+ gui_window_redraw(w,
+ MIN(r.top - rmain.top - voffset, 0),
MIN(r.left - rmain.left, 0),
gui_window_height(w) -
MIN(rmain.bottom - r.bottom, 0),
@@ -236,12 +237,18 @@
SetScrollInfo(hwnd, SB_VERT, &si, TRUE);
GetScrollInfo(hwnd, SB_VERT, &si);
if (si.nPos != mem) {
+ RECT r;
HDC hdc = GetDC(hwnd);
ScrollWindowEx(hwnd, 0, mem - si.nPos, NULL, NULL, NULL,
- NULL, 0);
+ &r, 0);
localhistory.vscroll += si.nPos - mem;
-/* history_redraw_rectangle();
-*/
+ history_redraw_rectangle(bw->history,
+ r.left + localhistory.hscroll,
+ r.top + localhistory.vscroll,
+ r.right + localhistory.hscroll,
+ r.bottom + localhistory.vscroll,
+ r.left, r.top);
+
ReleaseDC(hwnd, hdc);
}
break;
@@ -282,20 +289,32 @@
SetScrollInfo(hwnd, SB_HORZ, &si, TRUE);
GetScrollInfo(hwnd, SB_HORZ, &si);
if (si.nPos != mem) {
+ RECT r;
ScrollWindowEx(hwnd, mem - si.nPos, 0, NULL, NULL, NULL,
- NULL, 0);
+ &r, 0);
localhistory.hscroll += si.nPos - mem;
-/* history_redraw_rectangle();
-*/
+ if (bw == NULL)
+ break;
+ history_redraw_rectangle(bw->history,
+ r.left + localhistory.hscroll,
+ r.top + localhistory.vscroll,
+ r.right + localhistory.hscroll,
+ r.bottom + localhistory.vscroll,
+ r.left, r.top);
}
break;
}
case WM_PAINT: {
PAINTSTRUCT ps;
BeginPaint(hwnd, &ps);
-/* if (bw != NULL)
- history_redraw_rectangle(bw->history);
-*/ EndPaint(hwnd, &ps);
+ if (bw != NULL)
+ history_redraw_rectangle(bw->history,
+ localhistory.hscroll,
+ localhistory.vscroll,
+ localhistory.hscroll + localhistory.guiwidth,
+ localhistory.vscroll + localhistory.guiheight,
+ 0, 0);
+ EndPaint(hwnd, &ps);
return DefWindowProc(hwnd, msg, wparam, lparam);
break;
}