string.c
syslink.c
tab.c
+ taskdialog.c
theme_button.c
theme_combo.c
theme_dialog.c
#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"
WINE_DEFAULT_DEBUG_CHANNEL(commctrl);
+
static LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static LPWSTR COMCTL32_wSubclass = NULL;
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.@]
*/
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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のプロパティ"
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 속성"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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內容"
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"
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"
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 */
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)
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);
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);
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)
{
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);
- }
}
default: return FALSE;
}
- infoPtr->bAutoarrange = TRUE;
infoPtr->currIconPos.x = infoPtr->currIconPos.y = 0;
for (i = 0; i < infoPtr->nItemCount; i++)
{
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;
lvItem.mask &= ~LVIF_TEXT;
}
+ nItem = bNearest ? -1 : nStart + 1;
+
again:
for (; nItem < nLast; nItem++)
{
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;
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
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;
Pt.x -= Origin.x;
Pt.y -= Origin.y;
- infoPtr->bAutoarrange = FALSE;
-
return LISTVIEW_MoveIconTo(infoPtr, nItem, &Pt, FALSE);
}
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);
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
{
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);
}
static INT
-PAGER_GetScrollRange(PAGER_INFO* infoPtr)
+PAGER_GetScrollRange(PAGER_INFO* infoPtr, BOOL calc_size)
{
INT scrollRange = 0;
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;
}
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))
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);
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;
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;
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);
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) )
{
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;
}
*/
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;
+
+ /* 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;
+ ppsp->dwFlags |= PSP_INTERNAL_UNICODE;
if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) )
{
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;
}
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);
(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
#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
#include "comctl32.h"
-#include <wine/list.h>
-
WINE_DEFAULT_DEBUG_CHANNEL(syslink);
typedef struct
--- /dev/null
+/*
+ * 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;
+}
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;
{
return _GetButtonData(hwnd)->image;
}
+#endif
static UINT get_drawtext_flags(DWORD style, DWORD ex_style)
{
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;
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)
{
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] =
{
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
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)) {
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);
}
GetClientRect(hwnd, &bgRect);
+#ifdef __REACTOS__ /* r73885, r74149 and r74406 */
if (prfFlag == 0)
{
DrawThemeParentBackground(hwnd, hDC, NULL);
hBrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORSTATIC,
(WPARAM)hDC, (LPARAM)hwnd );
FillRect( hDC, &bgRect, hBrush );
+#endif
GetThemeBackgroundContentRect(theme, hDC, part, state, &bgRect, &textRect);
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)
{
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 };
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)) {
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);
}
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,
(WPARAM)hDC, (LPARAM)hwnd );
GetClientRect(hwnd, &clientRect);
FillRect( hDC, &clientRect, hBrush );
+#endif
DrawThemeBackground(theme, hDC, BP_GROUPBOX, state, &bgRect, NULL);
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);
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))
{
}
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__ */
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);
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);
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,
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},
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
};
/***********************************************************************
* 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);
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));
}
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",
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
debugstr_w (subclasses[i].className));
}
+#ifdef __REACTOS__ /* r73803 */
if (bActivated)
DeactivateActCtx(0, ulCookie);
+#endif
}
}
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))
{
}
}
+ if (ht.hItem)
+ {
+ TREEVIEW_InvalidateItem(infoPtr, infoPtr->focusedItem);
+ infoPtr->focusedItem = infoPtr->selectedItem;
+ TREEVIEW_InvalidateItem(infoPtr, infoPtr->focusedItem);
+ }
+
return 0;
}
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);
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