[COMCTL32] Sync with Wine Staging 2.9. CORE-13362

9abd3d1 comctl32: fix buttons becoming unthemed when pressed/released
8967e87 comctl32/taskdialog: Display content text label.
65d64e1 comctl32/listview: Simplify a couple of conditions that are using LVFI_PARTIAL.
407a3c0 comctl32/listview: Search through all items in LVFI_NEARESTXY mode.
5fe4493 comctl32/listview: When adding a scrollbar, update the other one.
8ef79b0 comctl32/listview: Convert item text once when looking for insertion point.
791924a comctl32/listview: Remove internal autoarrange flag, it breaks positioning.
b1d46e0 comctl32/taskdialog: Remove superfluous title pointer check (Coverity).
48c4edd comctl32/pager: Prevent excessive PGN_CALCSIZE notifications during PGM_SETCHILD.
d6a6055 comctl32: Improve right-click handling in treeview controls.
6926564 comctl32: Don't touch the new child twice in PGM_SETCHILD.
995b690 comctl32/taskdialog: Initial implementation of a minimal task dialog.
e2245bc comctl32/taskdialog: Move TaskDialogIndirect and its tests into own source files.
429705e comctl32/propsheet: Implement PSPCB_ADDREF/PSPCB_RELEASE notifications.
a3aa217 comctl32/propsheet: Enforce minimal PROPSHEETPAGE structure size when creating a page.
b7cc440 comctl32: Update the tooltip rectangle when a tool button is hidden.
690022c comctl32: Return TRUE from LVM_REDRAWITEMS with bad indices.

svn path=/trunk/; revision=74902
This commit is contained in:
Amine Khaldi 2017-06-04 12:53:17 +00:00
parent 3a104c8f20
commit b44a9ed6f6
46 changed files with 1085 additions and 129 deletions

View file

@ -37,6 +37,7 @@ list(APPEND SOURCE
string.c
syslink.c
tab.c
taskdialog.c
theme_button.c
theme_combo.c
theme_dialog.c

View file

@ -45,8 +45,9 @@
#include <uxtheme.h>
#include <vssym32.h>
#include <wine/unicode.h>
#include <wine/debug.h>
#include <wine/list.h>
#include <wine/unicode.h>
#include "resource.h"

View file

@ -60,6 +60,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(commctrl);
static LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static LPWSTR COMCTL32_wSubclass = NULL;
@ -1949,45 +1950,6 @@ int WINAPI DrawShadowText(HDC hdc, LPCWSTR pszText, UINT cch, RECT *prc, DWORD d
return iRet;
}
/***********************************************************************
* TaskDialogIndirect [COMCTL32.@]
*/
HRESULT WINAPI TaskDialogIndirect(const TASKDIALOGCONFIG *pTaskConfig, int *pnButton,
int *pnRadioButton, BOOL *pfVerificationFlagChecked)
{
UINT uType = 0;
INT ret;
FIXME("%p, %p, %p, %p\n", pTaskConfig, pnButton, pnRadioButton, pfVerificationFlagChecked);
if (pTaskConfig->dwCommonButtons & TDCBF_YES_BUTTON &&
pTaskConfig->dwCommonButtons & TDCBF_NO_BUTTON &&
pTaskConfig->dwCommonButtons & TDCBF_CANCEL_BUTTON)
uType |= MB_YESNOCANCEL;
else
if (pTaskConfig->dwCommonButtons & TDCBF_YES_BUTTON &&
pTaskConfig->dwCommonButtons & TDCBF_NO_BUTTON)
uType |= MB_YESNO;
else
if (pTaskConfig->dwCommonButtons & TDCBF_RETRY_BUTTON &&
pTaskConfig->dwCommonButtons & TDCBF_CANCEL_BUTTON)
uType |= MB_RETRYCANCEL;
else
if (pTaskConfig->dwCommonButtons & TDCBF_OK_BUTTON &&
pTaskConfig->dwCommonButtons & TDCBF_CANCEL_BUTTON)
uType |= MB_OKCANCEL;
else
if (pTaskConfig->dwCommonButtons & TDCBF_OK_BUTTON)
uType |= MB_OK;
ret = MessageBoxW(pTaskConfig->hwndParent, pTaskConfig->pszMainInstruction,
pTaskConfig->pszWindowTitle, uType);
FIXME("dwCommonButtons=%x uType=%x ret=%x\n", pTaskConfig->dwCommonButtons, uType, ret);
if (pnButton) *pnButton = ret;
if (pnRadioButton) *pnRadioButton = pTaskConfig->nDefaultButton;
if (pfVerificationFlagChecked) *pfVerificationFlagChecked = TRUE;
return S_OK;
}
/***********************************************************************
* LoadIconWithScaleDown [COMCTL32.@]
*/

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "Нищо"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Свойства на %s"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "Žádný"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Vlastnosti %s"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "Ingen"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Egenskaper for %s"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "Kein"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Eigenschaften für %s"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "Κανένα"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Ιδιότητες για %s"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "None"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Properties for %s"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "Neniu"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Ecoj laŭ %s"

View file

@ -43,6 +43,16 @@ STRINGTABLE
HKY_NONE "Ninguno"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Propiedades de %s"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "Aucune"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Propriétés de %s"

View file

@ -44,6 +44,16 @@ STRINGTABLE
HKY_NONE "אין"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "מאפיינים של %s"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "Semmi"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Tulajdonságok: %s"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "Nessuno"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Proprietà di %s"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "なし"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "%sのプロパティ"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "없음"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "%s 속성"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "Joks"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "%s savybės"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "Geen"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Eigenschappen voor %s"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "Ingen"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Egenskaper for %s"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "Brak"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Właściwości: %s"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "Nenhuma"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Propriedades de %s"

View file

@ -44,6 +44,16 @@ STRINGTABLE
HKY_NONE "Niciuna"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Proprietăți pentru %s"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "Нет"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Свойства: %s"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "Brez"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Lastnosti %s"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "Žiadne"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "%s - vlastnosti"

View file

@ -45,6 +45,16 @@ STRINGTABLE
HKY_NONE "Asnje"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Properties for %s"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "Nista"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Svojstva za %s"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "Ingen"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Egenskaper för %s"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "ไม่มีเลย"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "คุณสมบัติของ %s"

View file

@ -41,6 +41,16 @@ STRINGTABLE
HKY_NONE "Yok"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "%s Husûsiyetleri"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "無"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "%s內容"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "Немає"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Властивості для %s"

View file

@ -42,6 +42,16 @@ STRINGTABLE
HKY_NONE "无"
}
STRINGTABLE
{
IDS_BUTTON_YES "&Yes"
IDS_BUTTON_NO "&No"
IDS_BUTTON_RETRY "&Retry"
IDS_BUTTON_OK "OK"
IDS_BUTTON_CANCEL "Cancel"
IDS_BUTTON_CLOSE "&Close"
}
IDD_PROPSHEET DIALOGEX 0, 0, 220, 140
STYLE DS_SHELLFONT | DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "属性 %s"

View file

