Part 1 of the comctl32 sync. I'll do it in 2 stages for testing purposes as it's a very large patch.

This part includes alpha support for imagelists and tango icons for the common toolbars
I'll do the second part later today. It has a propsheet bug and I'm a bit busy at the mo.

svn path=/trunk/; revision=47695
This commit is contained in:
Ged Murphy 2010-06-08 10:21:26 +00:00
parent e5239a070c
commit 94fa5d4e23
47 changed files with 2752 additions and 1338 deletions

View file

@ -717,7 +717,7 @@ static BOOL ANIMATE_OpenW(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPWSTR lps
TRACE("(%s)\n", debugstr_w(lpszName));
if (HIWORD(lpszName))
if (!IS_INTRESOURCE(lpszName))
{
if (!ANIMATE_LoadResW(infoPtr, hInstance, lpszName))
{
@ -775,7 +775,7 @@ static BOOL ANIMATE_OpenA(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPSTR lpsz
LRESULT result;
INT len;
if (!HIWORD(lpszName))
if (IS_INTRESOURCE(lpszName))
return ANIMATE_OpenW(infoPtr, hInstance, (LPWSTR)lpszName);
len = MultiByteToWideChar(CP_ACP, 0, lpszName, -1, NULL, 0);

View file

@ -67,8 +67,6 @@ typedef struct
HWND hwndNotify; /* my parent hwnd */
HWND hwndCombo;
HWND hwndEdit;
WNDPROC prevEditWndProc; /* previous Edit WNDPROC value */
WNDPROC prevComboWndProc; /* previous Combo WNDPROC value */
DWORD dwExtStyle;
INT selected; /* index of selected item */
DWORD flags; /* WINE internal flags */
@ -121,17 +119,15 @@ typedef struct
/* Offset between image and text */
#define CBE_SEP 4
static const WCHAR COMBOEX_SUBCLASS_PROP[] = {
'C','C','C','o','m','b','o','E','x','3','2',
'S','u','b','c','l','a','s','s','I','n','f','o',0
};
#define COMBO_SUBCLASSID 1
#define EDIT_SUBCLASSID 2
#define COMBOEX_GetInfoPtr(hwnd) ((COMBOEX_INFO *)GetWindowLongPtrW (hwnd, 0))
/* Things common to the entire DLL */
static LRESULT WINAPI COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static LRESULT WINAPI COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
UINT_PTR uId, DWORD_PTR ref_data);
static LRESULT CALLBACK COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
UINT_PTR uId, DWORD_PTR ref_data);
static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr);
typedef INT (WINAPI *cmp_func_t)(LPCWSTR, LPCWSTR);
@ -177,7 +173,7 @@ static void COMBOEX_DumpInput (COMBOBOXEXITEMW const *input)
static inline CBE_ITEMDATA *get_item_data(const COMBOEX_INFO *infoPtr, INT index)
{
return (CBE_ITEMDATA *)SendMessageW (infoPtr->hwndCombo, CB_GETITEMDATA,
(WPARAM)index, 0);
index, 0);
}
static inline cmp_func_t get_cmp_func(COMBOEX_INFO const *infoPtr)
@ -455,10 +451,7 @@ static void COMBOEX_ReSize (const COMBOEX_INFO *infoPtr)
static void COMBOEX_SetEditText (const COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item)
{
if (!infoPtr->hwndEdit) return;
/* native issues the following messages to the {Edit} control */
/* WM_SETTEXT (0,addr) */
/* EM_SETSEL32 (0,0) */
/* EM_SETSEL32 (0,-1) */
if (item->mask & CBEIF_TEXT) {
SendMessageW (infoPtr->hwndEdit, WM_SETTEXT, 0, (LPARAM)COMBOEX_GetText(infoPtr, item));
SendMessageW (infoPtr->hwndEdit, EM_SETSEL, 0, 0);
@ -491,13 +484,6 @@ static CBE_ITEMDATA * COMBOEX_FindItem(const COMBOEX_INFO *infoPtr, INT_PTR inde
return item;
}
static inline BOOL COMBOEX_HasEdit(COMBOEX_INFO const *infoPtr)
{
return infoPtr->hwndEdit ? TRUE : FALSE;
}
/* *** CBEM_xxx message support *** */
static UINT COMBOEX_GetListboxText(const COMBOEX_INFO *infoPtr, INT_PTR n, LPWSTR buf)
@ -510,6 +496,17 @@ static UINT COMBOEX_GetListboxText(const COMBOEX_INFO *infoPtr, INT_PTR n, LPWST
return 0;
str = COMBOEX_GetText(infoPtr, item);
if (!str)
{
if (buf)
{
if (infoPtr->unicode)
buf[0] = 0;
else
*((LPSTR)buf) = 0;
}
return 0;
}
if (infoPtr->unicode)
{
@ -536,7 +533,7 @@ static INT COMBOEX_DeleteItem (const COMBOEX_INFO *infoPtr, INT_PTR index)
if (!COMBOEX_FindItem(infoPtr, index)) return CB_ERR;
/* doing this will result in WM_DELETEITEM being issued */
SendMessageW (infoPtr->hwndCombo, CB_DELETESTRING, (WPARAM)index, 0);
SendMessageW (infoPtr->hwndCombo, CB_DELETESTRING, index, 0);
return infoPtr->nb_items;
}
@ -547,13 +544,13 @@ static BOOL COMBOEX_GetItemW (const COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
INT_PTR index = cit->iItem;
CBE_ITEMDATA *item;
TRACE("(...)\n");
TRACE("\n");
/* if item number requested does not exist then return failure */
if ((index >= infoPtr->nb_items) || (index < -1)) return FALSE;
/* if the item is the edit control and there is no edit control, skip */
if ((index == -1) && !COMBOEX_HasEdit(infoPtr)) return FALSE;
if ((index == -1) && !infoPtr->hwndEdit) return FALSE;
if (!(item = COMBOEX_FindItem(infoPtr, index))) return FALSE;
@ -567,7 +564,7 @@ static BOOL COMBOEX_GetItemA (const COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
{
COMBOBOXEXITEMW tmpcit;
TRACE("(...)\n");
TRACE("\n");
tmpcit.mask = cit->mask;
tmpcit.iItem = cit->iItem;
@ -600,8 +597,7 @@ static BOOL COMBOEX_GetItemA (const COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
static inline BOOL COMBOEX_HasEditChanged (COMBOEX_INFO const *infoPtr)
{
return COMBOEX_HasEdit(infoPtr) &&
(infoPtr->flags & WCBE_EDITHASCHANGED) == WCBE_EDITHASCHANGED;
return infoPtr->hwndEdit && (infoPtr->flags & WCBE_EDITHASCHANGED) == WCBE_EDITHASCHANGED;
}
@ -678,8 +674,7 @@ static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW const *ci
if (TRACE_ON(comboex)) COMBOEX_DumpItem (item);
SendMessageW (infoPtr->hwndCombo, CB_INSERTSTRING,
(WPARAM)cit->iItem, (LPARAM)item);
SendMessageW (infoPtr->hwndCombo, CB_INSERTSTRING, cit->iItem, (LPARAM)item);
memset (&nmcit.ceItem, 0, sizeof(nmcit.ceItem));
COMBOEX_CopyItem (item, &nmcit.ceItem);
@ -751,7 +746,7 @@ static HIMAGELIST COMBOEX_SetImageList (COMBOEX_INFO *infoPtr, HIMAGELIST himl)
{
HIMAGELIST himlTemp = infoPtr->himl;
TRACE("(...)\n");
TRACE("\n");
infoPtr->himl = himl;
@ -774,7 +769,7 @@ static BOOL COMBOEX_SetItemW (const COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
if ((index >= infoPtr->nb_items) || (index < -1)) return FALSE;
/* if the item is the edit control and there is no edit control, skip */
if ((index == -1) && !COMBOEX_HasEdit(infoPtr)) return FALSE;
if ((index == -1) && !infoPtr->hwndEdit) return FALSE;
if (!(item = COMBOEX_FindItem(infoPtr, index))) return FALSE;
@ -802,7 +797,7 @@ static BOOL COMBOEX_SetItemW (const COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
if (cit->mask & CBEIF_INDENT)
item->iIndent = cit->iIndent;
if (cit->mask & CBEIF_LPARAM)
cit->lParam = cit->lParam;
item->lParam = cit->lParam;
if (TRACE_ON(comboex)) COMBOEX_DumpItem (item);
@ -968,12 +963,10 @@ static INT COMBOEX_SetItemHeight (COMBOEX_INFO const *infoPtr, INT index, UINT h
static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs)
{
static const WCHAR COMBOBOX[] = { 'C', 'o', 'm', 'b', 'o', 'B', 'o', 'x', 0 };
static const WCHAR EDIT[] = { 'E', 'D', 'I', 'T', 0 };
static const WCHAR NIL[] = { 0 };
COMBOEX_INFO *infoPtr;
LOGFONTW mylogfont;
RECT wnrc1, clrc1, cmbwrc;
RECT win_rect;
INT i;
/* allocate memory for info structure */
@ -998,11 +991,13 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs)
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
/* create combo box */
GetWindowRect(hwnd, &wnrc1);
GetClientRect(hwnd, &clrc1);
TRACE("EX window=(%s), client=(%s)\n",
wine_dbgstr_rect(&wnrc1), wine_dbgstr_rect(&clrc1));
if (TRACE_ON(comboex)) {
RECT client, rect;
GetWindowRect(hwnd, &rect);
GetClientRect(hwnd, &client);
TRACE("EX window=(%s), client=(%s)\n",
wine_dbgstr_rect(&rect), wine_dbgstr_rect(&client));
}
/* Native version of ComboEx creates the ComboBox with DROPDOWNLIST */
/* specified. It then creates it's own version of the EDIT control */
@ -1011,7 +1006,7 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs)
/* We also need to place the edit control at the proper location */
/* (allow space for the icons). */
infoPtr->hwndCombo = CreateWindowW (COMBOBOX, NIL,
infoPtr->hwndCombo = CreateWindowW (WC_COMBOBOXW, NIL,
/* following line added to match native */
WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VSCROLL |
CBS_NOINTEGRALHEIGHT | CBS_DROPDOWNLIST |
@ -1030,22 +1025,16 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs)
* GetCurrentProcessId()
*/
/*
* Setup a property to hold the pointer to the COMBOBOXEX
* data structure.
*/
SetPropW(infoPtr->hwndCombo, COMBOEX_SUBCLASS_PROP, hwnd);
infoPtr->prevComboWndProc = (WNDPROC)SetWindowLongPtrW(infoPtr->hwndCombo,
GWLP_WNDPROC, (DWORD_PTR)COMBOEX_ComboWndProc);
SetWindowSubclass(infoPtr->hwndCombo, COMBOEX_ComboWndProc, COMBO_SUBCLASSID,
(DWORD_PTR)hwnd);
infoPtr->font = (HFONT)SendMessageW (infoPtr->hwndCombo, WM_GETFONT, 0, 0);
/*
* Now create our own EDIT control so we can position it.
* It is created only for CBS_DROPDOWN style
*/
if ((cs->style & CBS_DROPDOWNLIST) == CBS_DROPDOWN) {
infoPtr->hwndEdit = CreateWindowExW (0, EDIT, NIL,
infoPtr->hwndEdit = CreateWindowExW (0, WC_EDITW, NIL,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | ES_AUTOHSCROLL,
0, 0, 0, 0, /* will set later */
infoPtr->hwndCombo,
@ -1058,14 +1047,9 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs)
* GetWindowThreadProcessId(hwndEdit, &???)
* GetCurrentProcessId()
*/
SetWindowSubclass(infoPtr->hwndEdit, COMBOEX_EditWndProc, EDIT_SUBCLASSID,
(DWORD_PTR)hwnd);
/*
* Setup a property to hold the pointer to the COMBOBOXEX
* data structure.
*/
SetPropW(infoPtr->hwndEdit, COMBOEX_SUBCLASS_PROP, hwnd);
infoPtr->prevEditWndProc = (WNDPROC)SetWindowLongPtrW(infoPtr->hwndEdit,
GWLP_WNDPROC, (DWORD_PTR)COMBOEX_EditWndProc);
infoPtr->font = (HFONT)SendMessageW(infoPtr->hwndCombo, WM_GETFONT, 0, 0);
}
@ -1081,27 +1065,31 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs)
SendMessageW (infoPtr->hwndCombo, WM_SETFONT, (WPARAM)infoPtr->font, 0);
if (infoPtr->hwndEdit) {
SendMessageW (infoPtr->hwndEdit, WM_SETFONT, (WPARAM)infoPtr->font, 0);
SendMessageW (infoPtr->hwndEdit, EM_SETMARGINS, (WPARAM)EC_USEFONTINFO, 0);
SendMessageW (infoPtr->hwndEdit, EM_SETMARGINS, EC_USEFONTINFO, 0);
}
COMBOEX_ReSize (infoPtr);
/* Above is fairly certain, below is much less certain. */
GetWindowRect(hwnd, &wnrc1);
GetClientRect(hwnd, &clrc1);
GetWindowRect(infoPtr->hwndCombo, &cmbwrc);
TRACE("EX window=(%s) client=(%s) CB wnd=(%s)\n",
wine_dbgstr_rect(&wnrc1), wine_dbgstr_rect(&clrc1),
wine_dbgstr_rect(&cmbwrc));
SetWindowPos(infoPtr->hwndCombo, HWND_TOP,
0, 0, wnrc1.right-wnrc1.left, wnrc1.bottom-wnrc1.top,
GetWindowRect(hwnd, &win_rect);
if (TRACE_ON(comboex)) {
RECT client, rect;
GetClientRect(hwnd, &client);
GetWindowRect(infoPtr->hwndCombo, &rect);
TRACE("EX window=(%s) client=(%s) CB wnd=(%s)\n",
wine_dbgstr_rect(&win_rect), wine_dbgstr_rect(&client),
wine_dbgstr_rect(&rect));
}
SetWindowPos(infoPtr->hwndCombo, HWND_TOP, 0, 0,
win_rect.right - win_rect.left, win_rect.bottom - win_rect.top,
SWP_NOACTIVATE | SWP_NOREDRAW);
GetWindowRect(infoPtr->hwndCombo, &cmbwrc);
TRACE("CB window=(%s)\n", wine_dbgstr_rect(&cmbwrc));
SetWindowPos(hwnd, HWND_TOP,
0, 0, cmbwrc.right-cmbwrc.left, cmbwrc.bottom-cmbwrc.top,
GetWindowRect(infoPtr->hwndCombo, &win_rect);
TRACE("CB window=(%s)\n", wine_dbgstr_rect(&win_rect));
SetWindowPos(hwnd, HWND_TOP, 0, 0,
win_rect.right - win_rect.left, win_rect.bottom - win_rect.top,
SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOMOVE);
COMBOEX_AdjustEditPos (infoPtr);
@ -1158,7 +1146,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam)
*/
ShowWindow (infoPtr->hwndEdit, SW_SHOW);
InvalidateRect (infoPtr->hwndCombo, 0, TRUE);
InvalidateRect (infoPtr->hwndEdit, 0, TRUE);
if (infoPtr->hwndEdit) InvalidateRect (infoPtr->hwndEdit, 0, TRUE);
cursel = SendMessageW (infoPtr->hwndCombo, CB_GETCURSEL, 0, 0);
if (cursel == -1) {
cmp_func_t cmptext = get_cmp_func(infoPtr);
@ -1173,8 +1161,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam)
if ((cursel == n) || ((INT_PTR)item == CB_ERR)) {
TRACE("failed to find match??? item=%p cursel=%d\n",
item, cursel);
if (infoPtr->hwndEdit)
SetFocus(infoPtr->hwndEdit);
if (infoPtr->hwndEdit) SetFocus(infoPtr->hwndEdit);
return 0;
}
}
@ -1183,8 +1170,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam)
if ((INT_PTR)item == CB_ERR) {
TRACE("failed to find match??? item=%p cursel=%d\n",
item, cursel);
if (infoPtr->hwndEdit)
SetFocus(infoPtr->hwndEdit);
if (infoPtr->hwndEdit) SetFocus(infoPtr->hwndEdit);
return 0;
}
}
@ -1280,8 +1266,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam)
* after passing the command to the parent of the ComboEx.
*/
lret = SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf);
if (infoPtr->hwndEdit)
SetFocus(infoPtr->hwndEdit);
if (infoPtr->hwndEdit) SetFocus(infoPtr->hwndEdit);
return lret;
}
return 0;
@ -1377,14 +1362,12 @@ static LRESULT COMBOEX_DrawItem (const COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT con
(dis->itemAction == ODA_DRAWENTIRE)) {
/* draw of edit control data */
/* testing */
{
if (TRACE_ON(comboex)) {
RECT exrc, cbrc, edrc;
GetWindowRect (infoPtr->hwndSelf, &exrc);
GetWindowRect (infoPtr->hwndCombo, &cbrc);
edrc.left=edrc.top=edrc.right=edrc.bottom=-1;
if (infoPtr->hwndEdit)
GetWindowRect (infoPtr->hwndEdit, &edrc);
edrc.left = edrc.top = edrc.right = edrc.bottom = -1;
if (infoPtr->hwndEdit) GetWindowRect (infoPtr->hwndEdit, &edrc);
TRACE("window rects ex=(%s), cb=(%s), ed=(%s)\n",
wine_dbgstr_rect(&exrc), wine_dbgstr_rect(&cbrc),
wine_dbgstr_rect(&edrc));
@ -1595,8 +1578,12 @@ static void COMBOEX_ResetContent (COMBOEX_INFO *infoPtr)
static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr)
{
if (infoPtr->hwndCombo)
DestroyWindow (infoPtr->hwndCombo);
RemoveWindowSubclass(infoPtr->hwndCombo, COMBOEX_ComboWndProc, COMBO_SUBCLASSID);
if (infoPtr->hwndEdit)
RemoveWindowSubclass(infoPtr->hwndEdit, COMBOEX_EditWndProc, EDIT_SUBCLASSID);
COMBOEX_FreeText (infoPtr->edit);
Free (infoPtr->edit);
infoPtr->edit = 0;
@ -1720,11 +1707,11 @@ static LRESULT COMBOEX_WindowPosChanging (const COMBOEX_INFO *infoPtr, WINDOWPOS
return 0;
}
static LRESULT WINAPI
COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
static LRESULT CALLBACK
COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
UINT_PTR uId, DWORD_PTR ref_data)
{
HWND hwndComboex = GetPropW(hwnd, COMBOEX_SUBCLASS_PROP);
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr (hwndComboex);
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr ((HWND)ref_data);
NMCBEENDEDITW cbeend;
WCHAR edit_text[260];
COLORREF obkc;
@ -1744,8 +1731,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* handle (ignore) the return character */
if (wParam == VK_RETURN) return 0;
/* all other characters pass into the real Edit */
return CallWindowProcW (infoPtr->prevEditWndProc,
hwnd, uMsg, wParam, lParam);
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
case WM_ERASEBKGND:
/*
@ -1757,8 +1743,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
TRACE("erasing (%s)\n", wine_dbgstr_rect(&rect));
ExtTextOutW (hDC, 0, 0, ETO_OPAQUE, &rect, 0, 0, 0);
SetBkColor (hDC, obkc);
return CallWindowProcW (infoPtr->prevEditWndProc,
hwnd, uMsg, wParam, lParam);
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
case WM_KEYDOWN: {
INT_PTR oldItem, selected, step = 1;
@ -1864,8 +1849,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
oldItem = SendMessageW (infoPtr->hwndCombo,CB_GETCURSEL, 0, 0);
if (oldItem != -1) {
/* if something is selected, then deselect it */
SendMessageW (infoPtr->hwndCombo, CB_SETCURSEL,
(WPARAM)-1, 0);
SendMessageW (infoPtr->hwndCombo, CB_SETCURSEL, -1, 0);
}
InvalidateRect (infoPtr->hwndCombo, 0, 0);
SetFocus(infoPtr->hwndEdit);
@ -1880,16 +1864,14 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
SendMessageW (infoPtr->hwndSelf, CB_SETCURSEL, oldItem + step, 0);
return 0;
default:
return CallWindowProcW (infoPtr->prevEditWndProc,
hwnd, uMsg, wParam, lParam);
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
}
return 0;
}
case WM_SETFOCUS:
/* remember the focus to set state of icon */
lret = CallWindowProcW (infoPtr->prevEditWndProc,
hwnd, uMsg, wParam, lParam);
lret = DefSubclassProc(hwnd, uMsg, wParam, lParam);
infoPtr->flags |= WCBE_EDITFOCUSED;
return lret;
@ -1912,17 +1894,16 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* fall through */
default:
return CallWindowProcW (infoPtr->prevEditWndProc,
hwnd, uMsg, wParam, lParam);
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
}
}
static LRESULT WINAPI
COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
static LRESULT CALLBACK
COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
UINT_PTR uId, DWORD_PTR ref_data)
{
HWND hwndComboex = GetPropW(hwnd, COMBOEX_SUBCLASS_PROP);
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr (hwndComboex);
COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr ((HWND)ref_data);
NMCBEENDEDITW cbeend;
NMMOUSE nmmse;
COLORREF obkc;
@ -1947,8 +1928,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
* that ComboEx knows this is listbox.
*/
((DRAWITEMSTRUCT *)lParam)->itemState |= ODS_COMBOEXLBOX;
return CallWindowProcW (infoPtr->prevComboWndProc,
hwnd, uMsg, wParam, lParam);
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
case WM_ERASEBKGND:
/*
@ -1960,8 +1940,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
TRACE("erasing (%s)\n", wine_dbgstr_rect(&rect));
ExtTextOutW (hDC, 0, 0, ETO_OPAQUE, &rect, 0, 0, 0);
SetBkColor (hDC, obkc);
return CallWindowProcW (infoPtr->prevComboWndProc,
hwnd, uMsg, wParam, lParam);
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
case WM_SETCURSOR:
/*
@ -1975,8 +1954,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
nmmse.pt.y = 0;
nmmse.dwHitInfo = lParam;
COMBOEX_Notify (infoPtr, NM_SETCURSOR, (NMHDR *)&nmmse);
return CallWindowProcW (infoPtr->prevComboWndProc,
hwnd, uMsg, wParam, lParam);
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
case WM_LBUTTONDOWN:
GetClientRect (hwnd, &rect);
@ -1986,16 +1964,16 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
pt.x = (short)LOWORD(lParam);
pt.y = (short)HIWORD(lParam);
if (PtInRect(&rect, pt))
return CallWindowProcW (infoPtr->prevComboWndProc,
hwnd, uMsg, wParam, lParam);
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
infoPtr->flags |= WCBE_MOUSECAPTURED;
SetCapture(hwnd);
break;
case WM_LBUTTONUP:
if (!(infoPtr->flags & WCBE_MOUSECAPTURED))
return CallWindowProcW (infoPtr->prevComboWndProc,
hwnd, uMsg, wParam, lParam);
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
ReleaseCapture();
infoPtr->flags &= ~WCBE_MOUSECAPTURED;
if (infoPtr->flags & WCBE_MOUSEDRAGGED) {
@ -2012,8 +1990,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
COMBOEX_NotifyDragBegin(infoPtr, edit_text);
infoPtr->flags |= WCBE_MOUSEDRAGGED;
}
return CallWindowProcW (infoPtr->prevComboWndProc,
hwnd, uMsg, wParam, lParam);
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
case WM_COMMAND:
switch (HIWORD(wParam)) {
@ -2157,8 +2134,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
break;
}/* fall through */
default:
return CallWindowProcW (infoPtr->prevComboWndProc,
hwnd, uMsg, wParam, lParam);
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
}
return 0;
}

View file

@ -231,18 +231,7 @@ extern void UPDOWN_Unregister(void);
int MONTHCAL_MonthLength(int month, int year);
static inline void MONTHCAL_CopyTime(const SYSTEMTIME *from, SYSTEMTIME *to)
{
to->wYear = from->wYear;
to->wMonth = from->wMonth;
to->wDayOfWeek = from->wDayOfWeek;
to->wDay = from->wDay;
to->wHour = from->wHour;
to->wMinute = from->wMinute;
to->wSecond = from->wSecond;
to->wMilliseconds = from->wMilliseconds;
}
int MONTHCAL_CalculateDayOfWeek(SYSTEMTIME *date, BOOL inplace);
extern void THEMING_Initialize(void);
extern void THEMING_Uninitialize(void);

View file

@ -47,6 +47,7 @@
<file>treeview.c</file>
<file>updown.c</file>
<file>rsrc.rc</file>
<library>uuid</library>
<library>wine</library>
<library>user32</library>
<library>gdi32</library>

View file

@ -885,9 +885,11 @@ INT WINAPI EnumMRUListA (HANDLE hList, INT nItemPos, LPVOID lpBuffer,
} else {
lenA = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)&witem->datastart, -1,
NULL, 0, NULL, NULL);
datasize = min( witem->size, nBufferSize );
datasize = min( lenA, nBufferSize );
WideCharToMultiByte(CP_ACP, 0, (LPWSTR)&witem->datastart, -1,
lpBuffer, datasize, NULL, NULL);
((char *)lpBuffer)[ datasize - 1 ] = '\0';
datasize = lenA - 1;
}
TRACE("(%p, %d, %p, %d): returning len=%d\n",
hList, nItemPos, lpBuffer, nBufferSize, datasize);

