winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
November 2012
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
708 discussions
Start a n
N
ew thread
Andrew Talbot : hhctrl.ocx: Remove unused variable.
by Alexandre Julliard
21 Nov '12
21 Nov '12
Module: wine Branch: master Commit: 9e01b1752ac4d94444c34a6486d9f3ed6fcbf8ef URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9e01b1752ac4d94444c34a648…
Author: Andrew Talbot <andrew.talbot(a)talbotville.com> Date: Tue Nov 20 20:58:28 2012 +0000 hhctrl.ocx: Remove unused variable. --- dlls/hhctrl.ocx/help.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/dlls/hhctrl.ocx/help.c b/dlls/hhctrl.ocx/help.c index 38446dc..f6155c7 100644 --- a/dlls/hhctrl.ocx/help.c +++ b/dlls/hhctrl.ocx/help.c @@ -266,7 +266,6 @@ static void DoSync(HHInfo *info) { WCHAR buf[INTERNET_MAX_URL_LENGTH]; HRESULT hres; - DWORD len; BSTR url; hres = IWebBrowser2_get_LocationURL(info->web_browser, &url); @@ -278,7 +277,7 @@ static void DoSync(HHInfo *info) } /* If we're not currently viewing a page in the active .chm file, abort */ - if ((!AppendFullPathURL(info->WinType.pszFile, buf, NULL)) || (len = lstrlenW(buf) > lstrlenW(url))) + if ((!AppendFullPathURL(info->WinType.pszFile, buf, NULL)) || (lstrlenW(buf) > lstrlenW(url))) { SysFreeString(url); return;
1
0
0
0
Aric Stewart : wineqtdecoder: Properly clean up splitter and loader threads on QTSplitter destruction.
by Alexandre Julliard
20 Nov '12
20 Nov '12
Module: wine Branch: master Commit: 2a4cab537531104c59e42f48444985dc0f9d5eca URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2a4cab537531104c59e42f484…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Tue Nov 20 08:08:36 2012 -0600 wineqtdecoder: Properly clean up splitter and loader threads on QTSplitter destruction. --- dlls/wineqtdecoder/qtsplitter.c | 56 +++++++++++++++++++++++++++++--------- 1 files changed, 42 insertions(+), 14 deletions(-) diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c index b584198..a3cd91f 100644 --- a/dlls/wineqtdecoder/qtsplitter.c +++ b/dlls/wineqtdecoder/qtsplitter.c @@ -168,6 +168,9 @@ typedef struct QTSplitter { TimeValue movie_time; TimeValue movie_start; TimeScale movie_scale; + + HANDLE loaderThread; + HANDLE splitterThread; } QTSplitter; static const IPinVtbl QT_OutputPin_Vtbl; @@ -293,6 +296,7 @@ static void QT_Destroy(QTSplitter *This) TRACE("Destroying\n"); + EnterCriticalSection(&This->csReceive); /* Don't need to clean up output pins, disconnecting input pin will do that */ IPin_ConnectedTo(&This->pInputPin.pin.IPin_iface, &connected); if (connected) @@ -311,14 +315,31 @@ static void QT_Destroy(QTSplitter *This) } if (This->pQTMovie) + { DisposeMovie(This->pQTMovie); + This->pQTMovie = NULL; + } if (This->vContext) QTVisualContextRelease(This->vContext); if (This->aSession) MovieAudioExtractionEnd(This->aSession); - CloseHandle(This->runEvent); ExitMovies(); + LeaveCriticalSection(&This->csReceive); + + if (This->loaderThread) + { + WaitForSingleObject(This->loaderThread, INFINITE); + CloseHandle(This->loaderThread); + } + if (This->splitterThread) + { + SetEvent(This->runEvent); + WaitForSingleObject(This->splitterThread, INFINITE); + CloseHandle(This->splitterThread); + } + + CloseHandle(This->runEvent); This->csReceive.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&This->csReceive); @@ -495,13 +516,15 @@ static DWORD WINAPI QTSplitter_loading_thread(LPVOID data) to try to minimize that. */ - while(GetMovieLoadState(This->pQTMovie) < kMovieLoadStateComplete) + EnterCriticalSection(&This->csReceive); + while(This->pQTMovie && GetMovieLoadState(This->pQTMovie) < kMovieLoadStateComplete) { - EnterCriticalSection(&This->csReceive); MoviesTask(This->pQTMovie, 100); LeaveCriticalSection(&This->csReceive); Sleep(0); + EnterCriticalSection(&This->csReceive); } + LeaveCriticalSection(&This->csReceive); } return 0; } @@ -518,6 +541,12 @@ static DWORD WINAPI QTSplitter_thread(LPVOID data) WaitForSingleObject(This->runEvent, -1); EnterCriticalSection(&This->csReceive); + if (!This->pQTMovie) + { + LeaveCriticalSection(&This->csReceive); + return 0; + } + This->state = State_Running; /* Prime the pump: Needed for MPEG streams */ GetMovieNextInterestingTime(This->pQTMovie, nextTimeEdgeOK | nextTimeStep, 0, NULL, This->movie_time, 1, &next_time, NULL); @@ -536,6 +565,12 @@ static DWORD WINAPI QTSplitter_thread(LPVOID data) float time; EnterCriticalSection(&This->csReceive); + if (!This->pQTMovie) + { + LeaveCriticalSection(&This->csReceive); + return 0; + } + GetMovieNextInterestingTime(This->pQTMovie, nextTimeStep, 0, NULL, This->movie_time, 1, &next_time, NULL); if (next_time == -1) @@ -992,7 +1027,6 @@ static HRESULT QT_Process_Movie(QTSplitter* filter) Track trk; short id = 0; DWORD tid; - HANDLE thread; LONGLONG time; TRACE("Trying movie connect\n"); @@ -1039,18 +1073,12 @@ static HRESULT QT_Process_Movie(QTSplitter* filter) TRACE("Movie duration is %s\n",wine_dbgstr_longlong(filter->sourceSeeking.llDuration)); - thread = CreateThread(NULL, 0, QTSplitter_loading_thread, filter, 0, &tid); - if (thread) - { + filter->loaderThread = CreateThread(NULL, 0, QTSplitter_loading_thread, filter, 0, &tid); + if (filter->loaderThread) TRACE("Created loading thread 0x%08x\n", tid); - CloseHandle(thread); - } - thread = CreateThread(NULL, 0, QTSplitter_thread, filter, 0, &tid); - if (thread) - { + filter->splitterThread = CreateThread(NULL, 0, QTSplitter_thread, filter, 0, &tid); + if (filter->splitterThread) TRACE("Created processing thread 0x%08x\n", tid); - CloseHandle(thread); - } else hr = HRESULT_FROM_WIN32(GetLastError());
1
0
0
0
Jacek Caban : mshtml: Use stdint.h type names in nsiface.idl.
by Alexandre Julliard
20 Nov '12
20 Nov '12
Module: wine Branch: master Commit: 96ace8636a307e30144df074c6906bb978ffbf73 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=96ace8636a307e30144df074c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Nov 20 15:29:21 2012 +0100 mshtml: Use stdint.h type names in nsiface.idl. Gecko uses stdint.h types instead of NSPR types for most of the codebase now. --- dlls/mshtml/nsiface.idl | 934 ++++++++++++++++++++++++----------------------- 1 files changed, 475 insertions(+), 459 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=96ace8636a307e30144df…
1
0
0
0
Michael Stefaniuc : comdlg32/tests: Fix the prototype of callback functions .
by Alexandre Julliard
20 Nov '12
20 Nov '12
Module: wine Branch: master Commit: 098fd250095f6ac6f540336e2adcb4bfff47be93 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=098fd250095f6ac6f540336e2…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Tue Nov 20 13:35:05 2012 +0100 comdlg32/tests: Fix the prototype of callback functions. --- dlls/comdlg32/tests/filedlg.c | 22 ++++++++++------------ 1 files changed, 10 insertions(+), 12 deletions(-) diff --git a/dlls/comdlg32/tests/filedlg.c b/dlls/comdlg32/tests/filedlg.c index b701956..9ae4e66 100644 --- a/dlls/comdlg32/tests/filedlg.c +++ b/dlls/comdlg32/tests/filedlg.c @@ -239,7 +239,7 @@ cleanup: return 0; } -static LONG_PTR WINAPI template_hook(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam) +static UINT_PTR WINAPI template_hook(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam) { if (msg == WM_INITDIALOG) { @@ -286,7 +286,7 @@ static void test_create_view_template(void) ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400A; ofn.lpstrFile = filename; ofn.nMaxFile = 1024; - ofn.lpfnHook = (LPOFNHOOKPROC)template_hook; + ofn.lpfnHook = template_hook; ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER| OFN_ENABLETEMPLATE; ofn.hInstance = GetModuleHandleA(NULL); ofn.lpTemplateName = "template1"; @@ -318,7 +318,7 @@ static const struct { { 0xffffffff } }; -static LONG_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam) +static UINT_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam) { static RECT initrc, rc; static int index, count; @@ -538,7 +538,7 @@ static void test_resize(void) ofn.lpstrFile = filename; ofn.nMaxFile = 1024; - ofn.lpfnHook = (LPOFNHOOKPROC) resize_template_hook; + ofn.lpfnHook = resize_template_hook; ofn.hInstance = GetModuleHandle(NULL); ofn.lpTemplateName = "template_sz"; for( i = 0; resize_testcases[i].flags != 0xffffffff; i++) { @@ -581,7 +581,7 @@ static ok_wndproc_testcase ok_testcases[] = { /* test_ok_wndproc can be used as hook procedure or a subclass * window proc for the file dialog */ -static LONG_PTR WINAPI test_ok_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam) +static UINT_PTR WINAPI test_ok_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam) { HWND parent = GetParent( dlg); static ok_wndproc_testcase *testcase = NULL; @@ -624,7 +624,7 @@ static LONG_PTR WINAPI test_ok_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPARAM return FALSE; } -static LONG_PTR WINAPI ok_template_hook(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam) +static UINT_PTR WINAPI ok_template_hook(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam) { if (msg == WM_SETFONT) SetWindowLongPtrA( dlg, GWLP_WNDPROC, (LONG_PTR) test_ok_wndproc); @@ -655,9 +655,7 @@ static void test_ok(void) for( i = 0; ok_testcases[i].retval != -1; i++) { strcpy( filename, tmpfilename); ofn.lCustData = (LPARAM)(ok_testcases + i); - ofn.lpfnHook = ok_testcases[i].do_subclass - ? (LPOFNHOOKPROC) ok_template_hook - : (LPOFNHOOKPROC) test_ok_wndproc; + ofn.lpfnHook = ok_testcases[i].do_subclass ? ok_template_hook : test_ok_wndproc; ret = GetOpenFileNameA(&ofn); ok( ok_testcases[i].expclose == ok_testcases[i].actclose, "testid %d: Open File dialog should %shave closed.\n", i, @@ -706,7 +704,7 @@ static struct { { -1 } }; -static LONG_PTR WINAPI template_hook_arrange(HWND dlgChild, UINT msg, WPARAM wParam, LPARAM lParam) +static UINT_PTR WINAPI template_hook_arrange(HWND dlgChild, UINT msg, WPARAM wParam, LPARAM lParam) { static int index, fixhelp; static posz posz0[2]; @@ -846,7 +844,7 @@ static void test_arrange(void) ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400A; ofn.lpstrFile = filename; ofn.nMaxFile = 1024; - ofn.lpfnHook = (LPOFNHOOKPROC)template_hook_arrange; + ofn.lpfnHook = template_hook_arrange; ofn.hInstance = hDlgTmpl; ofn.lpstrFilter="text\0*.txt\0All\0*\0\0"; for( i = 0; arrange_tests[i].nrcontrols != -1; i++) { @@ -996,7 +994,7 @@ static void test_mru(void) ofn.hInstance = GetModuleHandle(NULL); ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER | OFN_ENABLETEMPLATE | OFN_NOCHANGEDIR; ofn.lCustData = (LPARAM)&testcase; - ofn.lpfnHook = (LPOFNHOOKPROC)test_ok_wndproc; + ofn.lpfnHook = test_ok_wndproc; SetLastError(0xdeadbeef); ret = CreateDirectoryA(test_dir_name, NULL);
1
0
0
0
Michael Stefaniuc : shell32: Use the proper type for a function pointer field.
by Alexandre Julliard
20 Nov '12
20 Nov '12
Module: wine Branch: master Commit: 0705793eb0abf9e716dfd7407dda1348bbf32484 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0705793eb0abf9e716dfd7407…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Tue Nov 20 13:13:18 2012 +0100 shell32: Use the proper type for a function pointer field. --- dlls/shell32/shellord.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/shell32/shellord.c b/dlls/shell32/shellord.c index 7f329de..c1fb382 100644 --- a/dlls/shell32/shellord.c +++ b/dlls/shell32/shellord.c @@ -60,7 +60,7 @@ typedef struct tagCREATEMRULIST DWORD dwFlags; /* see below */ HKEY hKey; /* root reg. key under which list is saved */ LPCSTR lpszSubKey; /* reg. subkey */ - PROC lpfnCompare; /* item compare proc */ + int (CALLBACK *lpfnCompare)(LPCVOID, LPCVOID, DWORD); /* item compare proc */ } CREATEMRULISTA, *LPCREATEMRULISTA; /* dwFlags */ @@ -927,7 +927,7 @@ void WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv) mymru.dwFlags = MRUF_BINARY_LIST | MRUF_DELAYED_SAVE; mymru.hKey = HCUbasekey; mymru.lpszSubKey = "RecentDocs"; - mymru.lpfnCompare = (PROC)SHADD_compare_mru; + mymru.lpfnCompare = SHADD_compare_mru; mruhandle = CreateMRUListA(&mymru); if (!mruhandle) { /* MRU failed */
1
0
0
0
Alexandre Julliard : user32: Make sure the scroll button arrows are really at least 3 pixels.
by Alexandre Julliard
20 Nov '12
20 Nov '12
Module: wine Branch: master Commit: 4428049a7a77069330d77b6fccb7aab3537d1003 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4428049a7a77069330d77b6fc…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Nov 20 19:46:46 2012 +0100 user32: Make sure the scroll button arrows are really at least 3 pixels. --- dlls/user32/uitools.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/dlls/user32/uitools.c b/dlls/user32/uitools.c index f1ce0d6..a21ab7b 100644 --- a/dlls/user32/uitools.c +++ b/dlls/user32/uitools.c @@ -1001,8 +1001,7 @@ static BOOL UITOOLS95_DrawFrameScroll(HDC dc, LPRECT r, UINT uFlags) * with the updown control. * Making sure that the arrow is as least 3 pixels wide (or high). */ - if (tri == 0) - tri = 1; + tri = max( 2, tri ); switch(uFlags & 0xff) {
1
0
0
0
Alexandre Julliard : comctl32/tests: Add some initial pager tests.
by Alexandre Julliard
20 Nov '12
20 Nov '12
Module: wine Branch: master Commit: c3f0abfa405996805707243c3d60f7629ae14090 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c3f0abfa405996805707243c3…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Nov 20 17:21:08 2012 +0100 comctl32/tests: Add some initial pager tests. --- dlls/comctl32/tests/Makefile.in | 1 + dlls/comctl32/tests/pager.c | 204 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 205 insertions(+), 0 deletions(-) diff --git a/dlls/comctl32/tests/Makefile.in b/dlls/comctl32/tests/Makefile.in index 145c125..670f52e 100644 --- a/dlls/comctl32/tests/Makefile.in +++ b/dlls/comctl32/tests/Makefile.in @@ -12,6 +12,7 @@ C_SRCS = \ misc.c \ monthcal.c \ mru.c \ + pager.c \ progress.c \ propsheet.c \ rebar.c \ diff --git a/dlls/comctl32/tests/pager.c b/dlls/comctl32/tests/pager.c new file mode 100644 index 0000000..8ac062d --- /dev/null +++ b/dlls/comctl32/tests/pager.c @@ -0,0 +1,204 @@ +/* + * Unit tests for the pager control + * + * Copyright 2012 Alexandre Julliard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <windows.h> +#include <commctrl.h> + +#include "wine/test.h" +#include "msg.h" + +#define NUM_MSG_SEQUENCES 1 +#define PAGER_SEQ_INDEX 0 + +static HWND parent_wnd; + +static BOOL (WINAPI *pSetWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR, DWORD_PTR); + +static struct msg_sequence *sequences[NUM_MSG_SEQUENCES]; + +static const struct message set_child_seq[] = { + { PGM_SETCHILD, sent }, + { WM_WINDOWPOSCHANGING, sent }, + { WM_NCCALCSIZE, sent|wparam, TRUE }, + { WM_NOTIFY, sent|id|parent, 0, 0, PGN_CALCSIZE }, + { WM_WINDOWPOSCHANGED, sent }, + { 0 } +}; + +static const struct message set_pos_seq[] = { + { PGM_SETPOS, sent }, + { WM_WINDOWPOSCHANGING, sent }, + { WM_NCCALCSIZE, sent|wparam, TRUE }, + { WM_NOTIFY, sent|id|parent, 0, 0, PGN_CALCSIZE }, + { WM_WINDOWPOSCHANGED, sent }, + { WM_MOVE, sent|optional }, + { WM_SIZE, sent|optional }, + { 0 } +}; + +static const struct message set_pos_empty_seq[] = { + { PGM_SETPOS, sent }, + { 0 } +}; + +static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + static LONG defwndproc_counter = 0; + LRESULT ret; + struct message msg; + + /* log system messages, except for painting */ + if (message < WM_USER && + message != WM_PAINT && + message != WM_ERASEBKGND && + message != WM_NCPAINT && + message != WM_NCHITTEST && + message != WM_GETTEXT && + message != WM_GETICON && + message != WM_DEVICECHANGE) + { + trace("parent: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam); + + msg.message = message; + msg.flags = sent|wparam|lparam|parent; + if (defwndproc_counter) msg.flags |= defwinproc; + msg.wParam = wParam; + msg.lParam = lParam; + if (message == WM_NOTIFY && lParam) msg.id = ((NMHDR*)lParam)->code; + add_message(sequences, PAGER_SEQ_INDEX, &msg); + } + + defwndproc_counter++; + ret = DefWindowProcA(hwnd, message, wParam, lParam); + defwndproc_counter--; + + return ret; +} + +static BOOL register_parent_wnd_class(void) +{ + WNDCLASSA cls; + + cls.style = 0; + cls.lpfnWndProc = parent_wnd_proc; + cls.cbClsExtra = 0; + cls.cbWndExtra = 0; + cls.hInstance = GetModuleHandleA(NULL); + cls.hIcon = 0; + cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hbrBackground = GetStockObject(WHITE_BRUSH); + cls.lpszMenuName = NULL; + cls.lpszClassName = "Pager test parent class"; + return RegisterClassA(&cls); +} + +static HWND create_parent_window(void) +{ + if (!register_parent_wnd_class()) + return NULL; + + return CreateWindow("Pager test parent class", "Pager test parent window", + WS_OVERLAPPED | WS_VISIBLE, + 0, 0, 200, 200, 0, NULL, GetModuleHandleA(NULL), NULL ); +} + +static LRESULT WINAPI pager_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + WNDPROC oldproc = (WNDPROC)GetWindowLongPtrA(hwnd, GWLP_USERDATA); + struct message msg; + + trace("pager: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam); + + msg.message = message; + msg.flags = sent|wparam|lparam; + msg.wParam = wParam; + msg.lParam = lParam; + msg.id = 0; + add_message(sequences, PAGER_SEQ_INDEX, &msg); + return CallWindowProcA(oldproc, hwnd, message, wParam, lParam); +} + +static HWND create_pager_control( DWORD style ) +{ + WNDPROC oldproc; + HWND hwnd; + RECT rect; + + GetClientRect( parent_wnd, &rect ); + hwnd = CreateWindowA( WC_PAGESCROLLERA, "pager", WS_CHILD | WS_BORDER | WS_VISIBLE | style, + 0, 0, 100, 100, parent_wnd, 0, GetModuleHandleA(0), 0 ); + oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)pager_subclass_proc); + SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)oldproc); + return hwnd; +} + +static void test_pager(void) +{ + HWND pager, child; + RECT rect; + + pager = create_pager_control( PGS_HORZ ); + if (!pager) + { + win_skip( "Pager control not supported\n" ); + return; + } + child = CreateWindowA( "BUTTON", "button", WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 300, 300, + pager, 0, GetModuleHandleA(0), 0 ); + + flush_sequences( sequences, NUM_MSG_SEQUENCES ); + SendMessageA( pager, PGM_SETCHILD, 0, (LPARAM)child ); + ok_sequence(sequences, PAGER_SEQ_INDEX, set_child_seq, "set child", TRUE); + GetWindowRect( pager, &rect ); + ok( rect.right - rect.left == 100 && rect.bottom - rect.top == 100, + "pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top ); + + flush_sequences( sequences, NUM_MSG_SEQUENCES ); + SendMessageA( pager, PGM_SETPOS, 0, 10 ); + ok_sequence(sequences, PAGER_SEQ_INDEX, set_pos_seq, "set pos", TRUE); + GetWindowRect( pager, &rect ); + ok( rect.right - rect.left == 100 && rect.bottom - rect.top == 100, + "pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top ); + + flush_sequences( sequences, NUM_MSG_SEQUENCES ); + SendMessageA( pager, PGM_SETPOS, 0, 10 ); + ok_sequence(sequences, PAGER_SEQ_INDEX, set_pos_empty_seq, "set pos empty", TRUE); + + flush_sequences( sequences, NUM_MSG_SEQUENCES ); + SendMessageA( pager, PGM_SETPOS, 0, 9 ); + ok_sequence(sequences, PAGER_SEQ_INDEX, set_pos_seq, "set pos", TRUE); + + DestroyWindow( pager ); +} + +START_TEST(pager) +{ + HMODULE mod = GetModuleHandleA("comctl32.dll"); + + pSetWindowSubclass = (void*)GetProcAddress(mod, (LPSTR)410); + + InitCommonControls(); + init_msg_sequences(sequences, NUM_MSG_SEQUENCES); + + parent_wnd = create_parent_window(); + ok(parent_wnd != NULL, "Failed to create parent window!\n"); + + test_pager(); +}
1
0
0
0
Alexandre Julliard : comctl32/pager: Don' t rely on PGN_CALCSIZE to set the non-scrollable dimension of the control.
by Alexandre Julliard
20 Nov '12
20 Nov '12
Module: wine Branch: master Commit: 3ad9f29e02208c628d8b00bdd0384bac3d97610d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3ad9f29e02208c628d8b00bdd…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Nov 20 17:18:17 2012 +0100 comctl32/pager: Don't rely on PGN_CALCSIZE to set the non-scrollable dimension of the control. --- dlls/comctl32/pager.c | 109 +++++++----------------------------------------- 1 files changed, 16 insertions(+), 93 deletions(-) diff --git a/dlls/comctl32/pager.c b/dlls/comctl32/pager.c index d541374..3b2c11c 100644 --- a/dlls/comctl32/pager.c +++ b/dlls/comctl32/pager.c @@ -205,22 +205,24 @@ PAGER_GetBkColor(const PAGER_INFO *infoPtr) } static void -PAGER_CalcSize (const PAGER_INFO *infoPtr, INT* size, BOOL getWidth) +PAGER_CalcSize( PAGER_INFO *infoPtr ) { NMPGCALCSIZE nmpgcs; ZeroMemory (&nmpgcs, sizeof (NMPGCALCSIZE)); nmpgcs.hdr.hwndFrom = infoPtr->hwndSelf; nmpgcs.hdr.idFrom = GetWindowLongPtrW (infoPtr->hwndSelf, GWLP_ID); nmpgcs.hdr.code = PGN_CALCSIZE; - nmpgcs.dwFlag = getWidth ? PGF_CALCWIDTH : PGF_CALCHEIGHT; - nmpgcs.iWidth = getWidth ? *size : 0; - nmpgcs.iHeight = getWidth ? 0 : *size; + nmpgcs.dwFlag = (infoPtr->dwStyle & PGS_HORZ) ? PGF_CALCWIDTH : PGF_CALCHEIGHT; + nmpgcs.iWidth = infoPtr->nWidth; + nmpgcs.iHeight = infoPtr->nHeight; SendMessageW (infoPtr->hwndNotify, WM_NOTIFY, nmpgcs.hdr.idFrom, (LPARAM)&nmpgcs); - *size = getWidth ? nmpgcs.iWidth : nmpgcs.iHeight; + if (infoPtr->dwStyle & PGS_HORZ) + infoPtr->nWidth = nmpgcs.iWidth; + else + infoPtr->nHeight = nmpgcs.iHeight; - TRACE("[%p] PGN_CALCSIZE returns %s=%d\n", infoPtr->hwndSelf, - getWidth ? "width" : "height", *size); + TRACE("[%p] PGN_CALCSIZE returns %dx%d\n", infoPtr->hwndSelf, nmpgcs.iWidth, nmpgcs.iHeight ); } static void @@ -281,16 +283,15 @@ PAGER_GetScrollRange(PAGER_INFO* infoPtr) RECT wndRect; GetWindowRect(infoPtr->hwndSelf, &wndRect); + PAGER_CalcSize(infoPtr); if (infoPtr->dwStyle & PGS_HORZ) { wndSize = wndRect.right - wndRect.left; - PAGER_CalcSize(infoPtr, &infoPtr->nWidth, TRUE); childSize = infoPtr->nWidth; } else { wndSize = wndRect.bottom - wndRect.top; - PAGER_CalcSize(infoPtr, &infoPtr->nHeight, FALSE); childSize = infoPtr->nHeight; } @@ -415,68 +416,6 @@ PAGER_WindowPosChanging(PAGER_INFO* infoPtr, WINDOWPOS *winpos) return DefWindowProcW (infoPtr->hwndSelf, WM_WINDOWPOSCHANGING, 0, (LPARAM)winpos); } -static INT -PAGER_SetFixedWidth(PAGER_INFO* infoPtr) -{ - /* Must set the non-scrollable dimension to be less than the full height/width - * so that NCCalcSize is called. The Microsoft docs mention 3/4 factor for button - * size, and experimentation shows that the effect is almost right. */ - - RECT wndRect; - INT delta, h; - GetWindowRect(infoPtr->hwndSelf, &wndRect); - - /* see what the app says for btn width */ - PAGER_CalcSize(infoPtr, &infoPtr->nWidth, TRUE); - - if (infoPtr->dwStyle & CCS_NORESIZE) - { - delta = wndRect.right - wndRect.left - infoPtr->nWidth; - if (delta > infoPtr->nButtonSize) - infoPtr->nWidth += 4 * infoPtr->nButtonSize / 3; - else if (delta > 0) - infoPtr->nWidth += infoPtr->nButtonSize / 3; - } - - h = wndRect.bottom - wndRect.top + infoPtr->nButtonSize; - - TRACE("[%p] infoPtr->nWidth set to %d\n", - infoPtr->hwndSelf, infoPtr->nWidth); - - return h; -} - -static INT -PAGER_SetFixedHeight(PAGER_INFO* infoPtr) -{ - /* Must set the non-scrollable dimension to be less than the full height/width - * so that NCCalcSize is called. The Microsoft docs mention 3/4 factor for button - * size, and experimentation shows that the effect is almost right. */ - - RECT wndRect; - INT delta, w; - GetWindowRect(infoPtr->hwndSelf, &wndRect); - - /* see what the app says for btn height */ - PAGER_CalcSize(infoPtr, &infoPtr->nHeight, FALSE); - - if (infoPtr->dwStyle & CCS_NORESIZE) - { - delta = wndRect.bottom - wndRect.top - infoPtr->nHeight; - if (delta > infoPtr->nButtonSize) - infoPtr->nHeight += infoPtr->nButtonSize; - else if (delta > 0) - infoPtr->nHeight += infoPtr->nButtonSize / 3; - } - - w = wndRect.right - wndRect.left + infoPtr->nButtonSize; - - TRACE("[%p] infoPtr->nHeight set to %d\n", - infoPtr->hwndSelf, infoPtr->nHeight); - - return w; -} - /****************************************************************** * For the PGM_RECALCSIZE message (but not the other uses in * * this module), the native control does only the following: * @@ -561,28 +500,14 @@ PAGER_SetButtonSize (PAGER_INFO* infoPtr, INT iButtonSize) static LRESULT PAGER_SetChild (PAGER_INFO* infoPtr, HWND hwndChild) { - INT hw; - infoPtr->hwndChild = IsWindow (hwndChild) ? hwndChild : 0; if (infoPtr->hwndChild) { TRACE("[%p] hwndChild=%p\n", infoPtr->hwndSelf, infoPtr->hwndChild); - if (infoPtr->dwStyle & PGS_HORZ) { - hw = PAGER_SetFixedHeight(infoPtr); - /* adjust non-scrollable dimension to fit the child */ - SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, hw, infoPtr->nHeight, - SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOZORDER | - SWP_NOSIZE | SWP_NOACTIVATE); - } - else { - hw = PAGER_SetFixedWidth(infoPtr); - /* adjust non-scrollable dimension to fit the child */ - SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, infoPtr->nWidth, hw, - SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOZORDER | - SWP_NOSIZE | SWP_NOACTIVATE); - } + SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, 0, 0, + SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE); /* position child within the page scroller */ SetWindowPos(infoPtr->hwndChild, HWND_TOP, @@ -721,11 +646,12 @@ PAGER_NCCalcSize(PAGER_INFO* infoPtr, WPARAM wParam, LPRECT lpRect) MapWindowPoints (0, infoPtr->hwndSelf, (LPPOINT)&rcChild, 2); /* FIXME: RECT != 2 POINTS */ GetWindowRect (infoPtr->hwndSelf, &rcWindow); + infoPtr->nWidth = lpRect->right - lpRect->left; + infoPtr->nHeight = lpRect->bottom - lpRect->top; + PAGER_CalcSize( infoPtr ); + if (infoPtr->dwStyle & PGS_HORZ) { - infoPtr->nWidth = lpRect->right - lpRect->left; - PAGER_CalcSize (infoPtr, &infoPtr->nWidth, TRUE); - if (infoPtr->TLbtnState && (lpRect->left + infoPtr->nButtonSize < lpRect->right)) lpRect->left += infoPtr->nButtonSize; if (infoPtr->BRbtnState && (lpRect->right - infoPtr->nButtonSize > lpRect->left)) @@ -733,9 +659,6 @@ PAGER_NCCalcSize(PAGER_INFO* infoPtr, WPARAM wParam, LPRECT lpRect) } else { - infoPtr->nHeight = lpRect->bottom - lpRect->top; - PAGER_CalcSize (infoPtr, &infoPtr->nHeight, FALSE); - if (infoPtr->TLbtnState && (lpRect->top + infoPtr->nButtonSize < lpRect->bottom)) lpRect->top += infoPtr->nButtonSize; if (infoPtr->BRbtnState && (lpRect->bottom - infoPtr->nButtonSize > lpRect->top))
1
0
0
0
Alexandre Julliard : comctl32/pager: Fix tracking of mouse position inside the buttons.
by Alexandre Julliard
20 Nov '12
20 Nov '12
Module: wine Branch: master Commit: 7a78eed463903639f39458b23b6e8403963f8367 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7a78eed463903639f39458b23…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Nov 20 16:02:09 2012 +0100 comctl32/pager: Fix tracking of mouse position inside the buttons. --- dlls/comctl32/pager.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/comctl32/pager.c b/dlls/comctl32/pager.c index c270723..d541374 100644 --- a/dlls/comctl32/pager.c +++ b/dlls/comctl32/pager.c @@ -314,9 +314,10 @@ PAGER_UpdateBtns(PAGER_INFO *infoPtr, INT scrollRange, BOOL hideGrayBtns) RECT rcTopLeft, rcBottomRight; /* get button rects */ - PAGER_GetButtonRects(infoPtr, &rcTopLeft, &rcBottomRight, FALSE); + PAGER_GetButtonRects(infoPtr, &rcTopLeft, &rcBottomRight, TRUE); GetCursorPos(&pt); + ScreenToClient( infoPtr->hwndSelf, &pt ); /* update states based on scroll position */ if (infoPtr->nPos > 0) @@ -324,7 +325,7 @@ PAGER_UpdateBtns(PAGER_INFO *infoPtr, INT scrollRange, BOOL hideGrayBtns) if (infoPtr->TLbtnState == PGF_INVISIBLE || infoPtr->TLbtnState == PGF_GRAYED) infoPtr->TLbtnState = PGF_NORMAL; } - else if (PtInRect(&rcTopLeft, pt)) + else if (!hideGrayBtns && PtInRect(&rcTopLeft, pt)) infoPtr->TLbtnState = PGF_GRAYED; else infoPtr->TLbtnState = PGF_INVISIBLE; @@ -339,7 +340,7 @@ PAGER_UpdateBtns(PAGER_INFO *infoPtr, INT scrollRange, BOOL hideGrayBtns) if (infoPtr->BRbtnState == PGF_INVISIBLE || infoPtr->BRbtnState == PGF_GRAYED) infoPtr->BRbtnState = PGF_NORMAL; } - else if (PtInRect(&rcBottomRight, pt)) + else if (!hideGrayBtns && PtInRect(&rcBottomRight, pt)) infoPtr->BRbtnState = PGF_GRAYED; else infoPtr->BRbtnState = PGF_INVISIBLE;
1
0
0
0
Alexandre Julliard : comctl32/pager: Use DrawFrameControl to paint the buttons.
by Alexandre Julliard
20 Nov '12
20 Nov '12
Module: wine Branch: master Commit: f3b8e68296767f77da98f944d332fc996a047e68 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f3b8e68296767f77da98f944d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Nov 20 16:01:47 2012 +0100 comctl32/pager: Use DrawFrameControl to paint the buttons. --- dlls/comctl32/pager.c | 173 ++++++------------------------------------------- 1 files changed, 20 insertions(+), 153 deletions(-) diff --git a/dlls/comctl32/pager.c b/dlls/comctl32/pager.c index e1420e0..c270723 100644 --- a/dlls/comctl32/pager.c +++ b/dlls/comctl32/pager.c @@ -84,9 +84,6 @@ typedef struct INT direction; /* direction of the scroll, (e.g. PGF_SCROLLUP) */ } PAGER_INFO; -#define MIN_ARROW_WIDTH 8 -#define MIN_ARROW_HEIGHT 5 - #define TIMERID1 1 #define TIMERID2 2 #define INITIAL_DELAY 500 @@ -116,115 +113,13 @@ PAGER_GetButtonRects(const PAGER_INFO* infoPtr, RECT* prcTopLeft, RECT* prcBotto } } -/* the horizontal arrows are: - * - * 01234 01234 - * 1 * * - * 2 ** ** - * 3*** *** - * 4*** *** - * 5 ** ** - * 6 * * - * 7 - * - */ -static void -PAGER_DrawHorzArrow (HDC hdc, RECT r, INT colorRef, BOOL left) -{ - INT x, y, w, h; - HPEN hPen, hOldPen; - - w = r.right - r.left + 1; - h = r.bottom - r.top + 1; - if ((h < MIN_ARROW_WIDTH) || (w < MIN_ARROW_HEIGHT)) - return; /* refuse to draw partial arrow */ - - if (!(hPen = CreatePen( PS_SOLID, 1, GetSysColor( colorRef )))) return; - hOldPen = SelectObject ( hdc, hPen ); - if (left) - { - x = r.left + ((w - MIN_ARROW_HEIGHT) / 2) + 3; - y = r.top + ((h - MIN_ARROW_WIDTH) / 2) + 1; - MoveToEx (hdc, x, y, NULL); - LineTo (hdc, x--, y+5); y++; - MoveToEx (hdc, x, y, NULL); - LineTo (hdc, x--, y+3); y++; - MoveToEx (hdc, x, y, NULL); - LineTo (hdc, x, y+1); - } - else - { - x = r.left + ((w - MIN_ARROW_HEIGHT) / 2) + 1; - y = r.top + ((h - MIN_ARROW_WIDTH) / 2) + 1; - MoveToEx (hdc, x, y, NULL); - LineTo (hdc, x++, y+5); y++; - MoveToEx (hdc, x, y, NULL); - LineTo (hdc, x++, y+3); y++; - MoveToEx (hdc, x, y, NULL); - LineTo (hdc, x, y+1); - } - - SelectObject( hdc, hOldPen ); - DeleteObject( hPen ); -} - -/* the vertical arrows are: - * - * 01234567 01234567 - * 1****** ** - * 2 **** **** - * 3 ** ****** - * 4 - * - */ -static void -PAGER_DrawVertArrow (HDC hdc, RECT r, INT colorRef, BOOL up) -{ - INT x, y, w, h; - HPEN hPen, hOldPen; - - w = r.right - r.left + 1; - h = r.bottom - r.top + 1; - if ((h < MIN_ARROW_WIDTH) || (w < MIN_ARROW_HEIGHT)) - return; /* refuse to draw partial arrow */ - - if (!(hPen = CreatePen( PS_SOLID, 1, GetSysColor( colorRef )))) return; - hOldPen = SelectObject ( hdc, hPen ); - if (up) - { - x = r.left + ((w - MIN_ARROW_HEIGHT) / 2) + 1; - y = r.top + ((h - MIN_ARROW_WIDTH) / 2) + 3; - MoveToEx (hdc, x, y, NULL); - LineTo (hdc, x+5, y--); x++; - MoveToEx (hdc, x, y, NULL); - LineTo (hdc, x+3, y--); x++; - MoveToEx (hdc, x, y, NULL); - LineTo (hdc, x+1, y); - } - else - { - x = r.left + ((w - MIN_ARROW_HEIGHT) / 2) + 1; - y = r.top + ((h - MIN_ARROW_WIDTH) / 2) + 1; - MoveToEx (hdc, x, y, NULL); - LineTo (hdc, x+5, y++); x++; - MoveToEx (hdc, x, y, NULL); - LineTo (hdc, x+3, y++); x++; - MoveToEx (hdc, x, y, NULL); - LineTo (hdc, x+1, y); - } - - SelectObject( hdc, hOldPen ); - DeleteObject( hPen ); -} - static void -PAGER_DrawButton(HDC hdc, COLORREF clrBk, RECT arrowRect, +PAGER_DrawButton(HDC hdc, COLORREF clrBk, RECT rc, BOOL horz, BOOL topLeft, INT btnState) { - HBRUSH hBrush, hOldBrush; - RECT rc = arrowRect; + UINT flags; - TRACE("arrowRect = %s, btnState = %d\n", wine_dbgstr_rect(&arrowRect), btnState); + TRACE("rc = %s, btnState = %d\n", wine_dbgstr_rect(&rc), btnState); if (btnState == PGF_INVISIBLE) return; @@ -232,54 +127,26 @@ PAGER_DrawButton(HDC hdc, COLORREF clrBk, RECT arrowRect, if ((rc.right - rc.left <= 0) || (rc.bottom - rc.top <= 0)) return; - hBrush = CreateSolidBrush(clrBk); - hOldBrush = SelectObject(hdc, hBrush); - - FillRect(hdc, &rc, hBrush); + if (horz) + flags = topLeft ? DFCS_SCROLLLEFT : DFCS_SCROLLRIGHT; + else + flags = topLeft ? DFCS_SCROLLUP : DFCS_SCROLLDOWN; - if (btnState == PGF_HOT) + switch (btnState) { - DrawEdge( hdc, &rc, BDR_RAISEDINNER, BF_RECT); - if (horz) - PAGER_DrawHorzArrow(hdc, rc, COLOR_WINDOWFRAME, topLeft); - else - PAGER_DrawVertArrow(hdc, rc, COLOR_WINDOWFRAME, topLeft); - } - else if (btnState == PGF_NORMAL) - { - DrawEdge (hdc, &rc, BDR_OUTER, BF_FLAT); - if (horz) - PAGER_DrawHorzArrow(hdc, rc, COLOR_WINDOWFRAME, topLeft); - else - PAGER_DrawVertArrow(hdc, rc, COLOR_WINDOWFRAME, topLeft); - } - else if (btnState == PGF_DEPRESSED) - { - DrawEdge( hdc, &rc, BDR_SUNKENOUTER, BF_RECT); - if (horz) - PAGER_DrawHorzArrow(hdc, rc, COLOR_WINDOWFRAME, topLeft); - else - PAGER_DrawVertArrow(hdc, rc, COLOR_WINDOWFRAME, topLeft); - } - else if (btnState == PGF_GRAYED) - { - DrawEdge (hdc, &rc, BDR_OUTER, BF_FLAT); - if (horz) - { - PAGER_DrawHorzArrow(hdc, rc, COLOR_3DHIGHLIGHT, topLeft); - rc.left++, rc.top++; rc.right++, rc.bottom++; - PAGER_DrawHorzArrow(hdc, rc, COLOR_3DSHADOW, topLeft); - } - else - { - PAGER_DrawVertArrow(hdc, rc, COLOR_3DHIGHLIGHT, topLeft); - rc.left++, rc.top++; rc.right++, rc.bottom++; - PAGER_DrawVertArrow(hdc, rc, COLOR_3DSHADOW, topLeft); - } + case PGF_HOT: + break; + case PGF_NORMAL: + flags |= DFCS_FLAT; + break; + case PGF_DEPRESSED: + flags |= DFCS_PUSHED; + break; + case PGF_GRAYED: + flags |= DFCS_INACTIVE | DFCS_FLAT; + break; } - - SelectObject( hdc, hOldBrush ); - DeleteObject(hBrush); + DrawFrameControl( hdc, &rc, DFC_SCROLL, flags ); } /* << PAGER_GetDropTarget >> */
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
71
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Results per page:
10
25
50
100
200