@ -230,7 +230,6 @@ typedef struct tagLISTVIEW_INFO
RANGES selectionRanges;
INT nSelectionMark; /* item to start next multiselection from */
INT nHotItem;
BOOL bAutoarrange; /* Autoarrange flag when NOT in LVS_AUTOARRANGE */
/* columns */
HDPA hdpaColumns; /* array of COLUMN_INFO pointers */
@ -1568,8 +1567,8 @@ static inline LRESULT CallWindowProcT(WNDPROC proc, HWND hwnd, UINT uMsg,
static inline BOOL is_autoarrange(const LISTVIEW_INFO *infoPtr)
{
return ((infoPtr->dwStyle & LVS_AUTOARRANGE) || infoPtr->bAutoarrange) &&
(infoPtr->uView == LV_VIEW_ICON || infoPtr->uView == LV_VIEW_SMALLICON);
return (infoPtr->dwStyle & LVS_AUTOARRANGE) &&
(infoPtr->uView == LV_VIEW_ICON || infoPtr->uView == LV_VIEW_SMALLICON);
}
static void toggle_checkbox_state(LISTVIEW_INFO *infoPtr, INT nItem)
@ -2016,23 +2015,10 @@ static void LISTVIEW_UpdateHeaderSize(const LISTVIEW_INFO *infoPtr, INT nNewScro
SWP_NOZORDER | SWP_NOACTIVATE);
}
/***
* DESCRIPTION:
* Update the scrollbars. This functions should be called whenever
* the content, size or view changes.
*
* PARAMETER(S):
* [I] infoPtr : valid pointer to the listview structure
*
* RETURN:
* None
*/
static void LISTVIEW_UpdateScroll(const LISTVIEW_INFO *infoPtr)
static INT LISTVIEW_UpdateHScroll(LISTVIEW_INFO *infoPtr)
{
SCROLLINFO horzInfo, vertInfo;
INT dx, dy;
if ((infoPtr->dwStyle & LVS_NOSCROLL) || !is_redrawing(infoPtr)) return;
SCROLLINFO horzInfo;
INT dx;
ZeroMemory(&horzInfo, sizeof(SCROLLINFO));
horzInfo.cbSize = sizeof(SCROLLINFO);
@ -2084,10 +2070,22 @@ static void LISTVIEW_UpdateScroll(const LISTVIEW_INFO *infoPtr)
dx -= SetScrollInfo(infoPtr->hwndSelf, SB_HORZ, &horzInfo, TRUE);
TRACE("horzInfo=%s\n", debugscrollinfo(&horzInfo));
/* Setting the horizontal scroll can change the listview size
* (and potentially everything else) so we need to recompute
* everything again for the vertical scroll
*/
/* Update the Header Control */
if (infoPtr->hwndHeader)
{
horzInfo.fMask = SIF_POS;
GetScrollInfo(infoPtr->hwndSelf, SB_HORZ, &horzInfo);
LISTVIEW_UpdateHeaderSize(infoPtr, horzInfo.nPos);
}
LISTVIEW_UpdateSize(infoPtr);
return dx;
}
static INT LISTVIEW_UpdateVScroll(LISTVIEW_INFO *infoPtr)
{
SCROLLINFO vertInfo;
INT dy;
ZeroMemory(&vertInfo, sizeof(SCROLLINFO));
vertInfo.cbSize = sizeof(SCROLLINFO);
@ -2117,6 +2115,37 @@ static void LISTVIEW_UpdateScroll(const LISTVIEW_INFO *infoPtr)
dy -= SetScrollInfo(infoPtr->hwndSelf, SB_VERT, &vertInfo, TRUE);
TRACE("vertInfo=%s\n", debugscrollinfo(&vertInfo));
LISTVIEW_UpdateSize(infoPtr);
return dy;
}
/***
* DESCRIPTION:
* Update the scrollbars. This function should be called whenever
* the content, size or view changes.
*
* PARAMETER(S):
* [I] infoPtr : valid pointer to the listview structure
*
* RETURN:
* None
*/
static void LISTVIEW_UpdateScroll(LISTVIEW_INFO *infoPtr)
{
INT dx, dy, pass;
if ((infoPtr->dwStyle & LVS_NOSCROLL) || !is_redrawing(infoPtr)) return;
/* Setting the horizontal scroll can change the listview size
* (and potentially everything else) so we need to recompute
* everything again for the vertical scroll and vice-versa
*/
for (dx = 0, dy = 0, pass = 0; pass <= 1; pass++)
{
dx += LISTVIEW_UpdateHScroll(infoPtr);
dy += LISTVIEW_UpdateVScroll(infoPtr);
}
/* Change of the range may have changed the scroll pos. If so move the content */
if (dx != 0 || dy != 0)
{
@ -2125,14 +2154,6 @@ static void LISTVIEW_UpdateScroll(const LISTVIEW_INFO *infoPtr)
ScrollWindowEx(infoPtr->hwndSelf, dx, dy, &listRect, &listRect, 0, 0,
SW_ERASE | SW_INVALIDATE);
}
/* Update the Header Control */
if (infoPtr->hwndHeader)
{
horzInfo.fMask = SIF_POS;
GetScrollInfo(infoPtr->hwndSelf, SB_HORZ, &horzInfo);
LISTVIEW_UpdateHeaderSize(infoPtr, horzInfo.nPos);
}
}
@ -2782,7 +2803,6 @@ static BOOL LISTVIEW_Arrange(LISTVIEW_INFO *infoPtr, INT nAlignCode)
default: return FALSE;
}
infoPtr->bAutoarrange = TRUE;
infoPtr->currIconPos.x = infoPtr->currIconPos.y = 0;
for (i = 0; i < infoPtr->nItemCount; i++)
{
@ -6331,8 +6351,7 @@ static INT LISTVIEW_FindItemW(const LISTVIEW_INFO *infoPtr, INT nStart,
if (!lpFindInfo || nItem < 0) return -1;
lvItem.mask = 0;
if (lpFindInfo->flags & (LVFI_STRING | LVFI_PARTIAL) ||
lpFindInfo->flags & LVFI_SUBSTRING)
if (lpFindInfo->flags & (LVFI_STRING | LVFI_PARTIAL | LVFI_SUBSTRING))
{
lvItem.mask |= LVIF_TEXT;
lvItem.pszText = szDispText;
@ -6379,6 +6398,8 @@ static INT LISTVIEW_FindItemW(const LISTVIEW_INFO *infoPtr, INT nStart,
lvItem.mask &= ~LVIF_TEXT;
}
nItem = bNearest ? -1 : nStart + 1;
again:
for (; nItem < nLast; nItem++)
{
@ -6454,14 +6475,13 @@ again:
static INT LISTVIEW_FindItemA(const LISTVIEW_INFO *infoPtr, INT nStart,
const LVFINDINFOA *lpFindInfo)
{
BOOL hasText = lpFindInfo->flags & (LVFI_STRING | LVFI_PARTIAL) ||
lpFindInfo->flags & LVFI_SUBSTRING;
LVFINDINFOW fiw;
INT res;
LPWSTR strW = NULL;
memcpy(&fiw, lpFindInfo, sizeof(fiw));
if (hasText) fiw.psz = strW = textdupTtoW((LPCWSTR)lpFindInfo->psz, FALSE);
if (lpFindInfo->flags & (LVFI_STRING | LVFI_PARTIAL | LVFI_SUBSTRING))
fiw.psz = strW = textdupTtoW((LPCWSTR)lpFindInfo->psz, FALSE);
res = LISTVIEW_FindItemW(infoPtr, nStart, &fiw);
textfreeT(strW, FALSE);
return res;
@ -7833,18 +7853,24 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
HDPA hItem;
ITEM_INFO *item_s;
INT i = 0, cmpv;
WCHAR *textW;
textW = textdupTtoW(lpLVItem->pszText, isW);
while (i < infoPtr->nItemCount)
{
hItem = DPA_GetPtr( infoPtr->hdpaItems, i);
item_s = DPA_GetPtr(hItem, 0);
cmpv = textcmpWT(item_s->hdr.pszText, lpLVItem->pszText, isW);
cmpv = textcmpWT(item_s->hdr.pszText, textW, TRUE);
if (infoPtr->dwStyle & LVS_SORTDESCENDING) cmpv *= -1;
if (cmpv >= 0) break;
i++;
}
textfreeT(textW, isW);
nItem = i;
}
else
@ -7996,12 +8022,8 @@ static BOOL LISTVIEW_IsItemVisible(const LISTVIEW_INFO *infoPtr, INT nItem)
static BOOL LISTVIEW_RedrawItems(const LISTVIEW_INFO *infoPtr, INT nFirst, INT nLast)
{
INT i;
if (nLast < nFirst || min(nFirst, nLast) < 0 ||
max(nFirst, nLast) >= infoPtr->nItemCount)
return FALSE;
for (i = nFirst; i <= nLast; i++)
for (i = max(nFirst, 0); i <= min(nLast, infoPtr->nItemCount - 1); i++)
LISTVIEW_InvalidateItem(infoPtr, i);
return TRUE;
@ -8950,8 +8972,6 @@ static BOOL LISTVIEW_SetItemPosition(LISTVIEW_INFO *infoPtr, INT nItem, const PO
Pt.x -= Origin.x;
Pt.y -= Origin.y;
infoPtr->bAutoarrange = FALSE;
return LISTVIEW_MoveIconTo(infoPtr, nItem, &Pt, FALSE);
}
@ -10637,10 +10657,15 @@ static BOOL LISTVIEW_NCPaint(const LISTVIEW_INFO *infoPtr, HRGN region)
CombineRgn (cliprgn, cliprgn, region, RGN_AND);
OffsetRect(&r, -r.left, -r.top);
#ifdef __REACTOS__ /* r73789 */
dc = GetWindowDC(infoPtr->hwndSelf);
/* Exclude client part */
ExcludeClipRect(dc, r.left + cxEdge, r.top + cyEdge,
r.right - cxEdge, r.bottom -cyEdge);
#else
dc = GetDCEx(infoPtr->hwndSelf, region, DCX_WINDOW|DCX_INTERSECTRGN);
OffsetRect(&r, -r.left, -r.top);
#endif
if (IsThemeBackgroundPartiallyTransparent (theme, 0, 0))
DrawThemeParentBackground(infoPtr->hwndSelf, dc, &r);

View file

@ -239,10 +239,9 @@ PAGER_PositionChildWnd(PAGER_INFO* infoPtr)
TRACE("[%p] SWP %dx%d at (%d,%d)\n", infoPtr->hwndSelf,
infoPtr->nWidth, infoPtr->nHeight,
-nPos, 0);
SetWindowPos(infoPtr->hwndChild, 0,
SetWindowPos(infoPtr->hwndChild, HWND_TOP,
-nPos, 0,
infoPtr->nWidth, infoPtr->nHeight,
SWP_NOZORDER);
infoPtr->nWidth, infoPtr->nHeight, 0);
}
else
{
@ -253,10 +252,9 @@ PAGER_PositionChildWnd(PAGER_INFO* infoPtr)
TRACE("[%p] SWP %dx%d at (%d,%d)\n", infoPtr->hwndSelf,
infoPtr->nWidth, infoPtr->nHeight,
0, -nPos);
SetWindowPos(infoPtr->hwndChild, 0,
SetWindowPos(infoPtr->hwndChild, HWND_TOP,
0, -nPos,
infoPtr->nWidth, infoPtr->nHeight,
SWP_NOZORDER);
infoPtr->nWidth, infoPtr->nHeight, 0);
}
InvalidateRect(infoPtr->hwndChild, NULL, TRUE);
@ -264,7 +262,7 @@ PAGER_PositionChildWnd(PAGER_INFO* infoPtr)
}
static INT
PAGER_GetScrollRange(PAGER_INFO* infoPtr)
PAGER_GetScrollRange(PAGER_INFO* infoPtr, BOOL calc_size)
{
INT scrollRange = 0;
@ -274,7 +272,8 @@ PAGER_GetScrollRange(PAGER_INFO* infoPtr)
RECT wndRect;
GetWindowRect(infoPtr->hwndSelf, &wndRect);
PAGER_CalcSize(infoPtr);
if (calc_size)
PAGER_CalcSize(infoPtr);
if (infoPtr->dwStyle & PGS_HORZ)
{
wndSize = wndRect.right - wndRect.left;
@ -355,9 +354,9 @@ PAGER_UpdateBtns(PAGER_INFO *infoPtr, INT scrollRange, BOOL hideGrayBtns)
}
static LRESULT
PAGER_SetPos(PAGER_INFO* infoPtr, INT newPos, BOOL fromBtnPress)
PAGER_SetPos(PAGER_INFO* infoPtr, INT newPos, BOOL fromBtnPress, BOOL calc_size)
{
INT scrollRange = PAGER_GetScrollRange(infoPtr);
INT scrollRange = PAGER_GetScrollRange(infoPtr, calc_size);
INT oldPos = infoPtr->nPos;
if ((scrollRange <= 0) || (newPos < 0))
@ -398,12 +397,12 @@ PAGER_RecalcSize(PAGER_INFO *infoPtr)
if (infoPtr->hwndChild)
{
INT scrollRange = PAGER_GetScrollRange(infoPtr);
INT scrollRange = PAGER_GetScrollRange(infoPtr, TRUE);
if (scrollRange <= 0)
{
infoPtr->nPos = -1;
PAGER_SetPos(infoPtr, 0, FALSE);
PAGER_SetPos(infoPtr, 0, FALSE, TRUE);
}
else
PAGER_PositionChildWnd(infoPtr);
@ -472,13 +471,8 @@ PAGER_SetChild (PAGER_INFO* infoPtr, HWND hwndChild)
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,
0,0,0,0,
SWP_SHOWWINDOW | SWP_NOSIZE); /* native is 0 */
infoPtr->nPos = -1;
PAGER_SetPos(infoPtr, 0, FALSE);
PAGER_SetPos(infoPtr, 0, FALSE, FALSE);
}
return 0;
@ -523,9 +517,9 @@ PAGER_Scroll(PAGER_INFO* infoPtr, INT dir)
infoPtr->direction = dir;
if (dir == PGF_SCROLLLEFT || dir == PGF_SCROLLUP)
PAGER_SetPos(infoPtr, infoPtr->nPos - nmpgScroll.iScroll, TRUE);
PAGER_SetPos(infoPtr, infoPtr->nPos - nmpgScroll.iScroll, TRUE, TRUE);
else
PAGER_SetPos(infoPtr, infoPtr->nPos + nmpgScroll.iScroll, TRUE);
PAGER_SetPos(infoPtr, infoPtr->nPos + nmpgScroll.iScroll, TRUE, TRUE);
}
else
infoPtr->direction = -1;
@ -1045,7 +1039,7 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return PAGER_SetChild (infoPtr, (HWND)lParam);
case PGM_SETPOS:
return PAGER_SetPos(infoPtr, (INT)lParam, FALSE);
return PAGER_SetPos(infoPtr, (INT)lParam, FALSE, TRUE);
case WM_CREATE:
return PAGER_Create (hwnd, (LPCREATESTRUCTW)lParam);

View file

@ -2973,11 +2973,25 @@ static LPWSTR load_string( HINSTANCE instance, LPCWSTR str )
HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
LPCPROPSHEETPAGEA lpPropSheetPage)
{
PROPSHEETPAGEW* ppsp = Alloc(sizeof(PROPSHEETPAGEW));
PROPSHEETPAGEW *ppsp;
memcpy(ppsp,lpPropSheetPage,min(lpPropSheetPage->dwSize,sizeof(PROPSHEETPAGEA)));
if (lpPropSheetPage->dwSize < PROPSHEETPAGEA_V1_SIZE)
return NULL;
ppsp->dwFlags &= ~ PSP_INTERNAL_UNICODE;
/* original data is used for callback notifications */
if ((lpPropSheetPage->dwFlags & PSP_USECALLBACK) && lpPropSheetPage->pfnCallback)
{
ppsp = Alloc(2 * sizeof(*ppsp));
memcpy(ppsp, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEA)));
memcpy(ppsp + 1, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEA)));
}
else
{
ppsp = Alloc(sizeof(*ppsp));
memcpy(ppsp, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEA)));
}
ppsp->dwFlags &= ~PSP_INTERNAL_UNICODE;
if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) )
{
@ -3029,8 +3043,8 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
else
ppsp->pszHeaderSubTitle = NULL;
if ((ppsp->dwFlags & PSH_USECALLBACK) && ppsp->pfnCallback)
ppsp->pfnCallback(0, PSPCB_ADDREF, ppsp);
if ((ppsp->dwFlags & PSP_USECALLBACK) && ppsp->dwSize > PROPSHEETPAGEA_V1_SIZE && ppsp->pfnCallback)
ppsp->pfnCallback(0, PSPCB_ADDREF, ppsp + 1);
return (HPROPSHEETPAGE)ppsp;
}
@ -3042,11 +3056,25 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
*/
HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage)
{
PROPSHEETPAGEW* ppsp = Alloc(sizeof(PROPSHEETPAGEW));
PROPSHEETPAGEW *ppsp;
memcpy(ppsp,lpPropSheetPage,min(lpPropSheetPage->dwSize,sizeof(PROPSHEETPAGEW)));
if (lpPropSheetPage->dwSize < PROPSHEETPAGEW_V1_SIZE)
return NULL;
ppsp->dwFlags |= PSP_INTERNAL_UNICODE;
/* original data is used for callback notifications */
if ((lpPropSheetPage->dwFlags & PSP_USECALLBACK) && lpPropSheetPage->pfnCallback)
{
ppsp = Alloc(2 * sizeof(*ppsp));
memcpy(ppsp, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEW)));
memcpy(ppsp + 1, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEW)));
}
else
{
ppsp = Alloc(sizeof(*ppsp));
memcpy(ppsp, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEW)));
}
ppsp->dwFlags |= PSP_INTERNAL_UNICODE;
if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) )
{
@ -3078,8 +3106,8 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage
else
ppsp->pszHeaderSubTitle = NULL;
if ((ppsp->dwFlags & PSH_USECALLBACK) && ppsp->pfnCallback)
ppsp->pfnCallback(0, PSPCB_ADDREF, ppsp);
if ((ppsp->dwFlags & PSP_USECALLBACK) && ppsp->dwSize > PROPSHEETPAGEW_V1_SIZE && ppsp->pfnCallback)
ppsp->pfnCallback(0, PSPCB_ADDREF, ppsp + 1);
return (HPROPSHEETPAGE)ppsp;
}
@ -3102,8 +3130,8 @@ BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
if (!psp)
return FALSE;
if ((psp->dwFlags & PSH_USECALLBACK) && psp->pfnCallback)
psp->pfnCallback(0, PSPCB_RELEASE, psp);
if ((psp->dwFlags & PSP_USECALLBACK) && psp->pfnCallback)
psp->pfnCallback(0, PSPCB_RELEASE, psp + 1);
if (!(psp->dwFlags & PSP_DLGINDIRECT) && !IS_INTRESOURCE( psp->u.pszTemplate ))
Free ((LPVOID)psp->u.pszTemplate);
@ -3393,7 +3421,7 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
(psInfo->ppshheader.dwFlags & (PSH_WIZARD97_OLD | PSH_WIZARD97_NEW)) &&
#ifdef __REACTOS__
(psInfo->ppshheader.dwFlags & PSH_WATERMARK) &&
(psInfo->ppshheader.u4.hbmWatermark) )
(psInfo->ppshheader.u4.hbmWatermark) )
#else
(psInfo->ppshheader.dwFlags & PSH_WATERMARK) )
#endif