View file

@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140

View file

@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
/* Czech strings in CP1250 */

View file

@ -16,11 +16,15 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
#pragma code_page(65001)
LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
STRINGTABLE DISCARDABLE
{
IDS_CLOSE "Schließen"
IDS_CLOSE "Schließen"
}
STRINGTABLE DISCARDABLE
@ -41,7 +45,7 @@ STRINGTABLE DISCARDABLE
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140
STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Eigenschaften für %s"
CAPTION "Eigenschaften für %s"
FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "&OK", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP
@ -57,9 +61,9 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Wizard"
FONT 8, "MS Shell Dlg"
BEGIN
PUSHBUTTON "< &Zurück", IDC_BACK_BUTTON,71,138,50,14
PUSHBUTTON "< &Zurück", IDC_BACK_BUTTON,71,138,50,14
DEFPUSHBUTTON "&Weiter >", IDC_NEXT_BUTTON,121,138,50,14
DEFPUSHBUTTON "&Beenden", IDC_FINISH_BUTTON,121,138,50,14
DEFPUSHBUTTON "&Fertig", IDC_FINISH_BUTTON,121,138,50,14
PUSHBUTTON "Abbrechen", IDCANCEL,178,138,50,14
PUSHBUTTON "&Hilfe", IDHELP,235,138,50,14,WS_GROUP
LTEXT "", IDC_SUNKEN_LINE,7,129,278,1,SS_SUNKEN
@ -73,15 +77,15 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Toolbar einrichten"
FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "&Schließen", IDCANCEL,308,6,44,14
PUSHBUTTON "&Zurücksetzen", IDC_RESET_BTN,308,23,44,14
DEFPUSHBUTTON "&Schließen", IDCANCEL,308,6,44,14
PUSHBUTTON "&Zurücksetzen", IDC_RESET_BTN,308,23,44,14
PUSHBUTTON "&Hilfe", IDC_HELP_BTN,308,40,44,14
PUSHBUTTON "Nach &Oben verschieben", IDC_MOVEUP_BTN,308,74,44,14
PUSHBUTTON "Nach &Unten verschieben", IDC_MOVEDN_BTN,308,91,44,14
LTEXT "&Vorhandene Knöpfe:", -1,4,5,84,10
LTEXT "&Vorhandene Knöpfe:", -1,4,5,84,10
LISTBOX IDC_AVAILBTN_LBOX,4,17,120,100, LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
PUSHBUTTON "H&inzufügen ->", IDOK, 131, 42, 44, 14
PUSHBUTTON "<- &Löschen", IDC_REMOVE_BTN,131,62,44,14
LTEXT "&Toolbarknöpfe:", -1,182,5,78,10
PUSHBUTTON "H&inzufügen ->", IDOK, 131, 42, 44, 14
PUSHBUTTON "<- &Löschen", IDC_REMOVE_BTN,131,62,44,14
LTEXT "&Toolbarknöpfe:", -1,182,5,78,10
LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
END

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
LANGUAGE LANG_GREEK, SUBLANG_DEFAULT
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
LANGUAGE LANG_ESPERANTO, SUBLANG_DEFAULT
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140