View file

@ -59,6 +59,14 @@
#define IDI_TT_WARN_SM 25
#define IDI_TT_ERROR_SM 28
/* Taskdialog strings */
#define IDS_BUTTON_YES 3000
#define IDS_BUTTON_NO 3001
#define IDS_BUTTON_RETRY 3002
#define IDS_BUTTON_OK 3003
#define IDS_BUTTON_CANCEL 3004
#define IDS_BUTTON_CLOSE 3005
// This is really ComCtl32 v5.82, the last one not supporting SxS
#undef COMCTL32_VERSION // Undefines what the PSDK gave to us
#define COMCTL32_VERSION 5

View file

@ -29,8 +29,6 @@
#include "comctl32.h"
#include <wine/list.h>
WINE_DEFAULT_DEBUG_CHANNEL(syslink);
typedef struct

View file

@ -0,0 +1,373 @@
/*
* Task dialog control
*
* Copyright 2017 Fabian Maurer
*
* 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 "comctl32.h"
WINE_DEFAULT_DEBUG_CHANNEL(taskdialog);
#define ALIGNED_LENGTH(_Len, _Align) (((_Len)+(_Align))&~(_Align))
#define ALIGNED_POINTER(_Ptr, _Align) ((LPVOID)ALIGNED_LENGTH((ULONG_PTR)(_Ptr), _Align))
#define ALIGN_LENGTH(_Len, _Align) _Len = ALIGNED_LENGTH(_Len, _Align)
#define ALIGN_POINTER(_Ptr, _Align) _Ptr = ALIGNED_POINTER(_Ptr, _Align)
static const UINT DIALOG_MIN_WIDTH = 180;
static const UINT DIALOG_SPACING = 5;
static const UINT DIALOG_BUTTON_WIDTH = 50;
static const UINT DIALOG_BUTTON_HEIGHT = 14;
static const UINT ID_MAIN_INSTRUCTION = 0xf000;
static const UINT ID_CONTENT = 0xf001;
struct taskdialog_control
{
struct list entry;
DLGITEMTEMPLATE *template;
unsigned int template_size;
};
struct taskdialog_template_desc
{
const TASKDIALOGCONFIG *taskconfig;
unsigned int dialog_height;
unsigned int dialog_width;
struct list controls;
WORD control_count;
LONG x_baseunit;
LONG y_baseunit;
HFONT font;
};
static void pixels_to_dialogunits(const struct taskdialog_template_desc *desc, LONG *width, LONG *height)
{
if (width)
*width = MulDiv(*width, 4, desc->x_baseunit);
if (height)
*height = MulDiv(*height, 8, desc->y_baseunit);
}
static void dialogunits_to_pixels(const struct taskdialog_template_desc *desc, LONG *width, LONG *height)
{
if (width)
*width = MulDiv(*width, desc->x_baseunit, 4);
if (height)
*height = MulDiv(*height, desc->y_baseunit, 8);
}
static void template_write_data(char **ptr, const void *src, unsigned int size)
{
memcpy(*ptr, src, size);
*ptr += size;
}
static unsigned int taskdialog_add_control(struct taskdialog_template_desc *desc, WORD id, const WCHAR *class,
HINSTANCE hInstance, const WCHAR *text, short x, short y, short cx, short cy)
{
struct taskdialog_control *control = Alloc(sizeof(*control));
unsigned int size, class_size, text_size;
DLGITEMTEMPLATE *template;
static const WCHAR nulW;
const WCHAR *textW;
char *ptr;
class_size = (strlenW(class) + 1) * sizeof(WCHAR);
if (IS_INTRESOURCE(text))
text_size = LoadStringW(hInstance, (UINT_PTR)text, (WCHAR *)&textW, 0) * sizeof(WCHAR);
else
{
textW = text;
text_size = strlenW(textW) * sizeof(WCHAR);
}
size = sizeof(DLGITEMTEMPLATE);
size += class_size;
size += text_size + sizeof(WCHAR);
size += sizeof(WORD); /* creation data */
control->template = template = Alloc(size);
control->template_size = size;
template->style = WS_VISIBLE;
template->dwExtendedStyle = 0;
template->x = x;
template->y = y;
template->cx = cx;
template->cy = cy;
template->id = id;
ptr = (char *)(template + 1);
template_write_data(&ptr, class, class_size);
template_write_data(&ptr, textW, text_size);
template_write_data(&ptr, &nulW, sizeof(nulW));
list_add_tail(&desc->controls, &control->entry);
desc->control_count++;
return ALIGNED_LENGTH(size, 3);
}
static unsigned int taskdialog_add_static_label(struct taskdialog_template_desc *desc, WORD id, const WCHAR *str)
{
RECT rect = { 0, 0, desc->dialog_width - DIALOG_SPACING * 2, 0}; /* padding left and right of the control */
const WCHAR *textW = NULL;
unsigned int size, length;
HFONT oldfont;
HDC hdc;
if (!str)
return 0;
if (IS_INTRESOURCE(str))
{
if (!(length = LoadStringW(desc->taskconfig->hInstance, (UINT_PTR)str, (WCHAR *)&textW, 0)))
{
WARN("Failed to load static text %s, id %#x\n", debugstr_w(str), id);
return 0;
}
}
else
{
textW = str;
length = strlenW(textW);
}
hdc = GetDC(0);
oldfont = SelectObject(hdc, desc->font);
dialogunits_to_pixels(desc, &rect.right, NULL);
DrawTextW(hdc, textW, length, &rect, DT_LEFT | DT_EXPANDTABS | DT_CALCRECT | DT_WORDBREAK);
pixels_to_dialogunits(desc, &rect.right, &rect.bottom);
SelectObject(hdc, oldfont);
ReleaseDC(0, hdc);
desc->dialog_height += DIALOG_SPACING;
size = taskdialog_add_control(desc, id, WC_STATICW, desc->taskconfig->hInstance, str, DIALOG_SPACING,
desc->dialog_height, rect.right, rect.bottom);
desc->dialog_height += rect.bottom;
return size;
}
static unsigned int taskdialog_add_main_instruction(struct taskdialog_template_desc *desc)
{
return taskdialog_add_static_label(desc, ID_MAIN_INSTRUCTION, desc->taskconfig->pszMainInstruction);
}
static unsigned int taskdialog_add_content(struct taskdialog_template_desc *desc)
{
return taskdialog_add_static_label(desc, ID_CONTENT, desc->taskconfig->pszContent);
}
static unsigned int taskdialog_add_common_buttons(struct taskdialog_template_desc *desc)
{
short button_x = desc->dialog_width - DIALOG_BUTTON_WIDTH - DIALOG_SPACING;
DWORD flags = desc->taskconfig->dwCommonButtons;
unsigned int size = 0;
#define TASKDIALOG_ADD_COMMON_BUTTON(id) \
do { \
size += taskdialog_add_control(desc, ID##id, WC_BUTTONW, COMCTL32_hModule, MAKEINTRESOURCEW(IDS_BUTTON_##id), \
button_x, desc->dialog_height + DIALOG_SPACING, DIALOG_BUTTON_WIDTH, DIALOG_BUTTON_HEIGHT); \
button_x -= DIALOG_BUTTON_WIDTH + DIALOG_SPACING; \
} while(0)
if (flags & TDCBF_CLOSE_BUTTON)
TASKDIALOG_ADD_COMMON_BUTTON(CLOSE);
if (flags & TDCBF_CANCEL_BUTTON)
TASKDIALOG_ADD_COMMON_BUTTON(CANCEL);
if (flags & TDCBF_RETRY_BUTTON)
TASKDIALOG_ADD_COMMON_BUTTON(RETRY);
if (flags & TDCBF_NO_BUTTON)
TASKDIALOG_ADD_COMMON_BUTTON(NO);
if (flags & TDCBF_YES_BUTTON)
TASKDIALOG_ADD_COMMON_BUTTON(YES);
if (flags & TDCBF_OK_BUTTON)
TASKDIALOG_ADD_COMMON_BUTTON(OK);
/* Always add OK button */
if (list_empty(&desc->controls))
TASKDIALOG_ADD_COMMON_BUTTON(OK);
#undef TASKDIALOG_ADD_COMMON_BUTTON
/* make room for common buttons row */
desc->dialog_height += DIALOG_BUTTON_HEIGHT + 2 * DIALOG_SPACING;
return size;
}
static void taskdialog_clear_controls(struct list *controls)
{
struct taskdialog_control *control, *control2;
LIST_FOR_EACH_ENTRY_SAFE(control, control2, controls, struct taskdialog_control, entry)
{
list_remove(&control->entry);
Free(control->template);
Free(control);
}
}
static unsigned int taskdialog_get_reference_rect(const struct taskdialog_template_desc *desc, RECT *ret)
{
HMONITOR monitor = MonitorFromWindow(desc->taskconfig->hwndParent ? desc->taskconfig->hwndParent : GetActiveWindow(),
MONITOR_DEFAULTTOPRIMARY);
MONITORINFO info;
info.cbSize = sizeof(info);
GetMonitorInfoW(monitor, &info);
if (desc->taskconfig->dwFlags & TDF_POSITION_RELATIVE_TO_WINDOW && desc->taskconfig->hwndParent)
GetWindowRect(desc->taskconfig->hwndParent, ret);
else
*ret = info.rcWork;
pixels_to_dialogunits(desc, &ret->left, &ret->top);
pixels_to_dialogunits(desc, &ret->right, &ret->bottom);
pixels_to_dialogunits(desc, &info.rcWork.left, &info.rcWork.top);
pixels_to_dialogunits(desc, &info.rcWork.right, &info.rcWork.bottom);
return info.rcWork.right - info.rcWork.left;
}
static DLGTEMPLATE *create_taskdialog_template(const TASKDIALOGCONFIG *taskconfig)
{
struct taskdialog_control *control, *control2;
unsigned int size, title_size, screen_width;
struct taskdialog_template_desc desc;
static const WORD fontsize = 0x7fff;
static const WCHAR emptyW[] = { 0 };
const WCHAR *titleW = NULL;
DLGTEMPLATE *template;
NONCLIENTMETRICSW ncm;
RECT ref_rect;
char *ptr;
HDC hdc;
/* Window title */
if (!taskconfig->pszWindowTitle)
FIXME("use executable name for window title\n");
else if (IS_INTRESOURCE(taskconfig->pszWindowTitle))
FIXME("load window title from resources\n");
else
titleW = taskconfig->pszWindowTitle;
if (!titleW)
titleW = emptyW;
title_size = (strlenW(titleW) + 1) * sizeof(WCHAR);
size = sizeof(DLGTEMPLATE) + 2 * sizeof(WORD);
size += title_size;
size += 2; /* font size */
list_init(&desc.controls);
desc.taskconfig = taskconfig;
desc.control_count = 0;
ncm.cbSize = sizeof(ncm);
SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0);
desc.font = CreateFontIndirectW(&ncm.lfMessageFont);
hdc = GetDC(0);
SelectObject(hdc, desc.font);
desc.x_baseunit = GdiGetCharDimensions(hdc, NULL, &desc.y_baseunit);
ReleaseDC(0, hdc);
screen_width = taskdialog_get_reference_rect(&desc, &ref_rect);
desc.dialog_height = 0;
desc.dialog_width = max(taskconfig->cxWidth, DIALOG_MIN_WIDTH);
desc.dialog_width = min(desc.dialog_width, screen_width);
size += taskdialog_add_main_instruction(&desc);
size += taskdialog_add_content(&desc);
size += taskdialog_add_common_buttons(&desc);
template = Alloc(size);
if (!template)
{
taskdialog_clear_controls(&desc.controls);
DeleteObject(desc.font);
return NULL;
}
template->style = DS_MODALFRAME | DS_SETFONT | WS_CAPTION | WS_VISIBLE | WS_SYSMENU;
template->cdit = desc.control_count;
template->x = (ref_rect.left + ref_rect.right + desc.dialog_width) / 2;
template->y = (ref_rect.top + ref_rect.bottom + desc.dialog_height) / 2;
template->cx = desc.dialog_width;
template->cy = desc.dialog_height;
ptr = (char *)(template + 1);
ptr += 2; /* menu */
ptr += 2; /* class */
template_write_data(&ptr, titleW, title_size);
template_write_data(&ptr, &fontsize, sizeof(fontsize));
/* write control entries */
LIST_FOR_EACH_ENTRY_SAFE(control, control2, &desc.controls, struct taskdialog_control, entry)
{
ALIGN_POINTER(ptr, 3);
template_write_data(&ptr, control->template, control->template_size);
/* list item won't be needed later */
list_remove(&control->entry);
Free(control->template);
Free(control);
}
DeleteObject(desc.font);
return template;
}
static INT_PTR CALLBACK taskdialog_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
TRACE("hwnd=%p msg=0x%04x wparam=%lx lparam=%lx\n", hwnd, msg, wParam, lParam);
switch (msg)
{
case WM_COMMAND:
if (HIWORD(wParam) == BN_CLICKED)
{
WORD command_id = LOWORD(wParam);
EndDialog(hwnd, command_id);
return TRUE;
}
break;
}
return FALSE;
}
/***********************************************************************
* TaskDialogIndirect [COMCTL32.@]
*/
HRESULT WINAPI TaskDialogIndirect(const TASKDIALOGCONFIG *taskconfig, int *button,
int *radio_button, BOOL *verification_flag_checked)
{
DLGTEMPLATE *template;
INT ret;
TRACE("%p, %p, %p, %p\n", taskconfig, button, radio_button, verification_flag_checked);
template = create_taskdialog_template(taskconfig);
ret = DialogBoxIndirectParamW(taskconfig->hInstance, template, taskconfig->hwndParent, taskdialog_proc, 0);
Free(template);
if (button) *button = ret;
if (radio_button) *radio_button = taskconfig->nDefaultButton;
if (verification_flag_checked) *verification_flag_checked = TRUE;
return S_OK;
}

View file

@ -34,8 +34,13 @@ typedef enum
STATE_DEFAULTED
} ButtonState;
#ifdef __REACTOS__ /* r73885 */
typedef void (*pfThemedPaint)(HTHEME theme, HWND hwnd, HDC hdc, ButtonState drawState, UINT dtFlags, BOOL focused, LPARAM prfFlag);
#else
typedef void (*pfThemedPaint)(HTHEME theme, HWND hwnd, HDC hdc, ButtonState drawState, UINT dtFlags, BOOL focused);
#endif
#ifdef __REACTOS__ /* r73885 & r73907 */
static inline LONG get_button_state( HWND hwnd )
{
return _GetButtonData(hwnd)->state;
@ -50,6 +55,7 @@ static inline LONG_PTR get_button_image(HWND hwnd)
{
return _GetButtonData(hwnd)->image;
}
#endif
static UINT get_drawtext_flags(DWORD style, DWORD ex_style)
{
@ -102,36 +108,54 @@ static inline WCHAR *get_button_text(HWND hwnd)
return text;
}
#ifdef __REACTOS__ /* r73885 */
static void PB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused, LPARAM prfFlag)
#else
static void PB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused)
#endif
{
static const int states[] = { PBS_NORMAL, PBS_DISABLED, PBS_HOT, PBS_PRESSED, PBS_DEFAULTED };
RECT bgRect, textRect;
#ifdef __REACTOS__ /* r73885 */
HFONT font = get_button_font(hwnd);
#else
HFONT font = (HFONT)SendMessageW(hwnd, WM_GETFONT, 0, 0);
#endif
HFONT hPrevFont = font ? SelectObject(hDC, font) : NULL;
int state = states[ drawState ];
WCHAR *text = get_button_text(hwnd);
#ifdef __REACTOS__ /* r74012 & r74406 */
PBUTTON_DATA pdata = _GetButtonData(hwnd);
SIZE ImageSize;
HWND parent;
HBRUSH hBrush;
#endif
GetClientRect(hwnd, &bgRect);
GetThemeBackgroundContentRect(theme, hDC, BP_PUSHBUTTON, state, &bgRect, &textRect);
#ifdef __REACTOS__ /* r73885 & r74149 */
if (prfFlag == 0)
{
if (IsThemeBackgroundPartiallyTransparent(theme, BP_PUSHBUTTON, state))
DrawThemeParentBackground(hwnd, hDC, NULL);
}
#else
if (IsThemeBackgroundPartiallyTransparent(theme, BP_PUSHBUTTON, state))
DrawThemeParentBackground(hwnd, hDC, NULL);
#endif
#ifdef __REACTOS__ /* r74406 */
parent = GetParent(hwnd);
if (!parent) parent = hwnd;
hBrush = (HBRUSH)SendMessageW( parent, WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)hwnd );
FillRect( hDC, &bgRect, hBrush );
#endif
DrawThemeBackground(theme, hDC, BP_PUSHBUTTON, state, &bgRect, NULL);
#ifdef __REACTOS__ /* r74012 */
if (pdata->imlData.himl && ImageList_GetIconSize(pdata->imlData.himl, &ImageSize.cx, &ImageSize.cy))
{
int left = textRect.left + pdata->imlData.margin.left;
@ -139,6 +163,7 @@ static void PB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
textRect.left += pdata->imlData.margin.left + pdata->imlData.margin.right + ImageSize.cy;
ImageList_Draw(pdata->imlData.himl, 0, hDC, left, top, 0);
}
#endif
if (text)
{
@ -164,7 +189,11 @@ static void PB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
if (hPrevFont) SelectObject(hDC, hPrevFont);
}
#ifdef __REACTOS__ /* r73885 */
static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused, LPARAM prfFlag)
#else
static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused)
#endif
{
static const int cb_states[3][5] =
{
@ -182,7 +211,11 @@ static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
SIZE sz;
RECT bgRect, textRect;
HFONT font, hPrevFont = NULL;
#ifdef __REACTOS__ /* r73885 */
LRESULT checkState = get_button_state(hwnd) & 3;
#else
LRESULT checkState = SendMessageW(hwnd, BM_GETCHECK, 0, 0);
#endif
DWORD dwStyle = GetWindowLongW(hwnd, GWL_STYLE);
int part = ((dwStyle & BUTTON_TYPE) == BS_RADIOBUTTON) || ((dwStyle & BUTTON_TYPE) == BS_AUTORADIOBUTTON)
? BP_RADIOBUTTON
@ -193,8 +226,10 @@ static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
WCHAR *text = get_button_text(hwnd);
LOGFONTW lf;
BOOL created_font = FALSE;
#ifdef __REACTOS__ /* r74406 */
HWND parent;
HBRUSH hBrush;
#endif
HRESULT hr = GetThemeFont(theme, hDC, part, state, TMT_FONT, &lf);
if (SUCCEEDED(hr)) {
@ -207,7 +242,11 @@ static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
created_font = TRUE;
}
} else {
#ifdef __REACTOS__ /* r73885 */
font = get_button_font(hwnd);
#else
font = (HFONT)SendMessageW(hwnd, WM_GETFONT, 0, 0);
#endif
hPrevFont = SelectObject(hDC, font);
}
@ -216,6 +255,7 @@ static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
GetClientRect(hwnd, &bgRect);
#ifdef __REACTOS__ /* r73885, r74149 and r74406 */
if (prfFlag == 0)
{
DrawThemeParentBackground(hwnd, hDC, NULL);
@ -229,6 +269,7 @@ static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
hBrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORSTATIC,
(WPARAM)hDC, (LPARAM)hwnd );
FillRect( hDC, &bgRect, hBrush );
#endif
GetThemeBackgroundContentRect(theme, hDC, part, state, &bgRect, &textRect);
@ -240,6 +281,10 @@ static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
bgRect.right = bgRect.left + sz.cx;
textRect.left = bgRect.right + 6;
#ifndef __REACTOS__ /* r74406 */
DrawThemeParentBackground(hwnd, hDC, NULL);
#endif
DrawThemeBackground(theme, hDC, part, state, &bgRect, NULL);
if (text)
{
@ -266,7 +311,11 @@ static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
if (hPrevFont) SelectObject(hDC, hPrevFont);
}
#ifdef __REACTOS__ /* r73885 */
static void GB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused, LPARAM prfFlag)
#else
static void GB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused)
#endif
{
static const int states[] = { GBS_NORMAL, GBS_DISABLED, GBS_NORMAL, GBS_NORMAL, GBS_NORMAL };
@ -276,9 +325,11 @@ static void GB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
LOGFONTW lf;
HFONT font, hPrevFont = NULL;
BOOL created_font = FALSE;
#ifdef __REACTOS__ /* r74406 */
HWND parent;
HBRUSH hBrush;
RECT clientRect;
#endif
HRESULT hr = GetThemeFont(theme, hDC, BP_GROUPBOX, state, TMT_FONT, &lf);
if (SUCCEEDED(hr)) {
@ -290,7 +341,11 @@ static void GB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
created_font = TRUE;
}
} else {
#ifdef __REACTOS__ /* r73885 */
font = get_button_font(hwnd);
#else
font = (HFONT)SendMessageW(hwnd, WM_GETFONT, 0, 0);
#endif
hPrevFont = SelectObject(hDC, font);
}
@ -312,12 +367,18 @@ static void GB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
GetThemeBackgroundContentRect(theme, hDC, BP_GROUPBOX, state, &bgRect, &contentRect);
ExcludeClipRect(hDC, contentRect.left, contentRect.top, contentRect.right, contentRect.bottom);
#ifdef __REACTOS__ /* r73885 & r74149 */
if (prfFlag == 0)
{
if (IsThemeBackgroundPartiallyTransparent(theme, BP_GROUPBOX, state))
DrawThemeParentBackground(hwnd, hDC, NULL);
}
#else
if (IsThemeBackgroundPartiallyTransparent(theme, BP_GROUPBOX, state))
DrawThemeParentBackground(hwnd, hDC, NULL);
#endif
#ifdef __REACTOS__ /* r74406 */
parent = GetParent(hwnd);
if (!parent) parent = hwnd;
hBrush = (HBRUSH)SendMessageW(parent, WM_CTLCOLORSTATIC,
@ -327,6 +388,7 @@ static void GB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
(WPARAM)hDC, (LPARAM)hwnd );
GetClientRect(hwnd, &clientRect);
FillRect( hDC, &clientRect, hBrush );
#endif
DrawThemeBackground(theme, hDC, BP_GROUPBOX, state, &bgRect, NULL);
@ -363,14 +425,28 @@ static const pfThemedPaint btnThemedPaintFunc[BUTTON_TYPE + 1] =
NULL, /* Not defined */
};
#ifdef __REACTOS__ /* r73873 */
BOOL BUTTON_PaintWithTheme(HTHEME theme, HWND hwnd, HDC hParamDC, LPARAM prfFlag)
#else
static BOOL BUTTON_Paint(HTHEME theme, HWND hwnd, HDC hParamDC)
#endif
{
#ifdef __REACTOS__ /* r73873, r73897 and r74120 */
DWORD dwStyle;
DWORD dwStyleEx;
DWORD type;
UINT dtFlags;
int state;
#else
PAINTSTRUCT ps;
HDC hDC;
DWORD dwStyle = GetWindowLongW(hwnd, GWL_STYLE);
DWORD dwStyleEx = GetWindowLongW(hwnd, GWL_EXSTYLE);
UINT dtFlags = get_drawtext_flags(dwStyle, dwStyleEx);
int state = (int)SendMessageW(hwnd, BM_GETSTATE, 0, 0);
#endif
ButtonState drawState;
#ifdef __REACTOS__ /* r73873, r73897, r73907 and r74120 */
pfThemedPaint paint;
dwStyle = GetWindowLongW(hwnd, GWL_STYLE);
@ -389,6 +465,9 @@ BOOL BUTTON_PaintWithTheme(HTHEME theme, HWND hwnd, HDC hParamDC, LPARAM prfFlag
dwStyleEx = GetWindowLongW(hwnd, GWL_EXSTYLE);
dtFlags = get_drawtext_flags(dwStyle, dwStyleEx);
state = get_button_state(hwnd);
#else
pfThemedPaint paint = btnThemedPaintFunc[ dwStyle & BUTTON_TYPE ];
#endif
if(IsWindowEnabled(hwnd))
{
@ -399,11 +478,118 @@ BOOL BUTTON_PaintWithTheme(HTHEME theme, HWND hwnd, HDC hParamDC, LPARAM prfFlag
}
else drawState = STATE_DISABLED;
#ifndef __REACTOS__ /* r73873 */
hDC = hParamDC ? hParamDC : BeginPaint(hwnd, &ps);
if (paint) paint(theme, hwnd, hDC, drawState, dtFlags, state & BST_FOCUS);
if (!hParamDC) EndPaint(hwnd, &ps);
#endif
#ifdef __REACTOS__ /* r74074 & r74120 */
if (drawState == STATE_NORMAL && type == BS_DEFPUSHBUTTON)
{
drawState = STATE_DEFAULTED;
}
#endif
paint(theme, hwnd, hParamDC, drawState, dtFlags, state & BST_FOCUS, prfFlag);
return TRUE;
}
#ifndef __REACTOS__ /* r73873 */
/**********************************************************************
* The button control subclass window proc.
*/
LRESULT CALLBACK THEMING_ButtonSubclassProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam,
ULONG_PTR dwRefData)
{
const WCHAR* themeClass = WC_BUTTONW;
HTHEME theme;
LRESULT result;
switch (msg)
{
case WM_CREATE:
result = THEMING_CallOriginalClass(hwnd, msg, wParam, lParam);
OpenThemeData(hwnd, themeClass);
return result;
case WM_DESTROY:
theme = GetWindowTheme(hwnd);
CloseThemeData (theme);
return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam);
case WM_THEMECHANGED:
theme = GetWindowTheme(hwnd);
CloseThemeData (theme);
OpenThemeData(hwnd, themeClass);
break;
case WM_SYSCOLORCHANGE:
theme = GetWindowTheme(hwnd);
if (!theme) return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam);
/* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
* which will do the repaint. */
break;
case WM_PAINT:
theme = GetWindowTheme(hwnd);
if (theme && BUTTON_Paint(theme, hwnd, (HDC)wParam))
return 0;
else
return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam);
case WM_ENABLE:
theme = GetWindowTheme(hwnd);
if (theme) {
RedrawWindow(hwnd, NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);
return 0;
} else
return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam);
case WM_MOUSEMOVE:
{
TRACKMOUSEEVENT mouse_event;
mouse_event.cbSize = sizeof(TRACKMOUSEEVENT);
mouse_event.dwFlags = TME_QUERY;
if(!TrackMouseEvent(&mouse_event) || !(mouse_event.dwFlags&(TME_HOVER|TME_LEAVE)))
{
mouse_event.dwFlags = TME_HOVER|TME_LEAVE;
mouse_event.hwndTrack = hwnd;
mouse_event.dwHoverTime = 1;
TrackMouseEvent(&mouse_event);
}
break;
}
case WM_MOUSEHOVER:
{
int state = (int)SendMessageW(hwnd, BM_GETSTATE, 0, 0);
SetWindowLongW(hwnd, 0, state|BST_HOT);
InvalidateRect(hwnd, NULL, FALSE);
break;
}
case WM_MOUSELEAVE:
{
int state = (int)SendMessageW(hwnd, BM_GETSTATE, 0, 0);
SetWindowLongW(hwnd, 0, state&(~BST_HOT));
InvalidateRect(hwnd, NULL, FALSE);
break;
}
case BM_SETCHECK:
case BM_SETSTATE:
theme = GetWindowTheme(hwnd);
if (theme) {
InvalidateRect(hwnd, NULL, FALSE);
}
return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam);
default:
/* Call old proc */
return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam);
}
return 0;
}
#endif /* !__REACTOS__ */