View file

@ -3,7 +3,7 @@
* French language support
*
* Copyright 1999 Eric Kohl
* Copyright 2003 Vincent Béron
* Copyright 2003 Vincent Béron
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -20,11 +20,16 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
/* UTF-8 */
#pragma code_page(65001)
LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140
STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Propriétés pour %s"
CAPTION "Propriétés pour %s"
FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "OK", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP
@ -40,9 +45,9 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Assistant"
FONT 8, "MS Shell Dlg"
BEGIN
PUSHBUTTON "< &Précédent", IDC_BACK_BUTTON,71,138,50,14
DEFPUSHBUTTON "&Suivant >", IDC_NEXT_BUTTON,121,138,50,14
DEFPUSHBUTTON "Terminer", IDC_FINISH_BUTTON,121,138,50,14
PUSHBUTTON "< &Précédent", IDC_BACK_BUTTON,71,138,50,14
DEFPUSHBUTTON "&Suivant >", IDC_NEXT_BUTTON,123,138,50,14
DEFPUSHBUTTON "Terminer", IDC_FINISH_BUTTON,123,138,50,14
PUSHBUTTON "Annuler", IDCANCEL,178,138,50,14
PUSHBUTTON "Aide", IDHELP,235,138,50,14,WS_GROUP
LTEXT "", IDC_SUNKEN_LINE,7,129,278,1,SS_SUNKEN
@ -57,15 +62,15 @@ CAPTION "Personnaliser la barre d'outils"
FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "&Fermer", IDCANCEL,308,6,44,14
PUSHBUTTON "&Réinitialiser", IDC_RESET_BTN,308,23,44,14
PUSHBUTTON "&Réinitialiser", IDC_RESET_BTN,308,23,44,14
PUSHBUTTON "Aid&e", IDC_HELP_BTN,308,40,44,14
PUSHBUTTON "&Monter", IDC_MOVEUP_BTN,308,74,44,14
PUSHBUTTON "&Descendre", IDC_MOVEDN_BTN,308,91,44,14
LTEXT "Boutons disponibles :", -1,4,5,84,10
LTEXT "Boutons &disponibles :", -1,4,5,84,10
LISTBOX IDC_AVAILBTN_LBOX,4,17,120,100, LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
PUSHBUTTON "A&jouter ->", IDOK, 131, 42, 44, 14
PUSHBUTTON "<- E&nlever", IDC_REMOVE_BTN,131,62,44,14
LTEXT "&Boutons de la barre d'outils :", -1,182,5,78,10
LTEXT "&Boutons de la barre d'outils :", -1,182,5,93,10
LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
END
@ -77,12 +82,12 @@ STRINGTABLE DISCARDABLE
STRINGTABLE DISCARDABLE
{
IDM_TODAY "Aujourd'hui:"
IDM_GOTODAY "Aller à aujourd'hui"
IDM_GOTODAY "Aller à aujourd'hui"
}
STRINGTABLE DISCARDABLE
{
IDS_SEPARATOR "Séparateur"
IDS_SEPARATOR "Séparateur"
}
STRINGTABLE DISCARDABLE

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140

View file