View file

@ -52,11 +52,16 @@ static void nc_paint (HTHEME theme, HWND hwnd, HRGN region)
CombineRgn (cliprgn, cliprgn, region, RGN_AND);
OffsetRect(&r, -r.left, -r.top);
#ifdef __REACTOS__ /* r73789 */
dc = GetWindowDC(hwnd);
/* Exclude client part */
ExcludeClipRect(dc, r.left + cxEdge, r.top + cyEdge,
r.right - cxEdge, r.bottom -cyEdge);
#else
dc = GetDCEx(hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN);
OffsetRect(&r, -r.left, -r.top);
#endif
if (IsThemeBackgroundPartiallyTransparent (theme, part, state))
DrawThemeParentBackground(hwnd, dc, &r);
DrawThemeBackground (theme, dc, part, state, &r, 0);

View file

@ -42,11 +42,16 @@ static void nc_paint (HTHEME theme, HWND hwnd, HRGN region)
CombineRgn (cliprgn, cliprgn, region, RGN_AND);
OffsetRect(&r, -r.left, -r.top);
#ifdef __REACTOS__ /* r73789 */
dc = GetWindowDC(hwnd);
/* Exclude client part */
ExcludeClipRect(dc, r.left + cxEdge, r.top + cyEdge,
r.right - cxEdge, r.bottom -cyEdge);
#else
dc = GetDCEx(hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN);
OffsetRect(&r, -r.left, -r.top);
#endif
if (IsThemeBackgroundPartiallyTransparent (theme, 0, 0))
DrawThemeParentBackground(hwnd, dc, &r);
DrawThemeBackground (theme, dc, 0, 0, &r, 0);

View file

@ -26,8 +26,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(theming);
typedef LRESULT (CALLBACK* THEMING_SUBCLASSPROC)(HWND, UINT, WPARAM, LPARAM,
ULONG_PTR);
#ifndef __REACTOS__ /* r73871 */
extern LRESULT CALLBACK THEMING_ButtonSubclassProc (HWND, UINT, WPARAM, LPARAM,
ULONG_PTR) DECLSPEC_HIDDEN;
#endif
extern LRESULT CALLBACK THEMING_ComboSubclassProc (HWND, UINT, WPARAM, LPARAM,
ULONG_PTR) DECLSPEC_HIDDEN;
#ifndef __REACTOS__ /* r73803 */
extern LRESULT CALLBACK THEMING_DialogSubclassProc (HWND, UINT, WPARAM, LPARAM,
ULONG_PTR) DECLSPEC_HIDDEN;
#endif
extern LRESULT CALLBACK THEMING_EditSubclassProc (HWND, UINT, WPARAM, LPARAM,
ULONG_PTR) DECLSPEC_HIDDEN;
extern LRESULT CALLBACK THEMING_ListBoxSubclassProc (HWND, UINT, WPARAM, LPARAM,
@ -44,6 +52,10 @@ static const struct ThemingSubclass
THEMING_SUBCLASSPROC subclassProc;
} subclasses[] = {
/* Note: list must be sorted by class name */
#ifndef __REACTOS__ /* r73803 & r73871 */
{dialogClass, THEMING_DialogSubclassProc},
{WC_BUTTONW, THEMING_ButtonSubclassProc},
#endif
{WC_COMBOBOXW, THEMING_ComboSubclassProc},
{comboLboxClass, THEMING_ListBoxSubclassProc},
{WC_EDITW, THEMING_EditSubclassProc},
@ -83,13 +95,23 @@ MAKE_SUBCLASS_PROC(1)
MAKE_SUBCLASS_PROC(2)
MAKE_SUBCLASS_PROC(3)
MAKE_SUBCLASS_PROC(4)
#ifndef __REACTOS__ /* r73803 & r73871 */
MAKE_SUBCLASS_PROC(5)
MAKE_SUBCLASS_PROC(6)
#endif
static const WNDPROC subclassProcs[NUM_SUBCLASSES] = {
subclass_proc0,
subclass_proc1,
subclass_proc2,
subclass_proc3,
#ifdef __REACTOS__ /* r73871 */
subclass_proc4
#else
subclass_proc4,
subclass_proc5,
subclass_proc6
#endif
};
/***********************************************************************
@ -98,15 +120,23 @@ static const WNDPROC subclassProcs[NUM_SUBCLASSES] = {
* Register classes for standard controls that will shadow the system
* classes.
*/
void THEMING_Initialize (HANDLE hActCtx5, HANDLE hActCtx6)
#ifdef __REACTOS__ /* r73803 */
void THEMING_Initialize(HANDLE hActCtx5, HANDLE hActCtx6)
#else
void THEMING_Initialize (void)
#endif
{
unsigned int i;
static const WCHAR subclassPropName[] =
{ 'C','C','3','2','T','h','e','m','i','n','g','S','u','b','C','l',0 };
static const WCHAR refDataPropName[] =
{ 'C','C','3','2','T','h','e','m','i','n','g','D','a','t','a',0 };
#ifdef __REACTOS__ /* r73803 */
ULONG_PTR ulCookie;
BOOL ret, bActivated;
#else
if (!IsThemeActive()) return;
#endif
atSubclassProp = GlobalAddAtomW (subclassPropName);
atRefDataProp = GlobalAddAtomW (refDataPropName);
@ -117,12 +147,16 @@ void THEMING_Initialize (HANDLE hActCtx5, HANDLE hActCtx6)
class.cbSize = sizeof(class);
#ifdef __REACTOS__ /* r73803 */
bActivated = ActivateActCtx(hActCtx5, &ulCookie);
ret = GetClassInfoExW (NULL, subclasses[i].className, &class);
if (bActivated)
DeactivateActCtx(0, ulCookie);
if (!ret)
#else
if (!GetClassInfoExW (NULL, subclasses[i].className, &class))
#endif
{
ERR("Could not retrieve information for class %s\n",
debugstr_w (subclasses[i].className));
@ -130,9 +164,11 @@ void THEMING_Initialize (HANDLE hActCtx5, HANDLE hActCtx6)
}
originalProcs[i] = class.lpfnWndProc;
class.lpfnWndProc = subclassProcs[i];
#ifdef __REACTOS__ /* r73803 */
class.style |= CS_GLOBALCLASS;
class.hInstance = COMCTL32_hModule;
#endif
if (!class.lpfnWndProc)
{
ERR("Missing proc for class %s\n",
@ -140,11 +176,16 @@ void THEMING_Initialize (HANDLE hActCtx5, HANDLE hActCtx6)
continue;
}
#ifdef __REACTOS__ /* r73803 */
bActivated = ActivateActCtx(hActCtx6, &ulCookie);
#endif
if (!RegisterClassExW (&class))
{
#ifdef __REACTOS__ /* r73803 */
WARN("Could not re-register class %s: %x\n",
#else
ERR("Could not re-register class %s: %x\n",
#endif
debugstr_w (subclasses[i].className), GetLastError ());
}
else
@ -153,8 +194,10 @@ void THEMING_Initialize (HANDLE hActCtx5, HANDLE hActCtx6)
debugstr_w (subclasses[i].className));
}
#ifdef __REACTOS__ /* r73803 */
if (bActivated)
DeactivateActCtx(0, ulCookie);
#endif
}
}