@ -17,6 +17,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
/* UTF-8 */
#pragma code_page(65001)
@ -23,7 +25,7 @@ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140
STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Properties for %s"
CAPTION "%sのプロパティ"
FONT 9, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "OK", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP
@ -36,11 +38,11 @@ END
IDD_WIZARD DIALOG DISCARDABLE 0, 0, 290, 159
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Wizard"
CAPTION "ウィザード"
FONT 9, "MS Shell Dlg"
BEGIN
PUSHBUTTON "< 戻る(&B)", IDC_BACK_BUTTON,71,138,50,14
DEFPUSHBUTTON "進む(&N) >", IDC_NEXT_BUTTON,121,138,50,14
DEFPUSHBUTTON "次へ(&N) >", IDC_NEXT_BUTTON,121,138,50,14
DEFPUSHBUTTON "完了", IDC_FINISH_BUTTON,121,138,50,14
PUSHBUTTON "キャンセル", IDCANCEL,178,138,50,14
PUSHBUTTON "ヘルプ", IDHELP,235,138,50,14,WS_GROUP
@ -52,7 +54,7 @@ END
IDD_TBCUSTOMIZE DIALOG DISCARDABLE 10, 20, 357, 125
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Customize Toolbar"
CAPTION "ツールバーのカスタマイズ"
FONT 9, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "閉じる(&C)", IDCANCEL,308,6,44,14
@ -60,33 +62,31 @@ BEGIN
PUSHBUTTON "ヘルプ(&H)", IDC_HELP_BTN,308,40,44,14
PUSHBUTTON "上へ (&U)", IDC_MOVEUP_BTN,308,74,44,14
PUSHBUTTON "下へ (&D)", IDC_MOVEDN_BTN,308,91,44,14
LTEXT "A&vailable buttons:", -1,4,5,84,10
LTEXT "利用可能なボタン(&V):", -1,4,5,84,10
LISTBOX IDC_AVAILBTN_LBOX,4,17,120,100, LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
PUSHBUTTON "追加(&A) ->", IDOK, 131, 42, 44, 14
PUSHBUTTON "<- 削除(&R)", IDC_REMOVE_BTN,131,62,44,14
LTEXT "&Toolbar buttons:", -1,182,5,78,10
LTEXT "ツールバーのボタン(&T):", -1,182,5,78,10
LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
END
STRINGTABLE DISCARDABLE
{
IDS_CLOSE "Close"
IDS_CLOSE "閉じる"
}
STRINGTABLE DISCARDABLE
{
IDM_TODAY "Today:"
IDM_GOTODAY "Go to today"
IDM_TODAY "今日:"
IDM_GOTODAY "今日へ移動"
}
STRINGTABLE DISCARDABLE
{
IDS_SEPARATOR "Separator"
IDS_SEPARATOR "区切り"
}
STRINGTABLE DISCARDABLE
{
HKY_NONE "None"
HKY_NONE "なし"
}
#pragma code_page(default)

View file

@ -17,6 +17,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
/* UTF-8 */
#pragma code_page(65001)
@ -88,5 +90,3 @@ STRINGTABLE DISCARDABLE
{
HKY_NONE "Joks"
}
#pragma code_page(default)

View file

@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140
@ -75,7 +77,7 @@ STRINGTABLE DISCARDABLE
STRINGTABLE DISCARDABLE
{
IDM_TODAY "Vandaag:"
IDM_GOTODAY "Ga vandaag naar"
IDM_GOTODAY "Ga naar vandaag"
}
STRINGTABLE DISCARDABLE

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140

View file

@ -17,6 +17,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140

View file

@ -1,6 +1,7 @@
/*
* Copyright 2003 Marcelo Duarte
* Copyright 2006-2007 Américo José Melo
* Copyright 2006-2007 Américo José Melo
* Copyright 2009 Ricardo Filipe
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -17,21 +18,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
#include "comctl32.h"
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140
STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Propriedades para %s"
FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "OK", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP
PUSHBUTTON "Cancelar", IDCANCEL,58,122,50,14
PUSHBUTTON "&Aplicar", IDC_APPLY_BUTTON,112,122,50,14,WS_DISABLED
PUSHBUTTON "Ajuda", IDHELP,166,122,50,14,WS_TABSTOP|WS_GROUP
CONTROL "Tab", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114
END
#pragma code_page(65001)
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE
LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140
STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
@ -45,27 +36,21 @@ BEGIN
CONTROL "Separador", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114
END
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
IDD_WIZARD DIALOG DISCARDABLE 0, 0, 290, 159
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Assistente"
FONT 8, "MS Shell Dlg"
BEGIN
PUSHBUTTON "< &Voltar", IDC_BACK_BUTTON,71,138,50,14
DEFPUSHBUTTON "&Avançar >", IDC_NEXT_BUTTON,121,138,50,14
DEFPUSHBUTTON "&Avançar >", IDC_NEXT_BUTTON,121,138,50,14
DEFPUSHBUTTON "Finalizar", IDC_FINISH_BUTTON,121,138,50,14
PUSHBUTTON "Cancelar", IDCANCEL,178,138,50,14
PUSHBUTTON "Ajuda", IDHELP,235,138,50,14,WS_GROUP
LTEXT "", IDC_SUNKEN_LINE,7,129,278,1,SS_SUNKEN
CONTROL "Tab", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS | WS_DISABLED,7,7,258,5
CONTROL "Separador", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS | WS_DISABLED,7,7,258,5
LTEXT "", IDC_SUNKEN_LINEHEADER,0,35,290,1,SS_LEFT | SS_SUNKEN | WS_CHILD | WS_VISIBLE
END
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
IDD_TBCUSTOMIZE DIALOG DISCARDABLE 10, 20, 357, 125
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Personalizar barra de ferramentas"
@ -76,42 +61,30 @@ BEGIN
PUSHBUTTON "&Ajuda", IDC_HELP_BTN,308,40,44,14
PUSHBUTTON "A&cima", IDC_MOVEUP_BTN,308,74,44,14
PUSHBUTTON "A&baixo", IDC_MOVEDN_BTN,308,91,44,14
LTEXT "Botões &disponíveis:", -1,4,5,84,10
LTEXT "Botões &disponíveis:", -1,4,5,84,10
LISTBOX IDC_AVAILBTN_LBOX,4,17,120,100, LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
PUSHBUTTON "&Adicionar ->", IDOK, 131, 42, 44, 14
PUSHBUTTON "<- &Remover", IDC_REMOVE_BTN,131,62,44,14
LTEXT "&Botões da barra de ferramentas:", -1,182,5,78,10
LTEXT "&Botões da barra de ferramentas:", -1,182,5,78,10
LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
END
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
STRINGTABLE DISCARDABLE
{
IDS_CLOSE "Fechar"
}
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
STRINGTABLE DISCARDABLE
{
IDM_TODAY "Hoje:"
IDM_GOTODAY "Ir para hoje"
}
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
STRINGTABLE DISCARDABLE
{
IDS_SEPARATOR "Separador"
}
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
STRINGTABLE DISCARDABLE
{
HKY_NONE "Nenhum"

View file

@ -17,6 +17,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL
#pragma code_page(65001)
@ -88,5 +90,3 @@ STRINGTABLE DISCARDABLE
{
HKY_NONE "Nimic"
}
#pragma code_page(default)

View file

@ -18,31 +18,36 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
/* UTF-8 */
#pragma code_page(65001)
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140
STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Ñâîéñòâà äëÿ %s"
CAPTION "Свойства для %s"
FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "OK", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP
PUSHBUTTON "Îòìåíà", IDCANCEL,58,122,50,14
PUSHBUTTON "Ïðè&ìåíèòü", IDC_APPLY_BUTTON,112,122,50,14,WS_DISABLED
PUSHBUTTON "&Ñïðàâêà", IDHELP,166,122,50,14,WS_TABSTOP|WS_GROUP
PUSHBUTTON "Отмена", IDCANCEL,58,122,50,14
PUSHBUTTON "При&менить", IDC_APPLY_BUTTON,112,122,50,14,WS_DISABLED
PUSHBUTTON "&Справка", IDHELP,166,122,50,14,WS_TABSTOP|WS_GROUP
CONTROL "Tab", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114
END
IDD_WIZARD DIALOG DISCARDABLE 0, 0, 290, 159
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Ìàñòåð"
CAPTION "Мастер"
FONT 8, "MS Shell Dlg"
BEGIN
PUSHBUTTON "< &Íàçàä", IDC_BACK_BUTTON,71,138,50,14
DEFPUSHBUTTON "&Äàëåå >", IDC_NEXT_BUTTON,121,138,50,14
DEFPUSHBUTTON "Ãîòîâî", IDC_FINISH_BUTTON,121,138,50,14
PUSHBUTTON "Îòìåíà", IDCANCEL,178,138,50,14
PUSHBUTTON "&Ñïðàâêà", IDHELP,235,138,50,14,WS_GROUP
PUSHBUTTON "< &Назад", IDC_BACK_BUTTON,71,138,50,14
DEFPUSHBUTTON "&Далее >", IDC_NEXT_BUTTON,121,138,50,14
DEFPUSHBUTTON "Готово", IDC_FINISH_BUTTON,121,138,50,14
PUSHBUTTON "Отмена", IDCANCEL,178,138,50,14
PUSHBUTTON "&Справка", IDHELP,235,138,50,14,WS_GROUP
LTEXT "", IDC_SUNKEN_LINE,7,129,278,1,SS_SUNKEN
CONTROL "Tab", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS | WS_DISABLED,7,7,258,5
LTEXT "", IDC_SUNKEN_LINEHEADER,0,35,290,1,SS_LEFT | SS_SUNKEN | WS_CHILD | WS_VISIBLE
@ -51,39 +56,39 @@ END
IDD_TBCUSTOMIZE DIALOG DISCARDABLE 10, 20, 357, 125
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Íàñòðîéêà ïàíåëè èíñòðóìåíòîâ"
CAPTION "Настройка панели инструментов"
FONT 8, "MS Shell Dlg"
BEGIN
DEFPUSHBUTTON "&Çàêðûòü", IDCANCEL,308,6,44,14
PUSHBUTTON "Ñ&áðîñèòü", IDC_RESET_BTN,308,23,44,14
PUSHBUTTON "&Ñïðàâêà", IDC_HELP_BTN,308,40,44,14
PUSHBUTTON "Ïåðåìåñòèòü &ââåðõ", IDC_MOVEUP_BTN,308,74,44,14
PUSHBUTTON "Ïåðåìåñòèòü &âíèç", IDC_MOVEDN_BTN,308,91,44,14
LTEXT "&Äîñòóïíûå êíîïêè:", -1,4,5,84,10
DEFPUSHBUTTON "&Закрыть", IDCANCEL,308,6,44,14
PUSHBUTTON "С&бросить", IDC_RESET_BTN,308,23,44,14
PUSHBUTTON "&Справка", IDC_HELP_BTN,308,40,44,14
PUSHBUTTON "Переместить &вверх", IDC_MOVEUP_BTN,308,74,44,14
PUSHBUTTON "Переместить &вниз", IDC_MOVEDN_BTN,308,91,44,14
LTEXT "&Доступные кнопки:", -1,4,5,84,10
LISTBOX IDC_AVAILBTN_LBOX,4,17,120,100, LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
PUSHBUTTON "&Äîáàâèòü ->", IDOK, 131, 42, 44, 14
PUSHBUTTON "<- &Óäàëèòü", IDC_REMOVE_BTN,131,62,44,14
LTEXT "&Êíîïêè ïàíåëè èíñòðóìåíòîâ:", -1,182,5,78,10
PUSHBUTTON "&Добавить ->", IDOK, 131, 42, 44, 14
PUSHBUTTON "<- &Удалить", IDC_REMOVE_BTN,131,62,44,14
LTEXT "&Кнопки панели инструментов:", -1,182,5,78,10
LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
END
STRINGTABLE DISCARDABLE
{
IDS_CLOSE "Çàêðûòü"
IDS_CLOSE "Закрыть"
}
STRINGTABLE DISCARDABLE
{
IDM_TODAY "Ñåãîäíÿ:"
IDM_GOTODAY "Òåêóùàÿ äàòà"
IDM_TODAY "Сегодня:"
IDM_GOTODAY "Текущая дата"
}
STRINGTABLE DISCARDABLE
{
IDS_SEPARATOR "Ðàçäåëèòåëü"
IDS_SEPARATOR "Разделитель"
}
STRINGTABLE DISCARDABLE
{
HKY_NONE "Íåò"
HKY_NONE "Нет"
}

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
#pragma code_page(65001)
LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT
@ -87,5 +89,3 @@ STRINGTABLE DISCARDABLE
{
HKY_NONE "Brez"
}
#pragma code_page(default)