View file

@ -4333,7 +4333,12 @@ TREEVIEW_RButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam)
ht.pt.x = (short)LOWORD(lParam);
ht.pt.y = (short)HIWORD(lParam);
TREEVIEW_HitTest(infoPtr, &ht);
if (TREEVIEW_HitTest(infoPtr, &ht))
{
infoPtr->focusedItem = ht.hItem;
TREEVIEW_InvalidateItem(infoPtr, infoPtr->focusedItem);
TREEVIEW_InvalidateItem(infoPtr, infoPtr->selectedItem);
}
if (TREEVIEW_TrackMouse(infoPtr, ht.pt))
{
@ -4354,6 +4359,13 @@ TREEVIEW_RButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam)
}
}
if (ht.hItem)
{
TREEVIEW_InvalidateItem(infoPtr, infoPtr->focusedItem);
infoPtr->focusedItem = infoPtr->selectedItem;
TREEVIEW_InvalidateItem(infoPtr, infoPtr->focusedItem);
}
return 0;
}
@ -5434,10 +5446,15 @@ static BOOL TREEVIEW_NCPaint (const TREEVIEW_INFO *infoPtr, HRGN region, LPARAM
CombineRgn (cliprgn, cliprgn, region, RGN_AND);
OffsetRect(&r, -r.left, -r.top);
#ifdef __REACTOS__ /* r73789 */
dc = GetWindowDC(infoPtr->hwnd);
/* Exclude client part */
ExcludeClipRect(dc, r.left + cxEdge, r.top + cyEdge,
r.right - cxEdge, r.bottom -cyEdge);
#else
dc = GetDCEx(infoPtr->hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN);
OffsetRect(&r, -r.left, -r.top);
#endif
if (IsThemeBackgroundPartiallyTransparent (theme, 0, 0))
DrawThemeParentBackground(infoPtr->hwnd, dc, &r);

View file

@ -54,7 +54,7 @@ reactos/dll/win32/browseui # Out of sync
reactos/dll/win32/cabinet # Synced to WineStaging-2.2
reactos/dll/win32/clusapi # Synced to WineStaging-1.9.11
reactos/dll/win32/comcat # Synced to WineStaging-1.9.11
reactos/dll/win32/comctl32 # Synced to WineStaging-2.2
reactos/dll/win32/comctl32 # Synced to WineStaging-2.9
reactos/dll/win32/comdlg32 # Synced to WineStaging-2.9
reactos/dll/win32/compstui # Synced to WineStaging-2.2
reactos/dll/win32/credui # Synced to WineStaging-2.9