View file

@ -17,6 +17,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
/* Slovak strings in CP1250 */
LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
LANGUAGE LANG_THAI, SUBLANG_DEFAULT
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140

View file

@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140

View file

@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "comctl32.h"
/* Chinese text is encoded in UTF-8 */
#pragma code_page(65001)
@ -161,5 +163,3 @@ STRINGTABLE DISCARDABLE
{
HKY_NONE "無"
}
#pragma code_page(default)

View file

@ -784,7 +784,7 @@ CreateToolbarEx (HWND hwnd, DWORD style, UINT wID, INT nBitmaps,
if(hwndTB) {
TBADDBITMAP tbab;
SendMessageW (hwndTB, TB_BUTTONSTRUCTSIZE, (WPARAM)uStructSize, 0);
SendMessageW (hwndTB, TB_BUTTONSTRUCTSIZE, uStructSize, 0);
/* set bitmap and button size */
/*If CreateToolbarEx receives 0, windows sets default values*/
@ -811,12 +811,11 @@ CreateToolbarEx (HWND hwnd, DWORD style, UINT wID, INT nBitmaps,
tbab.hInst = hBMInst;
tbab.nID = wBMID;
SendMessageW (hwndTB, TB_ADDBITMAP, (WPARAM)nBitmaps, (LPARAM)&tbab);
SendMessageW (hwndTB, TB_ADDBITMAP, nBitmaps, (LPARAM)&tbab);
}
/* add buttons */
if(iNumButtons > 0)
SendMessageW (hwndTB, TB_ADDBUTTONSW,
(WPARAM)iNumButtons, (LPARAM)lpButtons);
SendMessageW (hwndTB, TB_ADDBUTTONSW, iNumButtons, (LPARAM)lpButtons);
}
return hwndTB;
@ -923,8 +922,7 @@ CreateMappedBitmap (HINSTANCE hInstance, INT_PTR idBitmap, UINT wFlags,
if (hbm) {
HDC hdcDst = CreateCompatibleDC (hdcScreen);
HBITMAP hbmOld = SelectObject (hdcDst, hbm);
const BYTE *lpBits = (const BYTE *)(lpBitmap + 1);
lpBits += nColorTableSize * sizeof(RGBQUAD);
const BYTE *lpBits = (const BYTE *)lpBitmap + nSize;
StretchDIBits (hdcDst, 0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight,
lpBits, (LPBITMAPINFO)lpBitmapInfo, DIB_RGB_COLORS,
SRCCOPY);
@ -1403,9 +1401,8 @@ COMCTL32_CreateToolTip(HWND hwndOwner)
nmttc.hdr.code = NM_TOOLTIPSCREATED;
nmttc.hwndToolTips = hwndToolTip;
SendMessageW(GetParent(hwndTrueOwner), WM_NOTIFY,
(WPARAM)GetWindowLongPtrW(hwndTrueOwner, GWLP_ID),
(LPARAM)&nmttc);
SendMessageW(GetParent(hwndTrueOwner), WM_NOTIFY,
GetWindowLongPtrW(hwndTrueOwner, GWLP_ID), (LPARAM)&nmttc);
}
return hwndToolTip;

View file

@ -31,7 +31,6 @@
* TODO:
* -- DTS_APPCANPARSE
* -- DTS_SHORTDATECENTURYFORMAT
* -- DTN_CLOSEUP
* -- DTN_FORMAT
* -- DTN_FORMATQUERY
* -- DTN_USERSTRING
@ -88,6 +87,7 @@ typedef struct
/* in monthcal.c */
extern int MONTHCAL_MonthLength(int month, int year);
extern int MONTHCAL_CalculateDayOfWeek(SYSTEMTIME *date, BOOL inplace);
/* this list of defines is closely related to `allowedformatchars' defined
* in datetime.c; the high nibble indicates the `base type' of the format
@ -125,10 +125,11 @@ extern int MONTHCAL_MonthLength(int month, int year);
#define DTHT_DATEFIELD 0xff /* for hit-testing */
#define DTHT_NONE 0
#define DTHT_CHECKBOX 0x200 /* these should end at '00' , to make */
#define DTHT_MCPOPUP 0x300 /* & DTHT_DATEFIELD 0 when DATETIME_KeyDown */
#define DTHT_GOTFOCUS 0x400 /* tests for date-fields */
#define DTHT_NONE 0x1000
#define DTHT_CHECKBOX 0x2000 /* these should end at '00' , to make */
#define DTHT_MCPOPUP 0x3000 /* & DTHT_DATEFIELD 0 when DATETIME_KeyDown */
#define DTHT_GOTFOCUS 0x4000 /* tests for date-fields */
#define DTHT_NODATEMASK 0xf000 /* to mask check and drop down from others */
static BOOL DATETIME_SendSimpleNotify (const DATETIME_INFO *infoPtr, UINT code);
static BOOL DATETIME_SendDateTimeChangeNotify (const DATETIME_INFO *infoPtr);
@ -138,43 +139,45 @@ static const int maxrepetition [] = {4,2,2,2,4,2,2,4,-1};
static DWORD
DATETIME_GetSystemTime (const DATETIME_INFO *infoPtr, SYSTEMTIME *lprgSysTimeArray)
DATETIME_GetSystemTime (const DATETIME_INFO *infoPtr, SYSTEMTIME *systime)
{
if (!lprgSysTimeArray) return GDT_NONE;
if (!systime) return GDT_NONE;
if ((infoPtr->dwStyle & DTS_SHOWNONE) &&
(SendMessageW (infoPtr->hwndCheckbut, BM_GETCHECK, 0, 0) == BST_UNCHECKED))
return GDT_NONE;
MONTHCAL_CopyTime (&infoPtr->date, lprgSysTimeArray);
*systime = infoPtr->date;
return GDT_VALID;
}
static BOOL
DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, const SYSTEMTIME *lprgSysTimeArray)
DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, const SYSTEMTIME *systime)
{
if (!lprgSysTimeArray) return 0;
if (!systime) return 0;
TRACE("%04d/%02d/%02d %02d:%02d:%02d\n",
lprgSysTimeArray->wYear, lprgSysTimeArray->wMonth, lprgSysTimeArray->wDay,
lprgSysTimeArray->wHour, lprgSysTimeArray->wMinute, lprgSysTimeArray->wSecond);
systime->wYear, systime->wMonth, systime->wDay,
systime->wHour, systime->wMinute, systime->wSecond);
if (flag == GDT_VALID) {
if (lprgSysTimeArray->wYear < 1601 || lprgSysTimeArray->wYear > 30827 ||
lprgSysTimeArray->wMonth < 1 || lprgSysTimeArray->wMonth > 12 ||
lprgSysTimeArray->wDayOfWeek > 6 ||
lprgSysTimeArray->wDay < 1 || lprgSysTimeArray->wDay > 31 ||
lprgSysTimeArray->wHour > 23 ||
lprgSysTimeArray->wMinute > 59 ||
lprgSysTimeArray->wSecond > 59 ||
lprgSysTimeArray->wMilliseconds > 999
if (systime->wYear < 1601 || systime->wYear > 30827 ||
systime->wMonth < 1 || systime->wMonth > 12 ||
systime->wDay < 1 || systime->wDay > 31 ||
systime->wHour > 23 ||
systime->wMinute > 59 ||
systime->wSecond > 59 ||
systime->wMilliseconds > 999
)
return 0;
return FALSE;
infoPtr->dateValid = TRUE;
MONTHCAL_CopyTime (lprgSysTimeArray, &infoPtr->date);
infoPtr->date = *systime;
/* always store a valid day of week */
MONTHCAL_CalculateDayOfWeek(&infoPtr->date, TRUE);
SendMessageW (infoPtr->hMonthCal, MCM_SETCURSEL, 0, (LPARAM)(&infoPtr->date));
SendMessageW (infoPtr->hwndCheckbut, BM_SETCHECK, BST_CHECKED, 0);
} else if ((infoPtr->dwStyle & DTS_SHOWNONE) && (flag == GDT_NONE)) {
@ -182,7 +185,7 @@ DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, const SYSTEMTIME *lp
SendMessageW (infoPtr->hwndCheckbut, BM_SETCHECK, BST_UNCHECKED, 0);
}
else
return 0;
return FALSE;
InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
return TRUE;
@ -286,7 +289,7 @@ DATETIME_SetFormatW (DATETIME_INFO *infoPtr, LPCWSTR lpszFormat)
format_item = LOCALE_STIMEFORMAT;
else /* DTS_SHORTDATEFORMAT */
format_item = LOCALE_SSHORTDATE;
GetLocaleInfoW( GetSystemDefaultLCID(), format_item, format_buf, sizeof(format_buf)/sizeof(format_buf[0]));
GetLocaleInfoW(LOCALE_USER_DEFAULT, format_item, format_buf, sizeof(format_buf)/sizeof(format_buf[0]));
lpszFormat = format_buf;
}
@ -407,12 +410,12 @@ DATETIME_ReturnTxt (const DATETIME_INFO *infoPtr, int count, LPWSTR result, int
wsprintfW (result, fmt__2dW, date.wMonth);
break;
case THREECHARMONTH:
GetLocaleInfoW(GetSystemDefaultLCID(), LOCALE_SMONTHNAME1+date.wMonth -1,
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1+date.wMonth -1,
buffer, sizeof(buffer)/sizeof(buffer[0]));
wsprintfW (result, fmt__3sW, buffer);
break;
case FULLMONTH:
GetLocaleInfoW(GetSystemDefaultLCID(),LOCALE_SMONTHNAME1+date.wMonth -1,
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1+date.wMonth -1,
result, resultSize);
break;
case ONELETTERAMPM:
@ -444,19 +447,6 @@ DATETIME_ReturnTxt (const DATETIME_INFO *infoPtr, int count, LPWSTR result, int
TRACE ("arg%d=%x->[%s]\n", count, infoPtr->fieldspec[count], debugstr_w(result));
}
/* Offsets of days in the week to the weekday of january 1 in a leap year. */
static const int DayOfWeekTable[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4};
/* returns the day in the week(0 == sunday, 6 == saturday) */
/* day(1 == 1st, 2 == 2nd... etc), year is the year value */
static int DATETIME_CalculateDayOfWeek(DWORD day, DWORD month, DWORD year)
{
year-=(month < 3);
return((year + year/4 - year/100 + year/400 +
DayOfWeekTable[month-1] + day ) % 7);
}
static int wrap(int val, int delta, int minVal, int maxVal)
{
val += delta;
@ -480,14 +470,14 @@ DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number, int delta)
case TWODIGITYEAR:
case FULLYEAR:
date->wYear = wrap(date->wYear, delta, 1752, 9999);
date->wDayOfWeek = DATETIME_CalculateDayOfWeek(date->wDay,date->wMonth,date->wYear);
MONTHCAL_CalculateDayOfWeek(date, TRUE);
break;
case ONEDIGITMONTH:
case TWODIGITMONTH:
case THREECHARMONTH:
case FULLMONTH:
date->wMonth = wrap(date->wMonth, delta, 1, 12);
date->wDayOfWeek = DATETIME_CalculateDayOfWeek(date->wDay,date->wMonth,date->wYear);
MONTHCAL_CalculateDayOfWeek(date, TRUE);
delta = 0;
/* fall through */
case ONEDIGITDAY:
@ -495,7 +485,7 @@ DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number, int delta)
case THREECHARDAY:
case FULLDAY:
date->wDay = wrap(date->wDay, delta, 1, MONTHCAL_MonthLength(date->wMonth, date->wYear));
date->wDayOfWeek = DATETIME_CalculateDayOfWeek(date->wDay,date->wMonth,date->wYear);
MONTHCAL_CalculateDayOfWeek(date, TRUE);
break;
case ONELETTERAMPM:
case TWOLETTERAMPM:
@ -537,7 +527,7 @@ DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number, int delta)
static void
DATETIME_ReturnFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int count, SHORT *fieldWidthPtr)
DATETIME_ReturnFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int count, SHORT *width)
{
/* fields are a fixed width, determined by the largest possible string */
/* presumably, these widths should be language dependent */
@ -546,10 +536,6 @@ DATETIME_ReturnFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int count, SHO
static const WCHAR fld_d4W[] = { '2', '2', '2', '2', 0 };
static const WCHAR fld_am1[] = { 'A', 0 };
static const WCHAR fld_am2[] = { 'A', 'M', 0 };
static const WCHAR fld_day[] = { 'W', 'e', 'd', 'n', 'e', 's', 'd', 'a', 'y', 0 };
static const WCHAR fld_day3[] = { 'W', 'e', 'd', 0 };
static const WCHAR fld_mon[] = { 'S', 'e', 'p', 't', 'e', 'm', 'b', 'e', 'r', 0 };
static const WCHAR fld_mon3[] = { 'D', 'e', 'c', 0 };
int spec;
WCHAR buffer[80];
LPCWSTR bufptr;
@ -596,18 +582,64 @@ DATETIME_ReturnFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int count, SHO
case FULLYEAR:
bufptr = fld_d4W;
break;
case THREECHARDAY:
bufptr = fld_day3;
break;
case FULLDAY:
bufptr = fld_day;
break;
case THREECHARMONTH:
bufptr = fld_mon3;
break;
case FULLMONTH:
bufptr = fld_mon;
break;
case THREECHARDAY:
case FULLDAY:
{
static const WCHAR fld_day[] = {'W','e','d','n','e','s','d','a','y',0};
static const WCHAR fld_abbrday[] = {'W','e','d',0};
static const WCHAR fld_mon[] = {'S','e','p','t','e','m','b','e','r',0};
static const WCHAR fld_abbrmon[] = {'D','e','c',0};
const WCHAR *fall;
LCTYPE lctype;
INT i, max_count;
LONG cx;
/* choose locale data type and fallback string */
switch (spec) {
case THREECHARDAY:
fall = fld_abbrday;
lctype = LOCALE_SABBREVDAYNAME1;
max_count = 7;
break;
case FULLDAY:
fall = fld_day;
lctype = LOCALE_SDAYNAME1;
max_count = 7;
break;
case THREECHARMONTH:
fall = fld_abbrmon;
lctype = LOCALE_SABBREVMONTHNAME1;
max_count = 12;
break;
default: /* FULLMONTH */
fall = fld_mon;
lctype = LOCALE_SMONTHNAME1;
max_count = 12;
break;
}
cx = 0;
for (i = 0; i < max_count; i++)
{
if(GetLocaleInfoW(LOCALE_USER_DEFAULT, lctype + i,
buffer, lstrlenW(buffer)))
{
GetTextExtentPoint32W(hdc, buffer, lstrlenW(buffer), &size);
if (size.cx > cx) cx = size.cx;
}
else /* locale independent fallback on failure */
{
GetTextExtentPoint32W(hdc, fall, lstrlenW(fall), &size);
cx = size.cx;
break;
}
}
*width = cx;
return;
}
case ONELETTERAMPM:
bufptr = fld_am1;
break;
@ -620,25 +652,21 @@ DATETIME_ReturnFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int count, SHO
}
}
GetTextExtentPoint32W (hdc, bufptr, strlenW(bufptr), &size);
*fieldWidthPtr = size.cx;
*width = size.cx;
}
static void
DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc)
{
int i,prevright;
RECT *field;
RECT *rcDraw = &infoPtr->rcDraw;
RECT *calbutton = &infoPtr->calbutton;
RECT *checkbox = &infoPtr->checkbox;
SIZE size;
COLORREF oldTextColor;
SHORT fieldWidth = 0;
/* draw control edge */
TRACE("\n");
if (infoPtr->dateValid) {
int i, prevright;
RECT *field;
RECT *rcDraw = &infoPtr->rcDraw;
SIZE size;
COLORREF oldTextColor;
SHORT fieldWidth = 0;
HFONT oldFont = SelectObject (hdc, infoPtr->hFont);
INT oldBkMode = SetBkMode (hdc, TRANSPARENT);
WCHAR txt[80];
@ -647,25 +675,36 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc)
GetTextExtentPoint32W (hdc, txt, strlenW(txt), &size);
rcDraw->bottom = size.cy + 2;
prevright = checkbox->right = ((infoPtr->dwStyle & DTS_SHOWNONE) ? 18 : 2);
prevright = infoPtr->checkbox.right = ((infoPtr->dwStyle & DTS_SHOWNONE) ? 18 : 2);
for (i = 0; i < infoPtr->nrFields; i++) {
DATETIME_ReturnTxt (infoPtr, i, txt, sizeof(txt)/sizeof(txt[0]));
GetTextExtentPoint32W (hdc, txt, strlenW(txt), &size);
DATETIME_ReturnFieldWidth (infoPtr, hdc, i, &fieldWidth);
field = &infoPtr->fieldRect[i];
field->left = prevright;
field->right = prevright + fieldWidth;
field->top = rcDraw->top;
field->left = prevright;
field->right = prevright + fieldWidth;
field->top = rcDraw->top;
field->bottom = rcDraw->bottom;
prevright = field->right;
if (infoPtr->dwStyle & WS_DISABLED)
oldTextColor = SetTextColor (hdc, comctl32_color.clrGrayText);
else if ((infoPtr->haveFocus) && (i == infoPtr->select)) {
/* fill if focussed */
RECT selection;
/* fill if focused */
HBRUSH hbr = CreateSolidBrush (comctl32_color.clrActiveCaption);
FillRect(hdc, field, hbr);
selection.left = 0;
selection.top = 0;
selection.right = size.cx;
selection.bottom = size.cy;
/* center rectangle */
OffsetRect(&selection, (field->right + field->left - size.cx)/2,
(field->bottom - size.cy)/2);
FillRect(hdc, &selection, hbr);
DeleteObject (hbr);
oldTextColor = SetTextColor (hdc, comctl32_color.clrWindow);
}
@ -673,7 +712,7 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc)
oldTextColor = SetTextColor (hdc, comctl32_color.clrWindowText);
/* draw the date text using the colour set above */
DrawTextW (hdc, txt, strlenW(txt), field, DT_RIGHT | DT_VCENTER | DT_SINGLELINE);
DrawTextW (hdc, txt, strlenW(txt), field, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
SetTextColor (hdc, oldTextColor);
}
SetBkMode (hdc, oldBkMode);
@ -681,7 +720,7 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc)
}
if (!(infoPtr->dwStyle & DTS_UPDOWN)) {
DrawFrameControl(hdc, calbutton, DFC_SCROLL,
DrawFrameControl(hdc, &infoPtr->calbutton, DFC_SCROLL,
DFCS_SCROLLDOWN | (infoPtr->bCalDepressed ? DFCS_PUSHED : 0) |
(infoPtr->dwStyle & WS_DISABLED ? DFCS_INACTIVE : 0) );
}
@ -698,30 +737,54 @@ DATETIME_HitTest (const DATETIME_INFO *infoPtr, POINT pt)
if (PtInRect (&infoPtr->calbutton, pt)) return DTHT_MCPOPUP;
if (PtInRect (&infoPtr->checkbox, pt)) return DTHT_CHECKBOX;
for (i=0; i < infoPtr->nrFields; i++) {
for (i = 0; i < infoPtr->nrFields; i++) {
if (PtInRect (&infoPtr->fieldRect[i], pt)) return i;
}
return DTHT_NONE;
}
/* Returns index of a closest date field from given counting to left
or -1 if there's no such fields at left */
static int DATETIME_GetPrevDateField(const DATETIME_INFO *infoPtr, int i)
{
for(--i; i >= 0; i--)
{
if (infoPtr->fieldspec[i] & DTHT_DATEFIELD) return i;
}
return -1;
}
static LRESULT
DATETIME_LButtonDown (DATETIME_INFO *infoPtr, INT x, INT y)
{
POINT pt;
int old, new;
int new;
pt.x = x;
pt.y = y;
old = infoPtr->select;
new = DATETIME_HitTest (infoPtr, pt);
/* FIXME: might be conditions where we don't want to update infoPtr->select */
infoPtr->select = new;
SetFocus(infoPtr->hwndSelf);
if (!(new & DTHT_NODATEMASK) || (new == DTHT_NONE))
{
if (new == DTHT_NONE)
new = infoPtr->nrFields - 1;
else
{
/* hitting string part moves selection to next date field to left */
if (infoPtr->fieldspec[new] & DT_STRING)
{
new = DATETIME_GetPrevDateField(infoPtr, new);
if (new == -1) return 0;
}
/* never select full day of week */
if (infoPtr->fieldspec[new] == FULLDAY) return 0;
}
}
infoPtr->select = new;
if (infoPtr->select == DTHT_MCPOPUP) {
RECT rcMonthCal;
SendMessageW(infoPtr->hMonthCal, MCM_GETMINREQRECT, 0, (LPARAM)&rcMonthCal);
@ -746,20 +809,23 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, INT x, INT y)
if(IsWindowVisible(infoPtr->hMonthCal)) {
ShowWindow(infoPtr->hMonthCal, SW_HIDE);
infoPtr->bDropdownEnabled = FALSE;
DATETIME_SendSimpleNotify (infoPtr, DTN_CLOSEUP);
} else {
const SYSTEMTIME *lprgSysTimeArray = &infoPtr->date;
TRACE("update calendar %04d/%02d/%02d\n",
lprgSysTimeArray->wYear, lprgSysTimeArray->wMonth, lprgSysTimeArray->wDay);
SendMessageW(infoPtr->hMonthCal, MCM_SETCURSEL, 0, (LPARAM)(&infoPtr->date));
if (infoPtr->bDropdownEnabled)
if (infoPtr->bDropdownEnabled) {
ShowWindow(infoPtr->hMonthCal, SW_SHOW);
DATETIME_SendSimpleNotify (infoPtr, DTN_DROPDOWN);
}
infoPtr->bDropdownEnabled = TRUE;
}
TRACE ("dt:%p mc:%p mc parent:%p, desktop:%p\n",
infoPtr->hwndSelf, infoPtr->hMonthCal, infoPtr->hwndNotify, GetDesktopWindow ());
DATETIME_SendSimpleNotify (infoPtr, DTN_DROPDOWN);
}
InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
@ -865,7 +931,7 @@ DATETIME_EraseBackground (const DATETIME_INFO *infoPtr, HDC hdc)
static LRESULT
DATETIME_Notify (DATETIME_INFO *infoPtr, LPNMHDR lpnmh)
DATETIME_Notify (DATETIME_INFO *infoPtr, const NMHDR *lpnmh)
{
TRACE ("Got notification %x from %p\n", lpnmh->code, lpnmh->hwndFrom);
TRACE ("info: %p %p %p\n", infoPtr->hwndSelf, infoPtr->hMonthCal, infoPtr->hUpdown);
@ -879,9 +945,10 @@ DATETIME_Notify (DATETIME_INFO *infoPtr, LPNMHDR lpnmh)
SendMessageW (infoPtr->hwndCheckbut, BM_SETCHECK, BST_CHECKED, 0);
InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
DATETIME_SendDateTimeChangeNotify (infoPtr);
DATETIME_SendSimpleNotify(infoPtr, DTN_CLOSEUP);
}
if ((lpnmh->hwndFrom == infoPtr->hUpdown) && (lpnmh->code == UDN_DELTAPOS)) {
LPNMUPDOWN lpnmud = (LPNMUPDOWN)lpnmh;
const NM_UPDOWN *lpnmud = (const NM_UPDOWN*)lpnmh;
TRACE("Delta pos %d\n", lpnmud->iDelta);
infoPtr->pendingUpdown = lpnmud->iDelta;
}
@ -964,15 +1031,14 @@ DATETIME_Char (DATETIME_INFO *infoPtr, WPARAM vkCode)
case TWODIGITYEAR:
date->wYear = date->wYear - (date->wYear%100) +
(date->wYear%10)*10 + num;
date->wDayOfWeek = DATETIME_CalculateDayOfWeek(
date->wDay,date->wMonth,date->wYear);
MONTHCAL_CalculateDayOfWeek(date, TRUE);
DATETIME_SendDateTimeChangeNotify (infoPtr);
break;
case INVALIDFULLYEAR:
case FULLYEAR:
date->wYear = (date->wYear%1000)*10 + num;
date->wDayOfWeek = DATETIME_CalculateDayOfWeek(
date->wDay,date->wMonth,date->wYear);
/* reset current year initialy */
date->wYear = ((date->wYear/1000) ? 0 : 1)*(date->wYear%1000)*10 + num;
MONTHCAL_CalculateDayOfWeek(date, TRUE);
DATETIME_SendDateTimeChangeNotify (infoPtr);
break;
case ONEDIGITMONTH:
@ -981,8 +1047,7 @@ DATETIME_Char (DATETIME_INFO *infoPtr, WPARAM vkCode)
date->wMonth = num;
else
date->wMonth = (date->wMonth%10)*10+num;
date->wDayOfWeek = DATETIME_CalculateDayOfWeek(
date->wDay,date->wMonth,date->wYear);
MONTHCAL_CalculateDayOfWeek(date, TRUE);
DATETIME_SendDateTimeChangeNotify (infoPtr);
break;
case ONEDIGITDAY:
@ -992,8 +1057,7 @@ DATETIME_Char (DATETIME_INFO *infoPtr, WPARAM vkCode)
date->wDay = num;
else
date->wDay = newDays;
date->wDayOfWeek = DATETIME_CalculateDayOfWeek(
date->wDay,date->wMonth,date->wYear);
MONTHCAL_CalculateDayOfWeek(date, TRUE);
DATETIME_SendDateTimeChangeNotify (infoPtr);
break;
case ONEDIGIT12HOUR:
@ -1126,9 +1190,9 @@ DATETIME_SendDateTimeChangeNotify (const DATETIME_INFO *infoPtr)
dtdtc.nmhdr.idFrom = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID);
dtdtc.nmhdr.code = DTN_DATETIMECHANGE;
dtdtc.dwFlags = (infoPtr->dwStyle & DTS_SHOWNONE) ? GDT_NONE : GDT_VALID;
dtdtc.dwFlags = infoPtr->dateValid ? GDT_VALID : GDT_NONE;
MONTHCAL_CopyTime (&infoPtr->date, &dtdtc.st);
dtdtc.st = infoPtr->date;
return (BOOL) SendMessageW (infoPtr->hwndNotify, WM_NOTIFY,
dtdtc.nmhdr.idFrom, (LPARAM)&dtdtc);
}
@ -1186,12 +1250,27 @@ DATETIME_Size (DATETIME_INFO *infoPtr, INT width, INT height)
return 0;
}
static LRESULT
DATETIME_StyleChanging(DATETIME_INFO *infoPtr, WPARAM wStyleType, STYLESTRUCT *lpss)
{
TRACE("(styletype=%lx, styleOld=0x%08x, styleNew=0x%08x)\n",
wStyleType, lpss->styleOld, lpss->styleNew);
/* block DTS_SHOWNONE change */
if ((lpss->styleNew ^ lpss->styleOld) & DTS_SHOWNONE)
{
if (lpss->styleOld & DTS_SHOWNONE)
lpss->styleNew |= DTS_SHOWNONE;
else
lpss->styleNew &= ~DTS_SHOWNONE;
}
return 0;
}
static LRESULT
DATETIME_StyleChanged(DATETIME_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss)
{
static const WCHAR buttonW[] = { 'b', 'u', 't', 't', 'o', 'n', 0 };
TRACE("(styletype=%lx, styleOld=0x%08x, styleNew=0x%08x)\n",
wStyleType, lpss->styleOld, lpss->styleNew);
@ -1200,7 +1279,7 @@ DATETIME_StyleChanged(DATETIME_INFO *infoPtr, WPARAM wStyleType, const STYLESTRU
infoPtr->dwStyle = lpss->styleNew;
if ( !(lpss->styleOld & DTS_SHOWNONE) && (lpss->styleNew & DTS_SHOWNONE) ) {
infoPtr->hwndCheckbut = CreateWindowExW (0, buttonW, 0, WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
infoPtr->hwndCheckbut = CreateWindowExW (0, WC_BUTTONW, 0, WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
2, 2, 13, 13, infoPtr->hwndSelf, 0,
(HINSTANCE)GetWindowLongPtrW (infoPtr->hwndSelf, GWLP_HINSTANCE), 0);
SendMessageW (infoPtr->hwndCheckbut, BM_SETCHECK, 1, 0);
@ -1235,7 +1314,6 @@ DATETIME_SetFont (DATETIME_INFO *infoPtr, HFONT font, BOOL repaint)
static LRESULT
DATETIME_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
{
static const WCHAR SysMonthCal32W[] = { 'S', 'y', 's', 'M', 'o', 'n', 't', 'h', 'C', 'a', 'l', '3', '2', 0 };
DATETIME_INFO *infoPtr = Alloc (sizeof(DATETIME_INFO));
STYLESTRUCT ss = { 0, lpcs->style };
@ -1256,7 +1334,7 @@ DATETIME_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
DATETIME_SetFormatW (infoPtr, 0);
/* create the monthcal control */
infoPtr->hMonthCal = CreateWindowExW (0, SysMonthCal32W, 0, WS_BORDER | WS_POPUP | WS_CLIPSIBLINGS,
infoPtr->hMonthCal = CreateWindowExW (0, MONTHCAL_CLASSW, 0, WS_BORDER | WS_POPUP | WS_CLIPSIBLINGS,
0, 0, 0, 0, infoPtr->hwndSelf, 0, 0, 0);
/* initialize info structure */
@ -1281,11 +1359,34 @@ DATETIME_Destroy (DATETIME_INFO *infoPtr)
if (infoPtr->hMonthCal)
DestroyWindow(infoPtr->hMonthCal);
SetWindowLongPtrW( infoPtr->hwndSelf, 0, 0 ); /* clear infoPtr */
Free (infoPtr->buflen);
Free (infoPtr->fieldRect);
Free (infoPtr->fieldspec);
Free (infoPtr);
return 0;
}
static INT
DATETIME_GetText (DATETIME_INFO *infoPtr, INT count, LPWSTR dst)
{
WCHAR buf[80];
int i;
if (!dst || (count <= 0)) return 0;
dst[0] = 0;
for (i = 0; i < infoPtr->nrFields; i++)
{
DATETIME_ReturnTxt(infoPtr, i, buf, sizeof(buf)/sizeof(buf[0]));
if ((strlenW(dst) + strlenW(buf)) < count)
strcatW(dst, buf);
else break;
}
return strlenW(dst);
}
static LRESULT WINAPI
DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
@ -1385,6 +1486,9 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_COMMAND:
return DATETIME_Command (infoPtr, wParam, lParam);
case WM_STYLECHANGING:
return DATETIME_StyleChanging(infoPtr, wParam, (LPSTYLESTRUCT)lParam);
case WM_STYLECHANGED:
return DATETIME_StyleChanged(infoPtr, wParam, (LPSTYLESTRUCT)lParam);
@ -1394,6 +1498,12 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_GETFONT:
return (LRESULT) infoPtr->hFont;
case WM_GETTEXT:
return (LRESULT) DATETIME_GetText(infoPtr, wParam, (LPWSTR)lParam);
case WM_SETTEXT:
return CB_ERR;
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR("unknown msg %04x wp=%08lx lp=%08lx\n",

View file

@ -426,12 +426,27 @@ BOOL WINAPI DPA_Destroy (const HDPA hdpa)
*/
BOOL WINAPI DPA_Grow (HDPA hdpa, INT nGrow)
{
INT items;
TRACE("(%p %d)\n", hdpa, nGrow);
if (!hdpa)
return FALSE;
hdpa->nGrow = max(8, nGrow);
nGrow = max( 8, nGrow );
items = nGrow * (((hdpa->nMaxCount - 1) / nGrow) + 1);
if (items > hdpa->nMaxCount)
{
void *ptr;
if (hdpa->ptrs)
ptr = HeapReAlloc( hdpa->hHeap, HEAP_ZERO_MEMORY, hdpa->ptrs, items * sizeof(LPVOID) );
else
ptr = HeapAlloc( hdpa->hHeap, HEAP_ZERO_MEMORY, items * sizeof(LPVOID) );
if (!ptr) return FALSE;
hdpa->nMaxCount = items;
hdpa->ptrs = ptr;
}
hdpa->nGrow = nGrow;
return TRUE;
}

View file

@ -334,7 +334,7 @@ INT WINAPI LBItemFromPt (HWND hwndLB, POINT pt, BOOL bAutoScroll)
dwLastScrollTime = dwScrollTime;
SendMessageW (hwndLB, LB_SETTOPINDEX, (WPARAM)nIndex, 0);
SendMessageW (hwndLB, LB_SETTOPINDEX, nIndex, 0);
}
return -1;

View file

@ -374,8 +374,7 @@ HEADER_DrawItem (HEADER_INFO *infoPtr, HDC hdc, INT iItem, BOOL bHotTrack, LRESU
dis.rcItem = phdi->rect;
dis.itemData = phdi->lParam;
oldBkMode = SetBkMode(hdc, TRANSPARENT);
SendMessageW (infoPtr->hwndNotify, WM_DRAWITEM,
(WPARAM)dis.CtlID, (LPARAM)&dis);
SendMessageW (infoPtr->hwndNotify, WM_DRAWITEM, dis.CtlID, (LPARAM)&dis);
if (oldBkMode != TRANSPARENT)
SetBkMode(hdc, oldBkMode);
}
@ -1214,20 +1213,64 @@ HEADER_GetOrderArray(const HEADER_INFO *infoPtr, INT size, LPINT order)
return TRUE;
}
/* Returns index of first duplicate 'value' from [0,to) range,
or -1 if there isn't any */
static INT has_duplicate(INT *array, INT to, INT value)
{
INT i;
for(i = 0; i < to; i++)
if (array[i] == value) return i;
return -1;
}
/* returns next available value from [0,max] not to duplicate in [0,to) */
static INT get_nextvalue(INT *array, INT to, INT max)
{
INT i;
for(i = 0; i < max; i++)
if (has_duplicate(array, to, i) == -1) return i;
return 0;
}
static LRESULT
HEADER_SetOrderArray(HEADER_INFO *infoPtr, INT size, const INT *order)
{
INT i;
HEADER_ITEM *lpItem;
INT i;
if ((UINT)size <infoPtr->uNumItem)
if ((UINT)size != infoPtr->uNumItem)
return FALSE;
memcpy(infoPtr->order, order, infoPtr->uNumItem * sizeof(INT));
for (i=0; i<size; i++)
{
lpItem = &infoPtr->items[*order++];
lpItem->iOrder=i;
}
{
if (order[i] >= size || order[i] < 0)
/* on invalid index get next available */
/* FIXME: if i==0 array item is out of range behaviour is
different, see tests */
infoPtr->order[i] = get_nextvalue(infoPtr->order, i, size);
else
{
INT j, dup;
infoPtr->order[i] = order[i];
j = i;
/* remove duplicates */
while ((dup = has_duplicate(infoPtr->order, j, order[j])) != -1)
{
INT next;
next = get_nextvalue(infoPtr->order, j, size);
infoPtr->order[dup] = next;
j--;
}
}
}
/* sync with item data */
for (i=0; i<size; i++)
{
lpItem = &infoPtr->items[infoPtr->order[i]];
lpItem->iOrder = i;
}
HEADER_SetItemBounds(infoPtr);
InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
return TRUE;
@ -1704,7 +1747,7 @@ HEADER_NotifyFormat (HEADER_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
case NF_REQUERY:
infoPtr->nNotifyFormat =
SendMessageW ((HWND)wParam, WM_NOTIFYFORMAT,
(WPARAM)infoPtr->hwndSelf, (LPARAM)NF_QUERY);
(WPARAM)infoPtr->hwndSelf, NF_QUERY);
return infoPtr->nNotifyFormat;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because it is too large Load diff

View file

@ -27,32 +27,35 @@
#include "winbase.h"
#include "wingdi.h"
/* the ones with offsets at the end are the same as in Windows */
struct _IMAGELIST
{
DWORD magic; /* 00: 'SAMX' */
INT cCurImage; /* 04: ImageCount */
INT cMaxImage; /* 08: maximages */
INT cGrow; /* 0c: cGrow */
INT cx; /* 10: cx */
INT cy; /* 14: cy */
const struct IImageListVtbl *lpVtbl; /* 00: IImageList vtable */
INT cCurImage; /* 04: ImageCount */
INT cMaxImage; /* 08: maximages */
INT cGrow; /* 0C: cGrow */
INT cx; /* 10: cx */
INT cy; /* 14: cy */
DWORD x4;
UINT flags; /* 1c: flags */
COLORREF clrFg; /* 20: foreground color */
COLORREF clrBk; /* 24: background color */
UINT flags; /* 1C: flags */
COLORREF clrFg; /* 20: foreground color */
COLORREF clrBk; /* 24: background color */
HBITMAP hbmImage; /* 30: images Bitmap */
HBITMAP hbmMask; /* 34: masks Bitmap */
HDC hdcImage; /* 38: images MemDC */
HDC hdcMask; /* 3C: masks MemDC */
INT nOvlIdx[15]; /* 40: overlay images index */
HBITMAP hbmImage; /* 28: images Bitmap */
HBITMAP hbmMask; /* 2C: masks Bitmap */
HDC hdcImage; /* 30: images MemDC */
HDC hdcMask; /* 34: masks MemDC */
INT nOvlIdx[15]; /* 38: overlay images index */
/* not yet found out */
HBRUSH hbrBlend25;
HBRUSH hbrBlend50;
INT cInitial;
UINT uBitsPixel;
char *has_alpha;
LONG ref; /* reference count */
};
#define IMAGELIST_MAGIC 0x53414D58

View file

@ -189,7 +189,6 @@ static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc)
static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate)
{
static const WCHAR EDIT[] = { 'E', 'd', 'i', 't', 0 };
IPADDRESS_INFO *infoPtr;
RECT rcClient, edit;
int i, fieldsize;
@ -230,7 +229,7 @@ static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate)
edit.left = rcClient.left + i*fieldsize + 6;
edit.right = rcClient.left + (i+1)*fieldsize - 2;
part->EditHwnd =
CreateWindowW (EDIT, NULL, WS_CHILD | WS_VISIBLE | ES_CENTER,
CreateWindowW (WC_EDITW, NULL, WS_CHILD | WS_VISIBLE | ES_CENTER,
edit.left, edit.top, edit.right - edit.left,
edit.bottom - edit.top, hwnd, (HMENU) 1,
(HINSTANCE)GetWindowLongPtrW(hwnd, GWLP_HINSTANCE), NULL);

View file

@ -168,6 +168,9 @@
WINE_DEFAULT_DEBUG_CHANNEL(listview);
/* make sure you set this to 0 for production use! */
#define DEBUG_RANGES 1
typedef struct tagCOLUMN_INFO
{
RECT rcHeader; /* tracks the header's rectangle */
@ -2965,7 +2968,11 @@ static INT CALLBACK ranges_cmp(LPVOID range1, LPVOID range2, LPARAM flags)
return cmp;
}
#define ranges_check(ranges, desc) if (TRACE_ON(listview)) ranges_assert(ranges, desc, __FUNCTION__, __LINE__)
#if DEBUG_RANGES
#define ranges_check(ranges, desc) ranges_assert(ranges, desc, __FUNCTION__, __LINE__)
#else
#define ranges_check(ranges, desc) do { } while(0)
#endif
static void ranges_assert(RANGES ranges, LPCSTR desc, const char *func, int line)
{
@ -6946,7 +6953,7 @@ static BOOL LISTVIEW_GetItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPRECT
*/
static BOOL LISTVIEW_GetSubItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPRECT lprc)
{
POINT Position, Origin;
POINT Position;
LVITEMW lvItem;
INT nColumn;
@ -6954,7 +6961,7 @@ static BOOL LISTVIEW_GetSubItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPR
nColumn = lprc->top;
TRACE("(nItem=%d, nSubItem=%d, type=%d)\n", nItem, lprc->top, lprc->left);
TRACE("(nItem=%d, nSubItem=%d)\n", nItem, lprc->top);
/* On WinNT, a subitem of '0' calls LISTVIEW_GetItemRect */
if (lprc->top == 0)
return LISTVIEW_GetItemRect(infoPtr, nItem, lprc);
@ -6979,8 +6986,7 @@ static BOOL LISTVIEW_GetSubItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPR
}
}
if (!LISTVIEW_GetItemPosition(infoPtr, nItem, &Position)) return FALSE;
LISTVIEW_GetOrigin(infoPtr, &Origin);
LISTVIEW_GetOrigin(infoPtr, &Position);
if (nColumn < 0 || nColumn >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return FALSE;
@ -6988,6 +6994,7 @@ static BOOL LISTVIEW_GetSubItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPR
lvItem.iItem = nItem;
lvItem.iSubItem = nColumn;
if (lvItem.mask && !LISTVIEW_GetItemW(infoPtr, &lvItem)) return FALSE;
switch(lprc->left)
{
case LVIR_ICON:
@ -7004,9 +7011,7 @@ static BOOL LISTVIEW_GetSubItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPR
return FALSE;
}
OffsetRect(lprc, Origin.x, Position.y);
TRACE("return rect %s\n", wine_dbgstr_rect(lprc));
OffsetRect(lprc, Position.x, Position.y);
return TRUE;
}

File diff suppressed because it is too large Load diff