From 353147d2cc22342ee6c1d534e70a77a94be4e16e Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Thu, 24 Feb 2011 01:27:57 +0000 Subject: [PATCH] [COMCTL32] - Sync with wine 1.3.14 svn path=/trunk/; revision=50887 --- reactos/dll/win32/comctl32/comboex.c | 23 +- reactos/dll/win32/comctl32/comctl32.h | 7 +- reactos/dll/win32/comctl32/comctl32.spec | 57 +-- reactos/dll/win32/comctl32/comctl_Bg.rc | 21 - reactos/dll/win32/comctl32/comctl_Cs.rc | 21 - reactos/dll/win32/comctl32/comctl_Da.rc | 21 - reactos/dll/win32/comctl32/comctl_De.rc | 21 - reactos/dll/win32/comctl32/comctl_El.rc | 21 - reactos/dll/win32/comctl32/comctl_En.rc | 21 - reactos/dll/win32/comctl32/comctl_Eo.rc | 68 +++ reactos/dll/win32/comctl32/comctl_Es.rc | 21 - reactos/dll/win32/comctl32/comctl_Fr.rc | 21 - reactos/dll/win32/comctl32/comctl_He.rc | 74 ++++ reactos/dll/win32/comctl32/comctl_Hu.rc | 21 - reactos/dll/win32/comctl32/comctl_It.rc | 34 +- reactos/dll/win32/comctl32/comctl_Ja.rc | 21 - reactos/dll/win32/comctl32/comctl_Ko.rc | 69 ++- reactos/dll/win32/comctl32/comctl_Lt.rc | 21 - reactos/dll/win32/comctl32/comctl_Nl.rc | 21 - reactos/dll/win32/comctl32/comctl_No.rc | 27 +- reactos/dll/win32/comctl32/comctl_Pl.rc | 25 +- reactos/dll/win32/comctl32/comctl_Pt.rc | 21 - reactos/dll/win32/comctl32/comctl_Ro.rc | 21 - reactos/dll/win32/comctl32/comctl_Ru.rc | 21 - reactos/dll/win32/comctl32/comctl_Si.rc | 21 - reactos/dll/win32/comctl32/comctl_Sk.rc | 21 - reactos/dll/win32/comctl32/comctl_Sr.rc | 95 ++--- reactos/dll/win32/comctl32/comctl_Sv.rc | 21 - reactos/dll/win32/comctl32/comctl_Th.rc | 21 - reactos/dll/win32/comctl32/comctl_Tr.rc | 21 - reactos/dll/win32/comctl32/comctl_Uk.rc | 21 - reactos/dll/win32/comctl32/comctl_Zh.rc | 42 -- reactos/dll/win32/comctl32/commctrl.c | 14 + reactos/dll/win32/comctl32/datetime.c | 18 +- reactos/dll/win32/comctl32/header.c | 4 +- reactos/dll/win32/comctl32/imagelist.c | 87 ++-- reactos/dll/win32/comctl32/ipaddress.c | 11 +- reactos/dll/win32/comctl32/listview.c | 333 ++++++++------- reactos/dll/win32/comctl32/monthcal.c | 514 ++++++++++++----------- reactos/dll/win32/comctl32/pager.c | 6 +- reactos/dll/win32/comctl32/progress.c | 19 +- reactos/dll/win32/comctl32/propsheet.c | 84 ++-- reactos/dll/win32/comctl32/rebar.c | 217 ++++++++-- reactos/dll/win32/comctl32/rsrc.rc | 16 +- reactos/dll/win32/comctl32/status.c | 5 +- reactos/dll/win32/comctl32/tab.c | 55 ++- reactos/dll/win32/comctl32/toolbar.c | 30 +- reactos/dll/win32/comctl32/tooltips.c | 55 ++- reactos/dll/win32/comctl32/treeview.c | 205 +++++---- reactos/media/doc/README.WINE | 2 +- 50 files changed, 1230 insertions(+), 1407 deletions(-) create mode 100644 reactos/dll/win32/comctl32/comctl_Eo.rc create mode 100644 reactos/dll/win32/comctl32/comctl_He.rc diff --git a/reactos/dll/win32/comctl32/comboex.c b/reactos/dll/win32/comctl32/comboex.c index 4b5e079ac99..10d8b8727b8 100644 --- a/reactos/dll/win32/comctl32/comboex.c +++ b/reactos/dll/win32/comctl32/comboex.c @@ -431,18 +431,13 @@ static void COMBOEX_ReSize (const COMBOEX_INFO *infoPtr) if (infoPtr->hwndCombo) { SendMessageW (infoPtr->hwndCombo, CB_SETITEMHEIGHT, 0, cy); if ( !(infoPtr->flags & CBES_EX_NOSIZELIMIT)) { - RECT comboRect; - if (GetWindowRect(infoPtr->hwndCombo, &comboRect)) { - RECT ourRect; - if (GetWindowRect(infoPtr->hwndSelf, &ourRect)) { - if (comboRect.bottom > ourRect.bottom) { - POINT pt = { ourRect.left, ourRect.top }; - if (ScreenToClient(infoPtr->hwndSelf, &pt)) - MoveWindow( infoPtr->hwndSelf, pt.x, pt.y, ourRect.right - ourRect.left, - comboRect.bottom - comboRect.top, FALSE); - } - } - } + RECT comboRect, ourRect; + GetWindowRect(infoPtr->hwndCombo, &comboRect); + GetWindowRect(infoPtr->hwndSelf, &ourRect); + if (comboRect.bottom > ourRect.bottom) + SetWindowPos( infoPtr->hwndSelf, 0, 0, 0, ourRect.right - ourRect.left, + comboRect.bottom - comboRect.top, + SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW ); } } } @@ -758,7 +753,7 @@ static HIMAGELIST COMBOEX_SetImageList (COMBOEX_INFO *infoPtr, HIMAGELIST himl) return himlTemp; } -static BOOL COMBOEX_SetItemW (const COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit) +static BOOL COMBOEX_SetItemW (const COMBOEX_INFO *infoPtr, const COMBOBOXEXITEMW *cit) { INT_PTR index = cit->iItem; CBE_ITEMDATA *item; @@ -1698,7 +1693,7 @@ static LRESULT COMBOEX_WindowPosChanging (const COMBOEX_INFO *infoPtr, WINDOWPOS height = (cb_wrect.bottom-cb_wrect.top) + (cbx_wrect.bottom-cbx_wrect.top) - (cbx_crect.bottom-cbx_crect.top); - if (wp->cy < height) wp->cy = height; + wp->cy = height; if (infoPtr->hwndEdit) { COMBOEX_AdjustEditPos (infoPtr); InvalidateRect (infoPtr->hwndCombo, 0, TRUE); diff --git a/reactos/dll/win32/comctl32/comctl32.h b/reactos/dll/win32/comctl32/comctl32.h index 3d172ae7605..401468883fd 100644 --- a/reactos/dll/win32/comctl32/comctl32.h +++ b/reactos/dll/win32/comctl32/comctl32.h @@ -101,16 +101,15 @@ extern HBRUSH COMCTL32_hPattern55AABrush; #define IDT_CHECK 401 -/* Header cursors */ +/* Cursors */ +#define IDC_MOVEBUTTON 102 +#define IDC_COPY 104 #define IDC_DIVIDER 106 #define IDC_DIVIDEROPEN 107 /* DragList resources */ #define IDI_DRAGARROW 501 -#define IDC_COPY 502 - -#define IDC_MOVEBUTTON 1 /* HOTKEY internal strings */ #define HKY_NONE 2048 diff --git a/reactos/dll/win32/comctl32/comctl32.spec b/reactos/dll/win32/comctl32/comctl32.spec index 60378c28513..1654d3ec903 100644 --- a/reactos/dll/win32/comctl32/comctl32.spec +++ b/reactos/dll/win32/comctl32/comctl32.spec @@ -38,27 +38,27 @@ 234 stdcall -noname Str_SetPtrA(str str) 235 stdcall -noname Str_GetPtrW(wstr wstr long) 236 stdcall -noname Str_SetPtrW(wstr wstr) -320 stdcall -noname DSA_Create(long long) -321 stdcall -noname DSA_Destroy(ptr) -322 stdcall -noname DSA_GetItem(ptr long long) -323 stdcall -noname DSA_GetItemPtr(ptr long) -324 stdcall -noname DSA_InsertItem(ptr long long) -325 stdcall -noname DSA_SetItem (ptr long long) -326 stdcall -noname DSA_DeleteItem(ptr long) -327 stdcall -noname DSA_DeleteAllItems(ptr) -328 stdcall -noname DPA_Create(long) -329 stdcall -noname DPA_Destroy(ptr) -330 stdcall -noname DPA_Grow(ptr long) -331 stdcall -noname DPA_Clone(ptr ptr) -332 stdcall -noname DPA_GetPtr(ptr long) -333 stdcall -noname DPA_GetPtrIndex(ptr ptr) -334 stdcall -noname DPA_InsertPtr(ptr long ptr) -335 stdcall -noname DPA_SetPtr(ptr long ptr) -336 stdcall -noname DPA_DeletePtr(ptr long) -337 stdcall -noname DPA_DeleteAllPtrs(ptr) -338 stdcall -noname DPA_Sort(ptr ptr long) -339 stdcall -noname DPA_Search(ptr ptr long ptr long long) -340 stdcall -noname DPA_CreateEx(long long) +320 stdcall -ordinal DSA_Create(long long) +321 stdcall -ordinal DSA_Destroy(ptr) +322 stdcall -ordinal DSA_GetItem(ptr long long) +323 stdcall -ordinal DSA_GetItemPtr(ptr long) +324 stdcall -ordinal DSA_InsertItem(ptr long long) +325 stdcall -ordinal DSA_SetItem (ptr long long) +326 stdcall -ordinal DSA_DeleteItem(ptr long) +327 stdcall -ordinal DSA_DeleteAllItems(ptr) +328 stdcall -ordinal DPA_Create(long) +329 stdcall -ordinal DPA_Destroy(ptr) +330 stdcall -ordinal DPA_Grow(ptr long) +331 stdcall -ordinal DPA_Clone(ptr ptr) +332 stdcall -ordinal DPA_GetPtr(ptr long) +333 stdcall -ordinal DPA_GetPtrIndex(ptr ptr) +334 stdcall -ordinal DPA_InsertPtr(ptr long ptr) +335 stdcall -ordinal DPA_SetPtr(ptr long ptr) +336 stdcall -ordinal DPA_DeletePtr(ptr long) +337 stdcall -ordinal DPA_DeleteAllPtrs(ptr) +338 stdcall -ordinal DPA_Sort(ptr ptr long) +339 stdcall -ordinal DPA_Search(ptr ptr long ptr long long) +340 stdcall -ordinal DPA_CreateEx(long long) 341 stdcall -noname SendNotify(long long long ptr) 342 stdcall -noname SendNotifyEx(long long long ptr long) 350 stdcall -noname StrChrA(str str) @@ -90,16 +90,16 @@ 382 stdcall -noname SmoothScrollWindow(ptr) 383 stdcall -noname DoReaderMode(ptr) 384 stdcall -noname SetPathWordBreakProc(ptr long) -385 stdcall -noname DPA_EnumCallback(long long long) -386 stdcall -noname DPA_DestroyCallback(ptr ptr long) -387 stdcall -noname DSA_EnumCallback(ptr ptr long) -388 stdcall -noname DSA_DestroyCallback(ptr ptr long) +385 stdcall -ordinal DPA_EnumCallback(long long long) +386 stdcall -ordinal DPA_DestroyCallback(ptr ptr long) +387 stdcall -ordinal DSA_EnumCallback(ptr ptr long) +388 stdcall -ordinal DSA_DestroyCallback(ptr ptr long) 389 stdcall -noname comctl32_389(long long) 390 stdcall -noname ImageList_SetColorTable(ptr long long ptr) -400 stdcall -noname CreateMRUListW(ptr) -401 stdcall -noname AddMRUStringW(long wstr) +400 stdcall -ordinal CreateMRUListW(ptr) +401 stdcall -ordinal AddMRUStringW(long wstr) 402 stdcall -noname FindMRUStringW(long wstr ptr) -403 stdcall -noname EnumMRUListW(long long ptr long) +403 stdcall -ordinal EnumMRUListW(long long ptr long) 404 stdcall -noname CreateMRUListLazyW(ptr long long long) 410 stdcall -ordinal SetWindowSubclass(long ptr long long) 411 stdcall -ordinal GetWindowSubclass(long ptr long ptr) @@ -188,5 +188,6 @@ @ stdcall PropertySheet(ptr) PropertySheetA @ stdcall PropertySheetA(ptr) @ stdcall PropertySheetW(ptr) +@ stdcall TaskDialogIndirect(ptr ptr ptr ptr) @ stdcall UninitializeFlatSB(long) @ stdcall _TrackMouseEvent(ptr) diff --git a/reactos/dll/win32/comctl32/comctl_Bg.rc b/reactos/dll/win32/comctl32/comctl_Bg.rc index a45bcd16f29..f44eda499fd 100644 --- a/reactos/dll/win32/comctl32/comctl_Bg.rc +++ b/reactos/dll/win32/comctl32/comctl_Bg.rc @@ -68,24 +68,3 @@ BEGIN LTEXT "& :", -1,192,5,78,10 /* 182 -> 192 ? */ LISTBOX IDC_TOOLBARBTN_LBOX, 192,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP /* 182 -> 192 ? */ END - -STRINGTABLE -{ - IDS_CLOSE "" -} - -STRINGTABLE -{ - IDM_TODAY ":" - IDM_GOTODAY " " -} - -STRINGTABLE -{ - IDS_SEPARATOR "" -} - -STRINGTABLE -{ - HKY_NONE "" -} diff --git a/reactos/dll/win32/comctl32/comctl_Cs.rc b/reactos/dll/win32/comctl32/comctl_Cs.rc index d993c713a29..e75138f33ce 100644 --- a/reactos/dll/win32/comctl32/comctl_Cs.rc +++ b/reactos/dll/win32/comctl32/comctl_Cs.rc @@ -72,24 +72,3 @@ BEGIN LTEXT "&Tlatka panelu:", -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 -{ - IDS_CLOSE "Zavt" -} - -STRINGTABLE -{ - IDM_TODAY "Dnes:" - IDM_GOTODAY "Jdi na dneek" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Oddlova" -} - -STRINGTABLE -{ - HKY_NONE "dn" -} diff --git a/reactos/dll/win32/comctl32/comctl_Da.rc b/reactos/dll/win32/comctl32/comctl_Da.rc index 0dc1068f83b..f49b522705f 100644 --- a/reactos/dll/win32/comctl32/comctl_Da.rc +++ b/reactos/dll/win32/comctl32/comctl_Da.rc @@ -69,24 +69,3 @@ BEGIN LTEXT "&Værktøjs knapper:", -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 -{ - IDS_CLOSE "Luk" -} - -STRINGTABLE -{ - IDM_TODAY "Idag:" - IDM_GOTODAY "Gå til i dag" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Separator" -} - -STRINGTABLE -{ - HKY_NONE "Ingen" -} diff --git a/reactos/dll/win32/comctl32/comctl_De.rc b/reactos/dll/win32/comctl32/comctl_De.rc index afb2a844c1e..455fd458a1d 100644 --- a/reactos/dll/win32/comctl32/comctl_De.rc +++ b/reactos/dll/win32/comctl32/comctl_De.rc @@ -22,27 +22,6 @@ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL -STRINGTABLE -{ - IDS_CLOSE "Schließen" -} - -STRINGTABLE -{ - IDM_TODAY "Heute:" - IDM_GOTODAY "Gehe zu Heute" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Trennzeichen" -} - -STRINGTABLE -{ - HKY_NONE "Keiner" -} - IDD_PROPSHEET DIALOG 0, 0, 220, 140 STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE CAPTION "Eigenschaften für %s" diff --git a/reactos/dll/win32/comctl32/comctl_El.rc b/reactos/dll/win32/comctl32/comctl_El.rc index 284b3a287c4..d0227dd9ca5 100644 --- a/reactos/dll/win32/comctl32/comctl_El.rc +++ b/reactos/dll/win32/comctl32/comctl_El.rc @@ -66,24 +66,3 @@ BEGIN 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 -{ - IDS_CLOSE "" -} - -STRINGTABLE -{ - IDM_TODAY ":" - IDM_GOTODAY " " -} - -STRINGTABLE -{ - IDS_SEPARATOR "" -} - -STRINGTABLE -{ - HKY_NONE "" -} diff --git a/reactos/dll/win32/comctl32/comctl_En.rc b/reactos/dll/win32/comctl32/comctl_En.rc index c7ddc7a15c8..c9bd6849f85 100644 --- a/reactos/dll/win32/comctl32/comctl_En.rc +++ b/reactos/dll/win32/comctl32/comctl_En.rc @@ -66,24 +66,3 @@ BEGIN LTEXT "&Toolbar buttons:", -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 -{ - IDS_CLOSE "Close" -} - -STRINGTABLE -{ - IDM_TODAY "Today:" - IDM_GOTODAY "Go to today" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Separator" -} - -STRINGTABLE -{ - HKY_NONE "None" -} diff --git a/reactos/dll/win32/comctl32/comctl_Eo.rc b/reactos/dll/win32/comctl32/comctl_Eo.rc new file mode 100644 index 00000000000..5d627aa2f3a --- /dev/null +++ b/reactos/dll/win32/comctl32/comctl_Eo.rc @@ -0,0 +1,68 @@ +/* Esperanto Language Support + * Copyright 2006 Antonio Codazzi + * + * 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" + +LANGUAGE LANG_ESPERANTO, SUBLANG_DEFAULT + +IDD_PROPSHEET DIALOG 0, 0, 220, 140 +STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE +CAPTION "Ecoj la %s" +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "Bone", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP + PUSHBUTTON "Rezigni", IDCANCEL,58,122,50,14 + PUSHBUTTON "&Apliku", IDC_APPLY_BUTTON,112,122,50,14,WS_DISABLED + PUSHBUTTON "Helpo", IDHELP,166,122,50,14,WS_TABSTOP|WS_GROUP + CONTROL "Langeto", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114 +END + + +IDD_WIZARD DIALOG 0, 0, 290, 159 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE +CAPTION "Estrita Proceduro" +FONT 8, "MS Shell Dlg" +BEGIN + PUSHBUTTON "< &Retro", IDC_BACK_BUTTON,71,138,50,14 + DEFPUSHBUTTON "&Antaen >", IDC_NEXT_BUTTON,121,138,50,14 + DEFPUSHBUTTON "Konkludi", IDC_FINISH_BUTTON,121,138,50,14 + PUSHBUTTON "Rezigni", IDCANCEL,178,138,50,14 + PUSHBUTTON "Helpo", IDHELP,235,138,50,14,WS_GROUP + LTEXT "", IDC_SUNKEN_LINE,7,129,278,1,SS_SUNKEN + CONTROL "Langeto", 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 + + +IDD_TBCUSTOMIZE DIALOG 10, 20, 357, 125 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Agordu stangon de la iloj" +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "&Fermu", IDCANCEL,308,6,44,14 + PUSHBUTTON "R&ee agordu", IDC_RESET_BTN,308,23,44,14 + PUSHBUTTON "&Helpo", IDC_HELP_BTN,308,40,44,14 + PUSHBUTTON "&Supre forovu", IDC_MOVEUP_BTN,308,74,44,14 + PUSHBUTTON "Su&be forovu", IDC_MOVEDN_BTN,308,91,44,14 + LTEXT "&Disponeblaj butonoj:", -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 "&Aldonu ->", IDOK, 131, 42, 44, 14 + PUSHBUTTON "<- &Forigu", IDC_REMOVE_BTN,131,62,44,14 + LTEXT "Butonoj por stango de la &iloj", -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 diff --git a/reactos/dll/win32/comctl32/comctl_Es.rc b/reactos/dll/win32/comctl32/comctl_Es.rc index 34e6f6c0a5d..e026f54cb03 100644 --- a/reactos/dll/win32/comctl32/comctl_Es.rc +++ b/reactos/dll/win32/comctl32/comctl_Es.rc @@ -66,24 +66,3 @@ BEGIN LTEXT "B&otones de la barra:", -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 -{ - IDS_CLOSE "Cerrar" -} - -STRINGTABLE -{ - IDM_TODAY "Hoy:" - IDM_GOTODAY "Ir a hoy" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Separador" -} - -STRINGTABLE -{ - HKY_NONE "Ninguno" -} diff --git a/reactos/dll/win32/comctl32/comctl_Fr.rc b/reactos/dll/win32/comctl32/comctl_Fr.rc index fd8aa10eb49..bab9a31b5a8 100644 --- a/reactos/dll/win32/comctl32/comctl_Fr.rc +++ b/reactos/dll/win32/comctl32/comctl_Fr.rc @@ -73,24 +73,3 @@ BEGIN 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 - -STRINGTABLE -{ - IDS_CLOSE "Fermer" -} - -STRINGTABLE -{ - IDM_TODAY "Aujourd'hui :" - IDM_GOTODAY "Aller à aujourd'hui" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Séparateur" -} - -STRINGTABLE -{ - HKY_NONE "Aucun" -} diff --git a/reactos/dll/win32/comctl32/comctl_He.rc b/reactos/dll/win32/comctl32/comctl_He.rc new file mode 100644 index 00000000000..cc052615732 --- /dev/null +++ b/reactos/dll/win32/comctl32/comctl_He.rc @@ -0,0 +1,74 @@ +/* + * Copyright 1999 Eric Kohl + * Copyright 2010 Yaron shahrabani + * + * 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" + +#pragma code_page(65001) + +LANGUAGE LANG_HEBREW, SUBLANG_DEFAULT + +IDD_PROPSHEET DIALOG 0, 0, 220, 140 +STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE +EXSTYLE WS_EX_LAYOUTRTL +CAPTION "המאפיינים של %s" +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "אישור", 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 + CONTROL "Tab", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114 +END + + +IDD_WIZARD DIALOG 0, 0, 290, 159 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE +EXSTYLE WS_EX_LAYOUTRTL +CAPTION "Wizard" +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 + 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 +END + + +IDD_TBCUSTOMIZE DIALOG 10, 20, 357, 125 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_LAYOUTRTL +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 + 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 + 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 diff --git a/reactos/dll/win32/comctl32/comctl_Hu.rc b/reactos/dll/win32/comctl32/comctl_Hu.rc index 87183c4038a..176e0d8731c 100644 --- a/reactos/dll/win32/comctl32/comctl_Hu.rc +++ b/reactos/dll/win32/comctl32/comctl_Hu.rc @@ -66,24 +66,3 @@ BEGIN LTEXT "E&szkztr gombok:", -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 -{ - IDS_CLOSE "Bezrs" -} - -STRINGTABLE -{ - IDM_TODAY "Ma:" - IDM_GOTODAY "Ugrs mra" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Elvlaszt" -} - -STRINGTABLE -{ - HKY_NONE "Nincs" -} diff --git a/reactos/dll/win32/comctl32/comctl_It.rc b/reactos/dll/win32/comctl32/comctl_It.rc index 8253dab38ce..d6c7fad3d53 100644 --- a/reactos/dll/win32/comctl32/comctl_It.rc +++ b/reactos/dll/win32/comctl32/comctl_It.rc @@ -19,11 +19,14 @@ #include "comctl32.h" +/* UTF-8 */ +#pragma code_page(65001) + LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL IDD_PROPSHEET DIALOG 0, 0, 220, 140 STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE -CAPTION "Propriet per %s" +CAPTION "Proprietà per %s" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP @@ -57,34 +60,13 @@ FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "&Chiudi", IDCANCEL,308,6,44,14 PUSHBUTTON "R&eimpostare", IDC_RESET_BTN,308,23,44,14 - PUSHBUTTON "&Aiuto", IDC_HELP_BTN,308,40,44,14 - PUSHBUTTON "Muovi &Su", IDC_MOVEUP_BTN,308,74,44,14 - PUSHBUTTON "Muovi &Gi", IDC_MOVEDN_BTN,308,91,44,14 + PUSHBUTTON "A&iuto", IDC_HELP_BTN,308,40,44,14 + PUSHBUTTON "Muovi &su", IDC_MOVEUP_BTN,308,74,44,14 + PUSHBUTTON "Muovi &giù", IDC_MOVEDN_BTN,308,91,44,14 LTEXT "&Tasti disponibili:", -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 "&Aggiungi ->", IDOK, 131, 42, 44, 14 PUSHBUTTON "<- &Rimuovi", IDC_REMOVE_BTN,131,62,44,14 - LTEXT "&Tasti della barra degli strumenti:", -1,182,5,78,10 + LTEXT "Tasti della &barra degli strumenti:", -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 -{ - IDS_CLOSE "Chiudi" -} - -STRINGTABLE -{ - IDM_TODAY "Oggi:" - IDM_GOTODAY "Vai a oggi" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Separatore" -} - -STRINGTABLE -{ - HKY_NONE "Nessuno" -} diff --git a/reactos/dll/win32/comctl32/comctl_Ja.rc b/reactos/dll/win32/comctl32/comctl_Ja.rc index 156a00f60d0..c426497b5a2 100644 --- a/reactos/dll/win32/comctl32/comctl_Ja.rc +++ b/reactos/dll/win32/comctl32/comctl_Ja.rc @@ -69,24 +69,3 @@ BEGIN 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 -{ - IDS_CLOSE "閉じる" -} - -STRINGTABLE -{ - IDM_TODAY "今日:" - IDM_GOTODAY "今日へ移動" -} - -STRINGTABLE -{ - IDS_SEPARATOR "区切り" -} - -STRINGTABLE -{ - HKY_NONE "なし" -} diff --git a/reactos/dll/win32/comctl32/comctl_Ko.rc b/reactos/dll/win32/comctl32/comctl_Ko.rc index 31c625263bc..900663a325f 100644 --- a/reactos/dll/win32/comctl32/comctl_Ko.rc +++ b/reactos/dll/win32/comctl32/comctl_Ko.rc @@ -19,72 +19,53 @@ #include "comctl32.h" +#pragma code_page(65001) + LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT IDD_PROPSHEET DIALOG 0, 0, 220, 140 STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE -CAPTION "%s Ӽ" +CAPTION "%s 속성" FONT 9, "MS Shell Dlg" BEGIN - DEFPUSHBUTTON "Ȯ", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP - PUSHBUTTON "", IDCANCEL,58,122,50,14 - PUSHBUTTON "(&A)", IDC_APPLY_BUTTON,112,122,50,14,WS_DISABLED - PUSHBUTTON "", IDHELP,166,122,50,14,WS_TABSTOP|WS_GROUP - CONTROL "", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114 + DEFPUSHBUTTON "확인", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP + PUSHBUTTON "취소", IDCANCEL,58,122,50,14 + PUSHBUTTON "적용(&A)", IDC_APPLY_BUTTON,112,122,50,14,WS_DISABLED + PUSHBUTTON "도움말", IDHELP,166,122,50,14,WS_TABSTOP|WS_GROUP + CONTROL "탭", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114 END IDD_WIZARD DIALOG 0, 0, 290, 159 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE -CAPTION "" +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 "", IDC_FINISH_BUTTON,121,138,50,14 - PUSHBUTTON "", IDCANCEL,178,138,50,14 - PUSHBUTTON "", IDHELP,235,138,50,14,WS_GROUP + PUSHBUTTON "< 이전(&B)", IDC_BACK_BUTTON,71,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 LTEXT "", IDC_SUNKEN_LINE,7,129,278,1,SS_SUNKEN - CONTROL "", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS | WS_DISABLED,7,7,258,5 + CONTROL "탭", 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 IDD_TBCUSTOMIZE DIALOG 10, 20, 357, 125 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION " " +CAPTION "도구바 사용자 정의" FONT 9, "MS Shell Dlg" BEGIN - DEFPUSHBUTTON "ݱ(&C)", IDCANCEL,308,6,44,14 - PUSHBUTTON "缳(&E)", IDC_RESET_BTN,308,23,44,14 - 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,49,14 - LTEXT " ư(&V)", -1,4,5,84,10 + DEFPUSHBUTTON "닫기(&C)", IDCANCEL,308,6,44,14 + PUSHBUTTON "재설정(&E)", IDC_RESET_BTN,308,23,44,14 + 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,49,14 + 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 " ư(&T):", -1,182,5,78,10 + PUSHBUTTON "더하기(&A) ->", IDOK, 131, 42, 44, 14 + PUSHBUTTON "<-지우기(&R)", IDC_REMOVE_BTN,131,62,44,14 + 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 -{ - IDS_CLOSE "ݱ" -} - -STRINGTABLE -{ - IDM_TODAY ":" - IDM_GOTODAY "÷ " -} - -STRINGTABLE -{ - IDS_SEPARATOR "и" -} - -STRINGTABLE -{ - HKY_NONE "" -} diff --git a/reactos/dll/win32/comctl32/comctl_Lt.rc b/reactos/dll/win32/comctl32/comctl_Lt.rc index b723d223155..ea1dc21e68a 100644 --- a/reactos/dll/win32/comctl32/comctl_Lt.rc +++ b/reactos/dll/win32/comctl32/comctl_Lt.rc @@ -69,24 +69,3 @@ BEGIN LTEXT "&Mygtukų juostos turinys:", -1,182,5,84,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 -{ - IDS_CLOSE "Užverti" -} - -STRINGTABLE -{ - IDM_TODAY "Šiandien:" - IDM_GOTODAY "Eiti į šiandien" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Skirtukas" -} - -STRINGTABLE -{ - HKY_NONE "Joks" -} diff --git a/reactos/dll/win32/comctl32/comctl_Nl.rc b/reactos/dll/win32/comctl32/comctl_Nl.rc index 5e94680a2de..46d155f4fd4 100644 --- a/reactos/dll/win32/comctl32/comctl_Nl.rc +++ b/reactos/dll/win32/comctl32/comctl_Nl.rc @@ -68,24 +68,3 @@ BEGIN LTEXT "&Knoppen:", -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 -{ - IDS_CLOSE "Sluiten" -} - -STRINGTABLE -{ - IDM_TODAY "Vandaag:" - IDM_GOTODAY "Ga naar vandaag" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Scheidingsteken" -} - -STRINGTABLE -{ - HKY_NONE "Geen" -} diff --git a/reactos/dll/win32/comctl32/comctl_No.rc b/reactos/dll/win32/comctl32/comctl_No.rc index ada1a47c4ca..770e57914d5 100644 --- a/reactos/dll/win32/comctl32/comctl_No.rc +++ b/reactos/dll/win32/comctl32/comctl_No.rc @@ -40,7 +40,7 @@ FONT 8, "MS Shell Dlg" BEGIN PUSHBUTTON "< Til&bake", IDC_BACK_BUTTON,71,138,50,14 DEFPUSHBUTTON "&Neste >", IDC_NEXT_BUTTON,121,138,50,14 - DEFPUSHBUTTON "Fullfr", IDC_FINISH_BUTTON,121,138,50,14 + DEFPUSHBUTTON "Fullfr", IDC_FINISH_BUTTON,121,138,50,14 PUSHBUTTON "Avbryt", IDCANCEL,178,138,50,14 PUSHBUTTON "Hjelp", IDHELP,235,138,50,14,WS_GROUP LTEXT "", IDC_SUNKEN_LINE,7,129,278,1,SS_SUNKEN @@ -51,7 +51,7 @@ END IDD_TBCUSTOMIZE DIALOG 10, 20, 357, 125 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Tilpass verktylinje" +CAPTION "Tilpass verktylinje" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "&Lukk", IDCANCEL,308,6,44,14 @@ -63,27 +63,6 @@ BEGIN 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 "Le&gg til ->", IDOK, 131, 42, 44, 14 PUSHBUTTON "<- Fje&rn", IDC_REMOVE_BTN,131,62,44,14 - LTEXT "Verk&tylinje-knapper:", -1,182,5,78,10 + LTEXT "Verk&tylinje-knapper:", -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 -{ - IDS_CLOSE "Lukk" -} - -STRINGTABLE -{ - IDM_TODAY "Idag:" - IDM_GOTODAY "G til idag" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Adskiller" -} - -STRINGTABLE -{ - HKY_NONE "Ingen" -} diff --git a/reactos/dll/win32/comctl32/comctl_Pl.rc b/reactos/dll/win32/comctl32/comctl_Pl.rc index f3317e00e27..4da65f15ba5 100644 --- a/reactos/dll/win32/comctl32/comctl_Pl.rc +++ b/reactos/dll/win32/comctl32/comctl_Pl.rc @@ -23,7 +23,7 @@ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT IDD_PROPSHEET DIALOG 0, 0, 220, 140 STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE -CAPTION "Waciwoci %s" +CAPTION "Waciwoci %s" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP @@ -41,7 +41,7 @@ FONT 8, "MS Shell Dlg" BEGIN PUSHBUTTON "< &Wstecz", IDC_BACK_BUTTON,71,138,50,14 DEFPUSHBUTTON "&Dalej >", IDC_NEXT_BUTTON,121,138,50,14 - DEFPUSHBUTTON "Zakocz", IDC_FINISH_BUTTON,121,138,50,14 + DEFPUSHBUTTON "Zakocz", IDC_FINISH_BUTTON,121,138,50,14 PUSHBUTTON "Anuluj", IDCANCEL,178,138,50,14 PUSHBUTTON "Pomoc", IDHELP,235,138,50,14,WS_GROUP LTEXT "", IDC_SUNKEN_LINE,7,129,278,1,SS_SUNKEN @@ -67,24 +67,3 @@ BEGIN LTEXT "&Przyciski paska narzdzi:", -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 -{ - IDS_CLOSE "Zamknij" -} - -STRINGTABLE -{ - IDM_TODAY "Dzi:" - IDM_GOTODAY "Id do dzi" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Odstp" -} - -STRINGTABLE -{ - HKY_NONE "Brak" -} diff --git a/reactos/dll/win32/comctl32/comctl_Pt.rc b/reactos/dll/win32/comctl32/comctl_Pt.rc index ca60a59f130..70dd367cd03 100644 --- a/reactos/dll/win32/comctl32/comctl_Pt.rc +++ b/reactos/dll/win32/comctl32/comctl_Pt.rc @@ -68,24 +68,3 @@ BEGIN 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 - -STRINGTABLE -{ - IDS_CLOSE "Fechar" -} - -STRINGTABLE -{ - IDM_TODAY "Hoje:" - IDM_GOTODAY "Ir para hoje" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Separador" -} - -STRINGTABLE -{ - HKY_NONE "Nenhum" -} diff --git a/reactos/dll/win32/comctl32/comctl_Ro.rc b/reactos/dll/win32/comctl32/comctl_Ro.rc index fd6b1161ec8..ab2873f4a60 100644 --- a/reactos/dll/win32/comctl32/comctl_Ro.rc +++ b/reactos/dll/win32/comctl32/comctl_Ro.rc @@ -69,24 +69,3 @@ BEGIN LTEXT "Butoane &toolbar:", -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 -{ - IDS_CLOSE "Închide" -} - -STRINGTABLE -{ - IDM_TODAY "Azi:" - IDM_GOTODAY "Mergi la Azi" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Separator" -} - -STRINGTABLE -{ - HKY_NONE "Nimic" -} diff --git a/reactos/dll/win32/comctl32/comctl_Ru.rc b/reactos/dll/win32/comctl32/comctl_Ru.rc index ce330609db4..c75fb0d5af8 100644 --- a/reactos/dll/win32/comctl32/comctl_Ru.rc +++ b/reactos/dll/win32/comctl32/comctl_Ru.rc @@ -71,24 +71,3 @@ BEGIN 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 -{ - IDS_CLOSE "Закрыть" -} - -STRINGTABLE -{ - IDM_TODAY "Сегодня:" - IDM_GOTODAY "Текущая дата" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Разделитель" -} - -STRINGTABLE -{ - HKY_NONE "Нет" -} diff --git a/reactos/dll/win32/comctl32/comctl_Si.rc b/reactos/dll/win32/comctl32/comctl_Si.rc index 9d1b1f22a62..dca3143390f 100644 --- a/reactos/dll/win32/comctl32/comctl_Si.rc +++ b/reactos/dll/win32/comctl32/comctl_Si.rc @@ -68,24 +68,3 @@ BEGIN LTEXT "G&umbi orodne vrstice:", -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 -{ - IDS_CLOSE "Zapri" -} - -STRINGTABLE -{ - IDM_TODAY "Danes:" - IDM_GOTODAY "Pojdi na danes" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Ločilo" -} - -STRINGTABLE -{ - HKY_NONE "Brez" -} diff --git a/reactos/dll/win32/comctl32/comctl_Sk.rc b/reactos/dll/win32/comctl32/comctl_Sk.rc index 4acd84c5ac5..94cc7e937ec 100644 --- a/reactos/dll/win32/comctl32/comctl_Sk.rc +++ b/reactos/dll/win32/comctl32/comctl_Sk.rc @@ -69,24 +69,3 @@ BEGIN LTEXT "&Tlaidl panela:", -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 -{ - IDS_CLOSE "Zavrie" -} - -STRINGTABLE -{ - IDM_TODAY "Dnes:" - IDM_GOTODAY "Cho na dneok" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Oddeova" -} - -STRINGTABLE -{ - HKY_NONE "iadne" -} diff --git a/reactos/dll/win32/comctl32/comctl_Sr.rc b/reactos/dll/win32/comctl32/comctl_Sr.rc index 8681ecbe629..390556fa8a1 100644 --- a/reactos/dll/win32/comctl32/comctl_Sr.rc +++ b/reactos/dll/win32/comctl32/comctl_Sr.rc @@ -1,6 +1,7 @@ /* * Copyright 2010 Nenad Vujic * Paul Vriens + * Copyright 2010 Đorđe Vasiljević * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,138 +26,96 @@ LANGUAGE LANG_SERBIAN, SUBLANG_SERBIAN_LATIN IDD_PROPSHEET DIALOG 0, 0, 220, 140 STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE -CAPTION "Detalji za %s" +CAPTION "Svojstva za %s" FONT 8, "MS Shell Dlg" BEGIN - DEFPUSHBUTTON "OK", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP + DEFPUSHBUTTON "U redu", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP PUSHBUTTON "Otkaži", IDCANCEL,58,122,50,14 PUSHBUTTON "&Primeni", IDC_APPLY_BUTTON,112,122,50,14,WS_DISABLED PUSHBUTTON "Pomoć", 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 + CONTROL "Jezičak", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114 END IDD_WIZARD DIALOG 0, 0, 290, 159 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE -CAPTION "Čarobnjak" +CAPTION "Vodič" FONT 8, "MS Shell Dlg" BEGIN PUSHBUTTON "< &Nazad", IDC_BACK_BUTTON,71,138,50,14 - DEFPUSHBUTTON "&Sledeće >", IDC_NEXT_BUTTON,121,138,50,14 - DEFPUSHBUTTON "Završi", IDC_FINISH_BUTTON,121,138,50,14 + DEFPUSHBUTTON "&Napred >", IDC_NEXT_BUTTON,121,138,50,14 + DEFPUSHBUTTON "Kraj", IDC_FINISH_BUTTON,121,138,50,14 PUSHBUTTON "Otkaži", IDCANCEL,178,138,50,14 PUSHBUTTON "Pomoć", 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 "Jezičak", 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 IDD_TBCUSTOMIZE DIALOG 10, 20, 357, 125 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Podesi Toolbar" +CAPTION "Prilagodi alatnicu" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "&Zatvori", IDCANCEL,308,6,44,14 - PUSHBUTTON "R&esetuj", IDC_RESET_BTN,308,23,44,14 + PUSHBUTTON "&Poništi", IDC_RESET_BTN,308,23,44,14 PUSHBUTTON "&Pomoć", IDC_HELP_BTN,308,40,44,14 - PUSHBUTTON "Pomeri &Gore", IDC_MOVEUP_BTN,308,74,44,14 - PUSHBUTTON "Pomeri &Dole", IDC_MOVEDN_BTN,308,91,44,14 - LTEXT "D&ostupni tasteri:", -1,4,5,84,10 + PUSHBUTTON "Pomeri na&gore", IDC_MOVEUP_BTN,308,74,44,14 + PUSHBUTTON "Pomeri na&dole", IDC_MOVEDN_BTN,308,91,44,14 + LTEXT "&Dostupni dugmići:", -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 "&Dodaj ->", IDOK, 131, 42, 44, 14 PUSHBUTTON "<- &Ukloni", IDC_REMOVE_BTN,131,62,44,14 - LTEXT "&Toolbar tasteri:", -1,182,5,78,10 + LTEXT "&Dugmići na alatnici:", -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 -{ - IDS_CLOSE "Zatvori" -} - -STRINGTABLE -{ - IDM_TODAY "Danas:" - IDM_GOTODAY "Idi na danas" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Odvajanje" -} - -STRINGTABLE -{ - HKY_NONE "Ništa" -} - LANGUAGE LANG_SERBIAN, SUBLANG_SERBIAN_CYRILLIC IDD_PROPSHEET DIALOG 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 "ОK", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP + DEFPUSHBUTTON "У реду", 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 - CONTROL "Таб", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114 + CONTROL "Језичак", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114 END IDD_WIZARD DIALOG 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 + 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 "Таб", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS | WS_DISABLED,7,7,258,5 + CONTROL "Језичак", 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 IDD_TBCUSTOMIZE DIALOG 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_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 + 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 + 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 -{ - IDS_CLOSE "Затвори" -} - -STRINGTABLE -{ - IDM_TODAY "Данас:" - IDM_GOTODAY "Иди на данас" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Одвајање" -} - -STRINGTABLE -{ - HKY_NONE "Ништа" -} diff --git a/reactos/dll/win32/comctl32/comctl_Sv.rc b/reactos/dll/win32/comctl32/comctl_Sv.rc index e66b379217d..6dcadaf6867 100644 --- a/reactos/dll/win32/comctl32/comctl_Sv.rc +++ b/reactos/dll/win32/comctl32/comctl_Sv.rc @@ -66,24 +66,3 @@ BEGIN LTEXT "Knappar i v&erktygsfltet:", -1,182,5,85,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 -{ - IDS_CLOSE "Stng" -} - -STRINGTABLE -{ - IDM_TODAY "Idag:" - IDM_GOTODAY "G till idag" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Separator" -} - -STRINGTABLE -{ - HKY_NONE "Ingen" -} diff --git a/reactos/dll/win32/comctl32/comctl_Th.rc b/reactos/dll/win32/comctl32/comctl_Th.rc index 915ecf4df8d..54b63356a05 100644 --- a/reactos/dll/win32/comctl32/comctl_Th.rc +++ b/reactos/dll/win32/comctl32/comctl_Th.rc @@ -66,24 +66,3 @@ BEGIN 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 -{ - IDS_CLOSE "մ" -} - -STRINGTABLE -{ - IDM_TODAY "ѹ:" - IDM_GOTODAY "件֧ѹ" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Separator" -} - -STRINGTABLE -{ - HKY_NONE "" -} diff --git a/reactos/dll/win32/comctl32/comctl_Tr.rc b/reactos/dll/win32/comctl32/comctl_Tr.rc index cda21936f5c..a57ed789721 100644 --- a/reactos/dll/win32/comctl32/comctl_Tr.rc +++ b/reactos/dll/win32/comctl32/comctl_Tr.rc @@ -66,24 +66,3 @@ BEGIN LTEXT "&Ara ubuu butonlar:", -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 -{ - IDS_CLOSE "Kapat" -} - -STRINGTABLE -{ - IDM_TODAY "Bugn:" - IDM_GOTODAY "Bugne git" -} - -STRINGTABLE -{ - IDS_SEPARATOR "Ayra" -} - -STRINGTABLE -{ - HKY_NONE "Hibiri" -} diff --git a/reactos/dll/win32/comctl32/comctl_Uk.rc b/reactos/dll/win32/comctl32/comctl_Uk.rc index 3aa29f024f8..dde83f41c8d 100644 --- a/reactos/dll/win32/comctl32/comctl_Uk.rc +++ b/reactos/dll/win32/comctl32/comctl_Uk.rc @@ -70,24 +70,3 @@ BEGIN 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 -{ - IDS_CLOSE "" -} - -STRINGTABLE -{ - IDM_TODAY ":" - IDM_GOTODAY " " -} - -STRINGTABLE -{ - IDS_SEPARATOR "" -} - -STRINGTABLE -{ - HKY_NONE "" -} diff --git a/reactos/dll/win32/comctl32/comctl_Zh.rc b/reactos/dll/win32/comctl32/comctl_Zh.rc index 63f22e7aa16..8a80817b521 100644 --- a/reactos/dll/win32/comctl32/comctl_Zh.rc +++ b/reactos/dll/win32/comctl32/comctl_Zh.rc @@ -73,27 +73,6 @@ BEGIN 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 -{ - IDS_CLOSE "关闭" -} - -STRINGTABLE -{ - IDM_TODAY "今天:" - IDM_GOTODAY "转到今天" -} - -STRINGTABLE -{ - IDS_SEPARATOR "分隔符" -} - -STRINGTABLE -{ - HKY_NONE "无" -} - LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL IDD_PROPSHEET DIALOG 0, 0, 220, 140 @@ -142,24 +121,3 @@ BEGIN 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 -{ - IDS_CLOSE "關閉" -} - -STRINGTABLE -{ - IDM_TODAY "今天:" - IDM_GOTODAY "轉到今天" -} - -STRINGTABLE -{ - IDS_SEPARATOR "分隔符" -} - -STRINGTABLE -{ - HKY_NONE "無" -} diff --git a/reactos/dll/win32/comctl32/commctrl.c b/reactos/dll/win32/comctl32/commctrl.c index eb0f6b5293e..a82b233c6d6 100644 --- a/reactos/dll/win32/comctl32/commctrl.c +++ b/reactos/dll/win32/comctl32/commctrl.c @@ -1689,3 +1689,17 @@ int WINAPI DrawShadowText(HDC hdc, LPCWSTR pszText, UINT cch, RECT *rect, DWORD crText, crShadow, ixOffset, iyOffset); return DrawTextW(hdc, pszText, cch, rect, DT_LEFT); } + +/*********************************************************************** + * TaskDialogIndirect [COMCTL32.@] + */ +HRESULT WINAPI TaskDialogIndirect(const TASKDIALOGCONFIG *pTaskConfig, int *pnButton, + int *pnRadioButton, BOOL *pfVerificationFlagChecked) +{ + FIXME("%p, %p, %p, %p\n", pTaskConfig, pnButton, pnRadioButton, pfVerificationFlagChecked); + + if (pnButton) *pnButton = IDYES; + if (pnRadioButton) *pnRadioButton = pTaskConfig->nDefaultButton; + if (pfVerificationFlagChecked) *pfVerificationFlagChecked = TRUE; + return S_OK; +} diff --git a/reactos/dll/win32/comctl32/datetime.c b/reactos/dll/win32/comctl32/datetime.c index 24189507d64..1ac6ba7ad36 100644 --- a/reactos/dll/win32/comctl32/datetime.c +++ b/reactos/dll/win32/comctl32/datetime.c @@ -787,6 +787,7 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, INT x, INT y) if (infoPtr->select == DTHT_MCPOPUP) { RECT rcMonthCal; + POINT pos; SendMessageW(infoPtr->hMonthCal, MCM_GETMINREQRECT, 0, (LPARAM)&rcMonthCal); /* FIXME: button actually is only depressed during dropdown of the */ @@ -795,17 +796,16 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, INT x, INT y) /* recalculate the position of the monthcal popup */ if(infoPtr->dwStyle & DTS_RIGHTALIGN) - infoPtr->monthcal_pos.x = infoPtr->calbutton.left - - (rcMonthCal.right - rcMonthCal.left); + pos.x = infoPtr->calbutton.left - (rcMonthCal.right - rcMonthCal.left); else /* FIXME: this should be after the area reserved for the checkbox */ - infoPtr->monthcal_pos.x = infoPtr->rcDraw.left; + pos.x = infoPtr->rcDraw.left; - infoPtr->monthcal_pos.y = infoPtr->rcClient.bottom; - ClientToScreen (infoPtr->hwndSelf, &(infoPtr->monthcal_pos)); - SetWindowPos(infoPtr->hMonthCal, 0, infoPtr->monthcal_pos.x, - infoPtr->monthcal_pos.y, rcMonthCal.right - rcMonthCal.left, - rcMonthCal.bottom - rcMonthCal.top, 0); + pos.y = infoPtr->rcClient.bottom; + OffsetRect( &rcMonthCal, pos.x, pos.y ); + MapWindowPoints( infoPtr->hwndSelf, 0, (POINT *)&rcMonthCal, 2 ); + SetWindowPos(infoPtr->hMonthCal, 0, rcMonthCal.left, rcMonthCal.top, + rcMonthCal.right - rcMonthCal.left, rcMonthCal.bottom - rcMonthCal.top, 0); if(IsWindowVisible(infoPtr->hMonthCal)) { ShowWindow(infoPtr->hMonthCal, SW_HIDE); @@ -1368,7 +1368,7 @@ DATETIME_Destroy (DATETIME_INFO *infoPtr) static INT -DATETIME_GetText (DATETIME_INFO *infoPtr, INT count, LPWSTR dst) +DATETIME_GetText (const DATETIME_INFO *infoPtr, INT count, LPWSTR dst) { WCHAR buf[80]; int i; diff --git a/reactos/dll/win32/comctl32/header.c b/reactos/dll/win32/comctl32/header.c index d916c7297d5..603d0a33e08 100644 --- a/reactos/dll/win32/comctl32/header.c +++ b/reactos/dll/win32/comctl32/header.c @@ -1215,7 +1215,7 @@ HEADER_GetOrderArray(const HEADER_INFO *infoPtr, INT size, LPINT order) /* 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) +static INT has_duplicate(const INT *array, INT to, INT value) { INT i; for(i = 0; i < to; i++) @@ -1224,7 +1224,7 @@ static INT has_duplicate(INT *array, INT to, INT value) } /* returns next available value from [0,max] not to duplicate in [0,to) */ -static INT get_nextvalue(INT *array, INT to, INT max) +static INT get_nextvalue(const INT *array, INT to, INT max) { INT i; for(i = 0; i < max; i++) diff --git a/reactos/dll/win32/comctl32/imagelist.c b/reactos/dll/win32/comctl32/imagelist.c index 47279c9812a..66cd03d6eb4 100644 --- a/reactos/dll/win32/comctl32/imagelist.c +++ b/reactos/dll/win32/comctl32/imagelist.c @@ -694,6 +694,8 @@ ImageList_Create (INT cx, INT cy, UINT flags, TRACE("(%d %d 0x%x %d %d)\n", cx, cy, flags, cInitial, cGrow); + if (cx <= 0 || cy <= 0) return NULL; + /* Create the IImageList interface for the image list */ if (FAILED(ImageListImpl_CreateInstance(NULL, &IID_IImageList, (void **)&himl))) return NULL; @@ -1519,7 +1521,6 @@ ImageList_Duplicate (HIMAGELIST himlSrc) himlSrc->hdcMask, 0, 0, SRCCOPY); himlDst->cCurImage = himlSrc->cCurImage; - himlDst->cMaxImage = himlSrc->cMaxImage; if (himlSrc->has_alpha && himlDst->has_alpha) memcpy( himlDst->has_alpha, himlSrc->has_alpha, himlDst->cCurImage ); } @@ -1726,15 +1727,13 @@ ImageList_GetIcon (HIMAGELIST himl, INT i, UINT fStyle) BOOL WINAPI ImageList_GetIconSize (HIMAGELIST himl, INT *cx, INT *cy) { - if (!is_valid(himl)) + if (!is_valid(himl) || !cx || !cy) return FALSE; if ((himl->cx <= 0) || (himl->cy <= 0)) return FALSE; - if (cx) - *cx = himl->cx; - if (cy) - *cy = himl->cy; + *cx = himl->cx; + *cy = himl->cy; return TRUE; } @@ -1907,8 +1906,11 @@ ImageList_LoadImageW (HINSTANCE hi, LPCWSTR lpbmp, INT cx, INT cGrow, } if (uType == IMAGE_BITMAP) { - BITMAP bmp; - GetObjectW (handle, sizeof(BITMAP), &bmp); + DIBSECTION dib; + UINT color; + + if (GetObjectW (handle, sizeof(dib), &dib) == sizeof(BITMAP)) color = ILC_COLOR; + else color = dib.dsBm.bmBitsPixel; /* To match windows behavior, if cx is set to zero and the flag DI_DEFAULTSIZE is specified, cx becomes the @@ -1919,13 +1921,12 @@ ImageList_LoadImageW (HINSTANCE hi, LPCWSTR lpbmp, INT cx, INT cGrow, if (uFlags & DI_DEFAULTSIZE) cx = GetSystemMetrics (SM_CXICON); else - cx = bmp.bmHeight; + cx = dib.dsBm.bmHeight; } - nImageCount = bmp.bmWidth / cx; + nImageCount = dib.dsBm.bmWidth / cx; - himl = ImageList_Create (cx, bmp.bmHeight, ILC_MASK | ILC_COLOR, - nImageCount, cGrow); + himl = ImageList_Create (cx, dib.dsBm.bmHeight, ILC_MASK | color, nImageCount, cGrow); if (!himl) { DeleteObject (handle); return NULL; @@ -3298,11 +3299,8 @@ static HRESULT WINAPI ImageListImpl_Draw(IImageList *iface, IMAGELISTDRAWPARAMS *pimldp) { HIMAGELIST This = (HIMAGELIST) iface; - HIMAGELIST old_himl = 0; - int ret = 0; - - if (!pimldp) - return E_FAIL; + HIMAGELIST old_himl; + int ret; /* As far as I can tell, Windows simply ignores the contents of pimldp->himl so we shall simulate the same */ @@ -3312,12 +3310,12 @@ static HRESULT WINAPI ImageListImpl_Draw(IImageList *iface, ret = ImageList_DrawIndirect(pimldp); pimldp->himl = old_himl; - return ret ? S_OK : E_FAIL; + return ret ? S_OK : E_INVALIDARG; } static HRESULT WINAPI ImageListImpl_Remove(IImageList *iface, int i) { - return (ImageList_Remove((HIMAGELIST) iface, i) == 0) ? E_FAIL : S_OK; + return (ImageList_Remove((HIMAGELIST) iface, i) == 0) ? E_INVALIDARG : S_OK; } static HRESULT WINAPI ImageListImpl_GetIcon(IImageList *iface, int i, UINT flags, @@ -3368,15 +3366,14 @@ static HRESULT WINAPI ImageListImpl_Copy(IImageList *iface, int iDst, } static HRESULT WINAPI ImageListImpl_Merge(IImageList *iface, int i1, - IUnknown *punk2, int i2, int dx, int dy, REFIID riid, PVOID *ppv) + IUnknown *punk2, int i2, int dx, int dy, REFIID riid, void **ppv) { HIMAGELIST This = (HIMAGELIST) iface; IImageList *iml2 = NULL; HIMAGELIST hNew; HRESULT ret = E_FAIL; - if (!punk2 || !ppv) - return E_FAIL; + TRACE("(%p)->(%d %p %d %d %d %s %p)\n", iface, i1, punk2, i2, dx, dy, debugstr_guid(riid), ppv); /* TODO: Add test for IID_ImageList2 too */ if (FAILED(IImageList_QueryInterface(punk2, &IID_IImageList, @@ -3387,27 +3384,35 @@ static HRESULT WINAPI ImageListImpl_Merge(IImageList *iface, int i1, /* Get the interface for the new image list */ if (hNew) + { + IImageList *imerge = (IImageList*)hNew; + ret = HIMAGELIST_QueryInterface(hNew, riid, ppv); + IImageList_Release(imerge); + } IImageList_Release(iml2); return ret; } -static HRESULT WINAPI ImageListImpl_Clone(IImageList *iface, REFIID riid, - PVOID *ppv) +static HRESULT WINAPI ImageListImpl_Clone(IImageList *iface, REFIID riid, void **ppv) { HIMAGELIST This = (HIMAGELIST) iface; - HIMAGELIST hNew; + HIMAGELIST clone; HRESULT ret = E_FAIL; - if (!ppv) - return E_FAIL; + TRACE("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv); - hNew = ImageList_Duplicate(This); + clone = ImageList_Duplicate(This); /* Get the interface for the new image list */ - if (hNew) - ret = HIMAGELIST_QueryInterface(hNew, riid, ppv); + if (clone) + { + IImageList *iclone = (IImageList*)clone; + + ret = HIMAGELIST_QueryInterface(clone, riid, ppv); + IImageList_Release(iclone); + } return ret; } @@ -3432,7 +3437,7 @@ static HRESULT WINAPI ImageListImpl_GetIconSize(IImageList *iface, int *cx, { HIMAGELIST This = (HIMAGELIST) iface; - return ImageList_GetIconSize(This, cx, cy) ? S_OK : E_FAIL; + return ImageList_GetIconSize(This, cx, cy) ? S_OK : E_INVALIDARG; } static HRESULT WINAPI ImageListImpl_SetIconSize(IImageList *iface, int cx, @@ -3443,9 +3448,6 @@ static HRESULT WINAPI ImageListImpl_SetIconSize(IImageList *iface, int cx, static HRESULT WINAPI ImageListImpl_GetImageCount(IImageList *iface, int *pi) { - if (!pi) - return E_FAIL; - *pi = ImageList_GetImageCount((HIMAGELIST) iface); return S_OK; } @@ -3459,18 +3461,12 @@ static HRESULT WINAPI ImageListImpl_SetImageCount(IImageList *iface, static HRESULT WINAPI ImageListImpl_SetBkColor(IImageList *iface, COLORREF clrBk, COLORREF *pclr) { - if (!pclr) - return E_FAIL; - *pclr = ImageList_SetBkColor((HIMAGELIST) iface, clrBk); - return *pclr == CLR_NONE ? E_FAIL : S_OK; + return S_OK; } static HRESULT WINAPI ImageListImpl_GetBkColor(IImageList *iface, COLORREF *pclr) { - if (!pclr) - return E_FAIL; - *pclr = ImageList_GetBkColor((HIMAGELIST) iface); return S_OK; } @@ -3543,7 +3539,12 @@ static HRESULT WINAPI ImageListImpl_GetDragImage(IImageList *iface, POINT *ppt, /* Get the interface for the new image list */ if (hNew) + { + IImageList *idrag = (IImageList*)hNew; + ret = HIMAGELIST_QueryInterface(hNew, riid, ppv); + IImageList_Release(idrag); + } return ret; } @@ -3650,11 +3651,9 @@ static HRESULT ImageListImpl_CreateInstance(const IUnknown *pUnkOuter, REFIID ii if (pUnkOuter) return CLASS_E_NOAGGREGATION; - This = HeapAlloc(GetProcessHeap(), 0, sizeof(struct _IMAGELIST)); + This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct _IMAGELIST)); if (!This) return E_OUTOFMEMORY; - ZeroMemory(This, sizeof(struct _IMAGELIST)); - This->lpVtbl = &ImageListImpl_Vtbl; This->ref = 1; diff --git a/reactos/dll/win32/comctl32/ipaddress.c b/reactos/dll/win32/comctl32/ipaddress.c index 03b8d1c9ed3..1f41f91eac1 100644 --- a/reactos/dll/win32/comctl32/ipaddress.c +++ b/reactos/dll/win32/comctl32/ipaddress.c @@ -149,7 +149,6 @@ static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc) { static const WCHAR dotW[] = { '.', 0 }; RECT rect, rcPart; - POINT pt; COLORREF bgCol, fgCol; int i; @@ -173,13 +172,11 @@ static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc) for (i = 0; i < 3; i++) { GetWindowRect (infoPtr->Part[i].EditHwnd, &rcPart); - pt.x = rcPart.right; - ScreenToClient(infoPtr->Self, &pt); - rect.left = pt.x; + MapWindowPoints( 0, infoPtr->Self, (POINT *)&rcPart, 2 ); + rect.left = rcPart.right; GetWindowRect (infoPtr->Part[i+1].EditHwnd, &rcPart); - pt.x = rcPart.left; - ScreenToClient(infoPtr->Self, &pt); - rect.right = pt.x; + MapWindowPoints( 0, infoPtr->Self, (POINT *)&rcPart, 2 ); + rect.right = rcPart.left; DrawTextW(hdc, dotW, 1, &rect, DT_SINGLELINE | DT_CENTER | DT_BOTTOM); } diff --git a/reactos/dll/win32/comctl32/listview.c b/reactos/dll/win32/comctl32/listview.c index 4e13577b48f..dc96200ee35 100644 --- a/reactos/dll/win32/comctl32/listview.c +++ b/reactos/dll/win32/comctl32/listview.c @@ -6,7 +6,7 @@ * Copyright 2000 Jason Mawdsley * Copyright 2001 CodeWeavers Inc. * Copyright 2002 Dimitrie O. Paun - * Copyright 2009 Nikolay Sivov + * Copyright 2009-2011 Nikolay Sivov * Copyright 2009 Owen Rudge for CodeWeavers * * This library is free software; you can redistribute it and/or @@ -456,8 +456,8 @@ static INT LISTVIEW_GetStringWidthT(const LISTVIEW_INFO *, LPCWSTR, BOOL); static BOOL LISTVIEW_KeySelection(LISTVIEW_INFO *, INT, BOOL); static UINT LISTVIEW_GetItemState(const LISTVIEW_INFO *, INT, UINT); static BOOL LISTVIEW_SetItemState(LISTVIEW_INFO *, INT, const LVITEMW *); -static LRESULT LISTVIEW_VScroll(LISTVIEW_INFO *, INT, INT, HWND); -static LRESULT LISTVIEW_HScroll(LISTVIEW_INFO *, INT, INT, HWND); +static LRESULT LISTVIEW_VScroll(LISTVIEW_INFO *, INT, INT); +static LRESULT LISTVIEW_HScroll(LISTVIEW_INFO *, INT, INT); static BOOL LISTVIEW_EnsureVisible(LISTVIEW_INFO *, INT, BOOL); static HIMAGELIST LISTVIEW_SetImageList(LISTVIEW_INFO *, INT, HIMAGELIST); static INT LISTVIEW_HitTest(const LISTVIEW_INFO *, LPLVHITTESTINFO, BOOL, BOOL); @@ -474,20 +474,14 @@ static BOOL LISTVIEW_Scroll(LISTVIEW_INFO *, INT, INT); * W: Unicode, T: ANSI/Unicode - function of isW */ -static inline BOOL is_textW(LPCWSTR text) +static inline BOOL is_text(LPCWSTR text) { return text != NULL && text != LPSTR_TEXTCALLBACKW; } -static inline BOOL is_textT(LPCWSTR text, BOOL isW) -{ - /* we can ignore isW since LPSTR_TEXTCALLBACKW == LPSTR_TEXTCALLBACKA */ - return is_textW(text); -} - static inline int textlenT(LPCWSTR text, BOOL isW) { - return !is_textT(text, isW) ? 0 : + return !is_text(text) ? 0 : isW ? lstrlenW(text) : lstrlenA((LPCSTR)text); } @@ -505,7 +499,7 @@ static inline LPWSTR textdupTtoW(LPCWSTR text, BOOL isW) { LPWSTR wstr = (LPWSTR)text; - if (!isW && is_textT(text, isW)) + if (!isW && is_text(text)) { INT len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)text, -1, NULL, 0); wstr = Alloc(len * sizeof(WCHAR)); @@ -517,7 +511,7 @@ static inline LPWSTR textdupTtoW(LPCWSTR text, BOOL isW) static inline void textfreeT(LPWSTR wstr, BOOL isW) { - if (!isW && is_textT(wstr, isW)) Free (wstr); + if (!isW && is_text(wstr)) Free (wstr); } /* @@ -530,7 +524,7 @@ static BOOL textsetptrT(LPWSTR *dest, LPCWSTR src, BOOL isW) if (src == LPSTR_TEXTCALLBACKW) { - if (is_textW(*dest)) Free(*dest); + if (is_text(*dest)) Free(*dest); *dest = LPSTR_TEXTCALLBACKW; } else @@ -623,7 +617,7 @@ static const char* debugscrollinfo(const SCROLLINFO *pScrollInfo) if (pScrollInfo->fMask & SIF_TRACKPOS) len = snprintf(buf, size, "nTrackPos=%d, ", pScrollInfo->nTrackPos); else len = 0; - if (len == -1) goto end; buf += len; size -= len; + if (len == -1) goto end; buf += len; goto undo; end: buf = text + strlen(text); @@ -668,7 +662,7 @@ static const char* debuglvitem_t(const LVITEMW *lpLVItem, BOOL isW) if (lpLVItem->mask & LVIF_INDENT) len = snprintf(buf, size, "iIndent=%d, ", lpLVItem->iIndent); else len = 0; - if (len == -1) goto end; buf += len; size -= len; + if (len == -1) goto end; buf += len; goto undo; end: buf = text + strlen(text); @@ -708,7 +702,7 @@ static const char* debuglvcolumn_t(const LVCOLUMNW *lpColumn, BOOL isW) if (lpColumn->mask & LVCF_ORDER) len = snprintf(buf, size, "iOrder=%d, ", lpColumn->iOrder); else len = 0; - if (len == -1) goto end; buf += len; size -= len; + if (len == -1) goto end; buf += len; goto undo; end: buf = text + strlen(text); @@ -934,74 +928,104 @@ static BOOL notify_deleteitem(const LISTVIEW_INFO *infoPtr, INT nItem) Send notification. depends on dispinfoW having same structure as dispinfoA. infoPtr : listview struct - notificationCode : *Unicode* notification code + code : *Unicode* notification code pdi : dispinfo structure (can be unicode or ansi) isW : TRUE if dispinfo is Unicode */ -static BOOL notify_dispinfoT(const LISTVIEW_INFO *infoPtr, UINT notificationCode, LPNMLVDISPINFOW pdi, BOOL isW) +static BOOL notify_dispinfoT(const LISTVIEW_INFO *infoPtr, UINT code, LPNMLVDISPINFOW pdi, BOOL isW) { - BOOL bResult = FALSE; - BOOL convertToAnsi = FALSE, convertToUnicode = FALSE; - INT cchTempBufMax = 0, savCchTextMax = 0; - UINT realNotifCode; - LPWSTR pszTempBuf = NULL, savPszText = NULL; + INT length = 0, ret_length; + LPWSTR buffer = NULL, ret_text; + BOOL return_ansi = FALSE; + BOOL return_unicode = FALSE; + BOOL ret; - if ((pdi->item.mask & LVIF_TEXT) && is_textT(pdi->item.pszText, isW)) + if ((pdi->item.mask & LVIF_TEXT) && is_text(pdi->item.pszText)) { - convertToAnsi = (isW && infoPtr->notifyFormat == NFR_ANSI); - convertToUnicode = (!isW && infoPtr->notifyFormat == NFR_UNICODE); + return_unicode = ( isW && infoPtr->notifyFormat == NFR_ANSI); + return_ansi = (!isW && infoPtr->notifyFormat == NFR_UNICODE); } - if (convertToAnsi || convertToUnicode) + ret_length = pdi->item.cchTextMax; + ret_text = pdi->item.pszText; + + if (return_unicode || return_ansi) { - if (notificationCode != LVN_GETDISPINFOW) - { - cchTempBufMax = convertToUnicode ? + if (code != LVN_GETDISPINFOW) + { + length = return_ansi ? MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pdi->item.pszText, -1, NULL, 0): WideCharToMultiByte(CP_ACP, 0, pdi->item.pszText, -1, NULL, 0, NULL, NULL); - } - else - { - cchTempBufMax = pdi->item.cchTextMax; - *pdi->item.pszText = 0; /* make sure we don't process garbage */ - } + } + else + { + length = pdi->item.cchTextMax; + *pdi->item.pszText = 0; /* make sure we don't process garbage */ + } - pszTempBuf = Alloc( (convertToUnicode ? sizeof(WCHAR) : sizeof(CHAR)) * cchTempBufMax); - if (!pszTempBuf) return FALSE; + buffer = Alloc( (return_ansi ? sizeof(WCHAR) : sizeof(CHAR)) * length); + if (!buffer) return FALSE; - if (convertToUnicode) - MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pdi->item.pszText, -1, - pszTempBuf, cchTempBufMax); - else - WideCharToMultiByte(CP_ACP, 0, pdi->item.pszText, -1, (LPSTR) pszTempBuf, - cchTempBufMax, NULL, NULL); + if (return_ansi) + MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pdi->item.pszText, -1, + buffer, length); + else + WideCharToMultiByte(CP_ACP, 0, pdi->item.pszText, -1, (LPSTR) buffer, + length, NULL, NULL); - savCchTextMax = pdi->item.cchTextMax; - savPszText = pdi->item.pszText; - pdi->item.pszText = pszTempBuf; - pdi->item.cchTextMax = cchTempBufMax; + pdi->item.pszText = buffer; + pdi->item.cchTextMax = length; } if (infoPtr->notifyFormat == NFR_ANSI) - realNotifCode = get_ansi_notification(notificationCode); - else - realNotifCode = notificationCode; - TRACE(" pdi->item=%s\n", debuglvitem_t(&pdi->item, infoPtr->notifyFormat != NFR_ANSI)); - bResult = notify_hdr(infoPtr, realNotifCode, &pdi->hdr); + code = get_ansi_notification(code); - if (convertToUnicode || convertToAnsi) + TRACE(" pdi->item=%s\n", debuglvitem_t(&pdi->item, infoPtr->notifyFormat != NFR_ANSI)); + ret = notify_hdr(infoPtr, code, &pdi->hdr); + TRACE(" resulting code=%d\n", pdi->hdr.code); + + if (return_ansi || return_unicode) { - if (convertToUnicode) /* note : pointer can be changed by app ! */ - WideCharToMultiByte(CP_ACP, 0, pdi->item.pszText, -1, (LPSTR) savPszText, - savCchTextMax, NULL, NULL); - else - MultiByteToWideChar(CP_ACP, 0, (LPSTR) pdi->item.pszText, -1, - savPszText, savCchTextMax); - pdi->item.pszText = savPszText; /* restores our buffer */ - pdi->item.cchTextMax = savCchTextMax; - Free (pszTempBuf); + if (return_ansi && (pdi->hdr.code == LVN_GETDISPINFOA)) + { + strcpy((char*)ret_text, (char*)pdi->item.pszText); + } + else if (return_unicode && (pdi->hdr.code == LVN_GETDISPINFOW)) + { + strcpyW(ret_text, pdi->item.pszText); + } + else if (return_ansi) /* note : pointer can be changed by app ! */ + { + WideCharToMultiByte(CP_ACP, 0, pdi->item.pszText, -1, (LPSTR) ret_text, + ret_length, NULL, NULL); + } + else + MultiByteToWideChar(CP_ACP, 0, (LPSTR) pdi->item.pszText, -1, + ret_text, ret_length); + + pdi->item.pszText = ret_text; /* restores our buffer */ + pdi->item.cchTextMax = ret_length; + + Free(buffer); + return ret; } - return bResult; + + /* if dipsinfo holder changed notification code then convert */ + if (!isW && (pdi->hdr.code == LVN_GETDISPINFOW) && (pdi->item.mask & LVIF_TEXT)) + { + length = WideCharToMultiByte(CP_ACP, 0, pdi->item.pszText, -1, NULL, 0, NULL, NULL); + + buffer = Alloc(length * sizeof(CHAR)); + if (!buffer) return FALSE; + + WideCharToMultiByte(CP_ACP, 0, pdi->item.pszText, -1, (LPSTR) buffer, + ret_length, NULL, NULL); + + strcpy((LPSTR)pdi->item.pszText, (LPSTR)buffer); + Free(buffer); + } + + return ret; } static void customdraw_fill(NMLVCUSTOMDRAW *lpnmlvcd, const LISTVIEW_INFO *infoPtr, HDC hdc, @@ -1789,8 +1813,6 @@ static INT LISTVIEW_ProcessLetterKeys(LISTVIEW_INFO *infoPtr, WPARAM charCode, L infoPtr->charCode = charCode; infoPtr->szSearchParam[0] = charCode; infoPtr->nSearchParamLength = 1; - /* redundant with the 1 char string */ - charCode = 0; } /* and search from the current position */ @@ -1855,8 +1877,9 @@ static INT LISTVIEW_ProcessLetterKeys(LISTVIEW_INFO *infoPtr, WPARAM charCode, L } } - /* found something or second search completed with any result */ - if (nItem != -1 || endidx != infoPtr->nItemCount) + if ( nItem != -1 || /* found something */ + endidx != infoPtr->nItemCount || /* second search done */ + (startidx == 0 && endidx == infoPtr->nItemCount) /* full range for first search */ ) break; }; } @@ -2325,7 +2348,7 @@ static void LISTVIEW_GetItemMetrics(const LISTVIEW_INFO *infoPtr, const LVITEMW /* we need the text in non owner draw mode */ assert(lpLVItem->mask & LVIF_TEXT); - if (is_textT(lpLVItem->pszText, TRUE)) + if (is_text(lpLVItem->pszText)) { HFONT hFont = infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont; HDC hdc = GetDC(infoPtr->hwndSelf); @@ -3231,7 +3254,7 @@ static BOOL ranges_del(RANGES ranges, RANGE range) /* case 5: fully internal */ else { - RANGE tmprgn = *chkrgn, *newrgn; + RANGE *newrgn; if (!(newrgn = Alloc(sizeof(RANGE)))) goto fail; newrgn->lower = chkrgn->lower; @@ -3242,7 +3265,6 @@ static BOOL ranges_del(RANGES ranges, RANGE range) Free(newrgn); goto fail; } - chkrgn = &tmprgn; break; } @@ -3704,7 +3726,9 @@ static LRESULT LISTVIEW_MouseHover(LISTVIEW_INFO *infoPtr, INT x, INT y) * RETURN: * None. */ -static void LISTVIEW_MarqueeHighlight(LISTVIEW_INFO *infoPtr, LPPOINT coords_orig, LPPOINT coords_offs, LPPOINT offset, INT scroll) +static void LISTVIEW_MarqueeHighlight(LISTVIEW_INFO *infoPtr, const POINT *coords_orig, + const POINT *coords_offs, const POINT *offset, + INT scroll) { BOOL controlDown = FALSE; LVITEMW item; @@ -4318,7 +4342,7 @@ static BOOL LISTVIEW_SetItemT(LISTVIEW_INFO *infoPtr, LVITEMW *lpLVItem, BOOL is return FALSE; /* For efficiency, we transform the lpLVItem->pszText to Unicode here */ - if ((lpLVItem->mask & LVIF_TEXT) && is_textW(lpLVItem->pszText)) + if ((lpLVItem->mask & LVIF_TEXT) && is_text(lpLVItem->pszText)) { pszText = lpLVItem->pszText; lpLVItem->pszText = textdupTtoW(lpLVItem->pszText, isW); @@ -5060,8 +5084,6 @@ enddraw: static DWORD LISTVIEW_ApproximateViewRect(const LISTVIEW_INFO *infoPtr, INT nItemCount, WORD wWidth, WORD wHeight) { - INT nItemCountPerColumn = 1; - INT nColumnCount = 0; DWORD dwViewRect = 0; if (nItemCount == -1) @@ -5069,6 +5091,9 @@ static DWORD LISTVIEW_ApproximateViewRect(const LISTVIEW_INFO *infoPtr, INT nIte if (infoPtr->uView == LV_VIEW_LIST) { + INT nItemCountPerColumn = 1; + INT nColumnCount = 0; + if (wHeight == 0xFFFF) { /* use current height */ @@ -5129,9 +5154,6 @@ static DWORD LISTVIEW_ApproximateViewRect(const LISTVIEW_INFO *infoPtr, INT nIte nItemWidth = infoPtr->iconSpacing.cx; nItemHeight = infoPtr->iconSpacing.cy; - if (nItemCount == -1) - nItemCount = infoPtr->nItemCount; - if (wWidth == 0xffff) wWidth = infoPtr->rcList.right - infoPtr->rcList.left; @@ -5307,7 +5329,7 @@ static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr, BOOL destroy) for (j = 0; j < DPA_GetPtrCount(hdpaSubItems); j++) { hdrItem = DPA_GetPtr(hdpaSubItems, j); - if (is_textW(hdrItem->pszText)) Free(hdrItem->pszText); + if (is_text(hdrItem->pszText)) Free(hdrItem->pszText); Free(hdrItem); } DPA_Destroy(hdpaSubItems); @@ -5449,7 +5471,7 @@ static BOOL LISTVIEW_DeleteColumn(LISTVIEW_INFO *infoPtr, INT nColumn) if (nSubItem > 0) { /* free string */ - if (is_textW(lpDelItem->hdr.pszText)) + if (is_text(lpDelItem->hdr.pszText)) Free(lpDelItem->hdr.pszText); /* free item */ @@ -5598,7 +5620,7 @@ static BOOL LISTVIEW_DeleteItem(LISTVIEW_INFO *infoPtr, INT nItem) for (i = 0; i < DPA_GetPtrCount(hdpaSubItems); i++) { hdrItem = DPA_GetPtr(hdpaSubItems, i); - if (is_textW(hdrItem->pszText)) Free(hdrItem->pszText); + if (is_text(hdrItem->pszText)) Free(hdrItem->pszText); Free(hdrItem); } DPA_Destroy(hdpaSubItems); @@ -5843,7 +5865,7 @@ static HWND CreateEditLabelT(LISTVIEW_INFO *infoPtr, LPCWSTR text, BOOL isW) TRACE("(%p, text=%s, isW=%d)\n", infoPtr, debugtext_t(text, isW), isW); - /* Window will be resized and positioned after LVN_BEGINLABELEDIT */ + /* window will be resized and positioned after LVN_BEGINLABELEDIT */ if (isW) hedit = CreateWindowW(WC_EDITW, text, style, 0, 0, 0, 0, infoPtr->hwndSelf, 0, hinst, 0); else @@ -5875,21 +5897,21 @@ static HWND CreateEditLabelT(LISTVIEW_INFO *infoPtr, LPCWSTR text, BOOL isW) */ static HWND LISTVIEW_EditLabelT(LISTVIEW_INFO *infoPtr, INT nItem, BOOL isW) { - WCHAR szDispText[DISP_TEXT_SIZE] = { 0 }; + WCHAR disptextW[DISP_TEXT_SIZE] = { 0 }; + HWND hwndSelf = infoPtr->hwndSelf; NMLVDISPINFOW dispInfo; + HFONT hOldFont = NULL; + TEXTMETRICW tm; RECT rect; SIZE sz; - HWND hwndSelf = infoPtr->hwndSelf; HDC hdc; - HFONT hOldFont = NULL; - TEXTMETRICW textMetric; TRACE("(nItem=%d, isW=%d)\n", nItem, isW); if (~infoPtr->dwStyle & LVS_EDITLABELS) return 0; - /* Is the EditBox still there, if so remove it */ - if(infoPtr->hwndEdit != 0) + /* remove existing edit box */ + if (infoPtr->hwndEdit) { SetFocus(infoPtr->hwndSelf); infoPtr->hwndEdit = 0; @@ -5911,7 +5933,7 @@ static HWND LISTVIEW_EditLabelT(LISTVIEW_INFO *infoPtr, INT nItem, BOOL isW) dispInfo.item.iItem = nItem; dispInfo.item.iSubItem = 0; dispInfo.item.stateMask = ~0; - dispInfo.item.pszText = szDispText; + dispInfo.item.pszText = disptextW; dispInfo.item.cchTextMax = DISP_TEXT_SIZE; if (!LISTVIEW_GetItemT(infoPtr, &dispInfo.item, isW)) return 0; @@ -5927,27 +5949,36 @@ static HWND LISTVIEW_EditLabelT(LISTVIEW_INFO *infoPtr, INT nItem, BOOL isW) return 0; } - /* Now position and display edit box */ + TRACE("disp text=%s\n", debugtext_t(dispInfo.item.pszText, isW)); + + /* position and display edit box */ hdc = GetDC(infoPtr->hwndSelf); - /* Select the font to get appropriate metric dimensions */ - if(infoPtr->hFont != 0) + /* select the font to get appropriate metric dimensions */ + if (infoPtr->hFont) hOldFont = SelectObject(hdc, infoPtr->hFont); - /* Get String Length in pixels */ - GetTextExtentPoint32W(hdc, dispInfo.item.pszText, lstrlenW(dispInfo.item.pszText), &sz); + /* use real edit box content, it could be altered during LVN_BEGINLABELEDIT notification */ + GetWindowTextW(infoPtr->hwndEdit, disptextW, DISP_TEXT_SIZE); + TRACE("edit box text=%s\n", debugstr_w(disptextW)); - /* Add Extra spacing for the next character */ - GetTextMetricsW(hdc, &textMetric); - sz.cx += (textMetric.tmMaxCharWidth * 2); + /* get string length in pixels */ + GetTextExtentPoint32W(hdc, disptextW, lstrlenW(disptextW), &sz); - if(infoPtr->hFont != 0) + /* add extra spacing for the next character */ + GetTextMetricsW(hdc, &tm); + sz.cx += tm.tmMaxCharWidth * 2; + + if (infoPtr->hFont) SelectObject(hdc, hOldFont); ReleaseDC(infoPtr->hwndSelf, hdc); - MoveWindow(infoPtr->hwndEdit, rect.left - 2, rect.top - 1, sz.cx, - rect.bottom - rect.top + 2, FALSE); + sz.cy = rect.bottom - rect.top + 2; + rect.left -= 2; + rect.top -= 1; + TRACE("moving edit=(%d,%d)-(%d,%d)\n", rect.left, rect.top, sz.cx, sz.cy); + MoveWindow(infoPtr->hwndEdit, rect.left, rect.top, sz.cx, sz.cy, FALSE); ShowWindow(infoPtr->hwndEdit, SW_NORMAL); SetFocus(infoPtr->hwndEdit); SendMessageW(infoPtr->hwndEdit, EM_SETSEL, 0, -1); @@ -6029,14 +6060,14 @@ static BOOL LISTVIEW_EnsureVisible(LISTVIEW_INFO *infoPtr, INT nItem, BOOL bPart { INT diff = nHorzDiff / nScrollPosWidth; if (nHorzDiff % nScrollPosWidth) diff += nHorzAdjust; - LISTVIEW_HScroll(infoPtr, SB_INTERNAL, diff, 0); + LISTVIEW_HScroll(infoPtr, SB_INTERNAL, diff); } if (nScrollPosHeight) { INT diff = nVertDiff / nScrollPosHeight; if (nVertDiff % nScrollPosHeight) diff += nVertAdjust; - LISTVIEW_VScroll(infoPtr, SB_INTERNAL, diff, 0); + LISTVIEW_VScroll(infoPtr, SB_INTERNAL, diff); } return TRUE; @@ -6077,7 +6108,7 @@ static INT LISTVIEW_FindItemW(const LISTVIEW_INFO *infoPtr, INT nStart, } if (!lpFindInfo || nItem < 0) return -1; - + lvItem.mask = 0; if (lpFindInfo->flags & (LVFI_STRING | LVFI_PARTIAL) || lpFindInfo->flags & LVFI_SUBSTRING) @@ -6214,24 +6245,6 @@ static INT LISTVIEW_FindItemA(const LISTVIEW_INFO *infoPtr, INT nStart, return res; } -/*** - * DESCRIPTION: - * Retrieves the background image of the listview control. - * - * PARAMETER(S): - * [I] infoPtr : valid pointer to the listview structure - * [O] lpBkImage : background image attributes - * - * RETURN: - * SUCCESS : TRUE - * FAILURE : FALSE - */ -/* static BOOL LISTVIEW_GetBkImage(const LISTVIEW_INFO *infoPtr, LPLVBKIMAGE lpBkImage) */ -/* { */ -/* FIXME (listview, "empty stub!\n"); */ -/* return FALSE; */ -/* } */ - /*** * DESCRIPTION: * Retrieves column attributes. @@ -6454,6 +6467,7 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, return FALSE; if (lpLVItem->mask == 0) return TRUE; + TRACE("mask=%x\n", lpLVItem->mask); /* make a local copy */ isubitem = lpLVItem->iSubItem; @@ -6502,7 +6516,7 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, if (lpLVItem->mask & LVIF_STATE) dispInfo.item.stateMask = lpLVItem->stateMask & infoPtr->uCallbackMask; /* could be zeroed on LVIF_NORECOMPUTE case */ - if (dispInfo.item.mask != 0) + if (dispInfo.item.mask) { notify_dispinfoT(infoPtr, LVN_GETDISPINFOW, &dispInfo, isW); dispInfo.item.stateMask = lpLVItem->stateMask; @@ -6598,7 +6612,7 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, /* Apps depend on calling back for text if it is NULL or LPSTR_TEXTCALLBACKW */ if ((lpLVItem->mask & LVIF_TEXT) && !(lpLVItem->mask & LVIF_NORECOMPUTE) && - !is_textW(pItemHdr->pszText)) + !is_text(pItemHdr->pszText)) { dispInfo.item.mask |= LVIF_TEXT; dispInfo.item.pszText = lpLVItem->pszText; @@ -6608,7 +6622,7 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, } /* If we don't have all the requested info, query the application */ - if (dispInfo.item.mask != 0) + if (dispInfo.item.mask) { dispInfo.item.iItem = lpLVItem->iItem; dispInfo.item.iSubItem = lpLVItem->iSubItem; /* yes: the original subitem */ @@ -6646,7 +6660,7 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, else if (lpLVItem->mask & LVIF_TEXT) { /* if LVN_GETDISPINFO's disabled with LVIF_NORECOMPUTE return callback placeholder */ - if (isW || !is_textW(pItemHdr->pszText)) lpLVItem->pszText = pItemHdr->pszText; + if (isW || !is_text(pItemHdr->pszText)) lpLVItem->pszText = pItemHdr->pszText; else textcpynT(lpLVItem->pszText, isW, pItemHdr->pszText, TRUE, lpLVItem->cchTextMax); } @@ -7353,7 +7367,7 @@ static INT LISTVIEW_GetStringWidthT(const LISTVIEW_INFO *infoPtr, LPCWSTR lpszTe SIZE stringSize; stringSize.cx = 0; - if (is_textT(lpszText, isW)) + if (is_text(lpszText)) { HFONT hFont = infoPtr->hFont ? infoPtr->hFont : infoPtr->hDefaultFont; HDC hdc = GetDC(infoPtr->hwndSelf); @@ -7818,8 +7832,8 @@ static BOOL LISTVIEW_Scroll(LISTVIEW_INFO *infoPtr, INT dx, INT dy) break; } - if (dx != 0) LISTVIEW_HScroll(infoPtr, SB_INTERNAL, dx, 0); - if (dy != 0) LISTVIEW_VScroll(infoPtr, SB_INTERNAL, dy, 0); + if (dx != 0) LISTVIEW_HScroll(infoPtr, SB_INTERNAL, dx); + if (dy != 0) LISTVIEW_VScroll(infoPtr, SB_INTERNAL, dy); return TRUE; } @@ -8677,7 +8691,7 @@ static BOOL LISTVIEW_SetItemCount(LISTVIEW_INFO *infoPtr, INT nItems, DWORD dwFl * SUCCESS : TRUE * FAILURE : FALSE */ -static BOOL LISTVIEW_SetItemPosition(LISTVIEW_INFO *infoPtr, INT nItem, POINT *pt) +static BOOL LISTVIEW_SetItemPosition(LISTVIEW_INFO *infoPtr, INT nItem, const POINT *pt) { POINT Origin, Pt; @@ -8883,10 +8897,10 @@ static HWND LISTVIEW_SetToolTips( LISTVIEW_INFO *infoPtr, HWND hwndNewToolTip) * RETURN: * Old Unicode Format */ -static BOOL LISTVIEW_SetUnicodeFormat( LISTVIEW_INFO *infoPtr, BOOL fUnicode) +static BOOL LISTVIEW_SetUnicodeFormat( LISTVIEW_INFO *infoPtr, BOOL unicode) { SHORT rc = infoPtr->notifyFormat; - infoPtr->notifyFormat = (fUnicode) ? NFR_UNICODE : NFR_ANSI; + infoPtr->notifyFormat = (unicode) ? NFR_UNICODE : NFR_ANSI; return rc == NFR_UNICODE; } @@ -9304,6 +9318,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs) (WPARAM)infoPtr->hwndSelf, NF_QUERY); /* on error defaulting to ANSI notifications */ if (infoPtr->notifyFormat == 0) infoPtr->notifyFormat = NFR_ANSI; + TRACE("notify format=%d\n", infoPtr->notifyFormat); if ((infoPtr->uView == LV_VIEW_DETAILS) && (lpcs->style & WS_VISIBLE)) { @@ -9452,7 +9467,7 @@ static void scroll_list(LISTVIEW_INFO *infoPtr, INT dx, INT dy) * */ static LRESULT LISTVIEW_VScroll(LISTVIEW_INFO *infoPtr, INT nScrollCode, - INT nScrollDiff, HWND hScrollWnd) + INT nScrollDiff) { INT nOldScrollPos, nNewScrollPos; SCROLLINFO scrollInfo; @@ -9556,7 +9571,7 @@ static LRESULT LISTVIEW_VScroll(LISTVIEW_INFO *infoPtr, INT nScrollCode, * */ static LRESULT LISTVIEW_HScroll(LISTVIEW_INFO *infoPtr, INT nScrollCode, - INT nScrollDiff, HWND hScrollWnd) + INT nScrollDiff) { INT nOldScrollPos, nNewScrollPos; SCROLLINFO scrollInfo; @@ -9657,7 +9672,7 @@ static LRESULT LISTVIEW_MouseWheel(LISTVIEW_INFO *infoPtr, INT wheelDelta) * should be fixed in the future. */ LISTVIEW_VScroll(infoPtr, SB_INTERNAL, (gcWheelDelta < 0) ? - -LISTVIEW_SCROLL_ICON_LINE_SIZE : LISTVIEW_SCROLL_ICON_LINE_SIZE, 0); + -LISTVIEW_SCROLL_ICON_LINE_SIZE : LISTVIEW_SCROLL_ICON_LINE_SIZE); break; case LV_VIEW_DETAILS: @@ -9665,12 +9680,12 @@ static LRESULT LISTVIEW_MouseWheel(LISTVIEW_INFO *infoPtr, INT wheelDelta) { int cLineScroll = min(LISTVIEW_GetCountPerColumn(infoPtr), pulScrollLines); cLineScroll *= (gcWheelDelta / WHEEL_DELTA); - LISTVIEW_VScroll(infoPtr, SB_INTERNAL, cLineScroll, 0); + LISTVIEW_VScroll(infoPtr, SB_INTERNAL, cLineScroll); } break; case LV_VIEW_LIST: - LISTVIEW_HScroll(infoPtr, (gcWheelDelta < 0) ? SB_LINELEFT : SB_LINERIGHT, 0, 0); + LISTVIEW_HScroll(infoPtr, (gcWheelDelta < 0) ? SB_LINELEFT : SB_LINERIGHT, 0); break; } return 0; @@ -9845,7 +9860,7 @@ static LRESULT LISTVIEW_LButtonDblClk(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, { LVHITTESTINFO htInfo; - TRACE("(key=%hu, X=%hu, Y=%hu)\n", wKey, x, y); + TRACE("(key=%hu, X=%u, Y=%u)\n", wKey, x, y); /* Cancel the item edition if any */ if (infoPtr->itemEdit.fEnabled) @@ -9889,7 +9904,7 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN POINT pt = { x, y }; INT nItem; - TRACE("(key=%hu, X=%hu, Y=%hu)\n", wKey, x, y); + TRACE("(key=%hu, X=%u, Y=%u)\n", wKey, x, y); /* send NM_RELEASEDCAPTURE notification */ if (!notify(infoPtr, NM_RELEASEDCAPTURE)) return 0; @@ -10005,7 +10020,7 @@ static LRESULT LISTVIEW_LButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT { LVHITTESTINFO lvHitTestInfo; - TRACE("(key=%hu, X=%hu, Y=%hu)\n", wKey, x, y); + TRACE("(key=%hu, X=%u, Y=%u)\n", wKey, x, y); if (!infoPtr->bLButtonDown) return 0; @@ -10114,26 +10129,32 @@ static LRESULT LISTVIEW_NCDestroy(LISTVIEW_INFO *infoPtr) /*** * DESCRIPTION: - * Handles notifications from header. + * Handles notifications. * * PARAMETER(S): * [I] infoPtr : valid pointer to the listview structure - * [I] nCtrlId : control identifier - * [I] lpnmh : notification information + * [I] lpnmhdr : notification information * * RETURN: * Zero */ -static LRESULT LISTVIEW_HeaderNotification(LISTVIEW_INFO *infoPtr, const NMHEADERW *lpnmh) +static LRESULT LISTVIEW_Notify(LISTVIEW_INFO *infoPtr, const NMHDR *lpnmhdr) { HWND hwndSelf = infoPtr->hwndSelf; + const NMHEADERW *lpnmh; - TRACE("(lpnmh=%p)\n", lpnmh); + TRACE("(lpnmhdr=%p)\n", lpnmhdr); - if (!lpnmh || lpnmh->iItem < 0 || lpnmh->iItem >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return 0; - - switch (lpnmh->hdr.code) - { + if (!lpnmhdr || lpnmhdr->hwndFrom != infoPtr->hwndHeader) return 0; + + /* remember: HDN_LAST < HDN_FIRST */ + if (lpnmhdr->code > HDN_FIRST || lpnmhdr->code < HDN_LAST) return 0; + lpnmh = (const NMHEADERW *)lpnmhdr; + + if (lpnmh->iItem < 0 || lpnmh->iItem >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return 0; + + switch (lpnmhdr->code) + { case HDN_TRACKW: case HDN_TRACKA: { @@ -10465,7 +10486,7 @@ static LRESULT LISTVIEW_RButtonDblClk(const LISTVIEW_INFO *infoPtr, WORD wKey, I { LVHITTESTINFO lvHitTestInfo; - TRACE("(key=%hu,X=%hu,Y=%hu)\n", wKey, x, y); + TRACE("(key=%hu,X=%u,Y=%u)\n", wKey, x, y); /* send NM_RELEASEDCAPTURE notification */ if (!notify(infoPtr, NM_RELEASEDCAPTURE)) return 0; @@ -10496,7 +10517,7 @@ static LRESULT LISTVIEW_RButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN LVHITTESTINFO lvHitTestInfo; INT nItem; - TRACE("(key=%hu,X=%hu,Y=%hu)\n", wKey, x, y); + TRACE("(key=%hu,X=%u,Y=%u)\n", wKey, x, y); /* send NM_RELEASEDCAPTURE notification */ if (!notify(infoPtr, NM_RELEASEDCAPTURE)) return 0; @@ -10544,7 +10565,7 @@ static LRESULT LISTVIEW_RButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT LVHITTESTINFO lvHitTestInfo; POINT pt; - TRACE("(key=%hu,X=%hu,Y=%hu)\n", wKey, x, y); + TRACE("(key=%hu,X=%u,Y=%u)\n", wKey, x, y); if (!infoPtr->bRButtonDown) return 0; @@ -11411,7 +11432,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return (LRESULT)infoPtr->hFont; case WM_HSCROLL: - return LISTVIEW_HScroll(infoPtr, (INT)LOWORD(wParam), 0, (HWND)lParam); + return LISTVIEW_HScroll(infoPtr, (INT)LOWORD(wParam), 0); case WM_KEYDOWN: return LISTVIEW_KeyDown(infoPtr, (INT)wParam, (LONG)lParam); @@ -11441,9 +11462,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return LISTVIEW_NCPaint(infoPtr, (HRGN)wParam); case WM_NOTIFY: - if (lParam && ((LPNMHDR)lParam)->hwndFrom == infoPtr->hwndHeader) - return LISTVIEW_HeaderNotification(infoPtr, (LPNMHEADERW)lParam); - else return 0; + return LISTVIEW_Notify(infoPtr, (LPNMHDR)lParam); case WM_NOTIFYFORMAT: return LISTVIEW_NotifyFormat(infoPtr, (HWND)wParam, (INT)lParam); @@ -11496,7 +11515,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return LISTVIEW_ThemeChanged(infoPtr); case WM_VSCROLL: - return LISTVIEW_VScroll(infoPtr, (INT)LOWORD(wParam), 0, (HWND)lParam); + return LISTVIEW_VScroll(infoPtr, (INT)LOWORD(wParam), 0); case WM_MOUSEWHEEL: if (wParam & (MK_SHIFT | MK_CONTROL)) diff --git a/reactos/dll/win32/comctl32/monthcal.c b/reactos/dll/win32/comctl32/monthcal.c index ded407eca10..1cc64dbd524 100644 --- a/reactos/dll/win32/comctl32/monthcal.c +++ b/reactos/dll/win32/comctl32/monthcal.c @@ -94,12 +94,9 @@ typedef struct { HWND hwndSelf; DWORD dwStyle; /* cached GWL_STYLE */ - COLORREF bk; - COLORREF txt; - COLORREF titlebk; - COLORREF titletxt; - COLORREF monthbk; - COLORREF trailingtxt; + + COLORREF colors[MCSC_TRAILINGTEXT+1]; + HFONT hFont; HFONT hBoldFont; int textHeight; @@ -122,9 +119,8 @@ typedef struct int status; /* See MC_SEL flags */ SYSTEMTIME firstSel; /* first selected day */ INT maxSelCount; - SYSTEMTIME minSel; + SYSTEMTIME minSel; /* contains single selection when used without MCS_MULTISELECT */ SYSTEMTIME maxSel; - SYSTEMTIME curSel; /* contains currently selected year, month and day */ SYSTEMTIME focusedSel; /* date currently focused with mouse movement */ DWORD rangeValid; SYSTEMTIME minDate; @@ -150,8 +146,12 @@ static const SYSTEMTIME st_null; static const SYSTEMTIME max_allowed_date = { .wYear = 9999, .wMonth = 12, .wDay = 31 }; static const SYSTEMTIME min_allowed_date = { .wYear = 1752, .wMonth = 9, .wDay = 14 }; - -#define MONTHCAL_GetInfoPtr(hwnd) ((MONTHCAL_INFO *)GetWindowLongPtrW(hwnd, 0)) +/* Prev/Next buttons */ +enum nav_direction +{ + DIRECTION_BACKWARD, + DIRECTION_FORWARD +}; /* helper functions */ @@ -449,26 +449,29 @@ int MONTHCAL_CalculateDayOfWeek(SYSTEMTIME *date, BOOL inplace) return st.wDayOfWeek; } +/* add/substract 'months' from date */ +static inline void MONTHCAL_GetMonth(SYSTEMTIME *date, INT months) +{ + INT length, m = date->wMonth + months; + + date->wYear += m > 0 ? (m - 1) / 12 : m / 12 - 1; + date->wMonth = m > 0 ? (m - 1) % 12 + 1 : 12 + m % 12; + /* fix moving from last day in a month */ + length = MONTHCAL_MonthLength(date->wMonth, date->wYear); + if(date->wDay > length) date->wDay = length; + MONTHCAL_CalculateDayOfWeek(date, TRUE); +} + /* properly updates date to point on next month */ static inline void MONTHCAL_GetNextMonth(SYSTEMTIME *date) { - if(++date->wMonth > 12) - { - date->wMonth = 1; - date->wYear++; - } - MONTHCAL_CalculateDayOfWeek(date, TRUE); + return MONTHCAL_GetMonth(date, 1); } /* properly updates date to point on prev month */ static inline void MONTHCAL_GetPrevMonth(SYSTEMTIME *date) { - if(--date->wMonth < 1) - { - date->wMonth = 12; - date->wYear--; - } - MONTHCAL_CalculateDayOfWeek(date, TRUE); + return MONTHCAL_GetMonth(date, -1); } /* Returns full date for a first currently visible day */ @@ -520,7 +523,7 @@ static int MONTHCAL_CalcDayFromPos(const MONTHCAL_INFO *infoPtr, int x, int y, { int retval, firstDay; RECT rcClient; - SYSTEMTIME st = infoPtr->curSel; + SYSTEMTIME st = infoPtr->minSel; GetClientRect(infoPtr->hwndSelf, &rcClient); @@ -548,20 +551,20 @@ static int MONTHCAL_CalcDayFromPos(const MONTHCAL_INFO *infoPtr, int x, int y, * [O] y : week column (zero based) */ static void MONTHCAL_CalcDayXY(const MONTHCAL_INFO *infoPtr, - const SYSTEMTIME *date, int *x, int *y) + const SYSTEMTIME *date, INT *x, INT *y) { - SYSTEMTIME st = infoPtr->curSel; + SYSTEMTIME st = infoPtr->minSel; LONG cmp; int first; st.wDay = 1; first = (MONTHCAL_CalculateDayOfWeek(&st, FALSE) + 6 - infoPtr->firstDay) % 7; - cmp = MONTHCAL_CompareMonths(date, &infoPtr->curSel); + cmp = MONTHCAL_CompareMonths(date, &infoPtr->minSel); /* previous month */ if(cmp == -1) { - *x = (first - MONTHCAL_MonthLength(date->wMonth, infoPtr->curSel.wYear) + date->wDay) % 7; + *x = (first - MONTHCAL_MonthLength(date->wMonth, infoPtr->minSel.wYear) + date->wDay) % 7; *y = 0; return; } @@ -569,7 +572,7 @@ static void MONTHCAL_CalcDayXY(const MONTHCAL_INFO *infoPtr, /* next month calculation is same as for current, just add current month length */ if(cmp == 1) { - first += MONTHCAL_MonthLength(infoPtr->curSel.wMonth, infoPtr->curSel.wYear); + first += MONTHCAL_MonthLength(infoPtr->minSel.wMonth, infoPtr->minSel.wYear); } *x = (date->wDay + first) % 7; @@ -681,8 +684,8 @@ static void MONTHCAL_DrawDay(const MONTHCAL_INFO *infoPtr, HDC hdc, const SYSTEM TRACE("%d %d %d\n", st->wDay, infoPtr->minSel.wDay, infoPtr->maxSel.wDay); TRACE("%s\n", wine_dbgstr_rect(&r)); - oldCol = SetTextColor(hdc, infoPtr->monthbk); - oldBk = SetBkColor(hdc, infoPtr->trailingtxt); + oldCol = SetTextColor(hdc, infoPtr->colors[MCSC_MONTHBK]); + oldBk = SetBkColor(hdc, infoPtr->colors[MCSC_TRAILINGTEXT]); hbr = GetSysColorBrush(COLOR_HIGHLIGHT); FillRect(hdc, &r, hbr); @@ -709,12 +712,12 @@ static void MONTHCAL_DrawDay(const MONTHCAL_INFO *infoPtr, HDC hdc, const SYSTEM } -static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, BOOL btnNext) +static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, enum nav_direction button) { HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); - RECT *r = btnNext ? &infoPtr->titlebtnnext : &infoPtr->titlebtnprev; - BOOL pressed = btnNext ? (infoPtr->status & MC_NEXTPRESSED) : - (infoPtr->status & MC_PREVPRESSED); + RECT *r = button == DIRECTION_FORWARD ? &infoPtr->titlebtnnext : &infoPtr->titlebtnprev; + BOOL pressed = button == DIRECTION_FORWARD ? infoPtr->status & MC_NEXTPRESSED : + infoPtr->status & MC_PREVPRESSED; if (theme) { static const int states[] = { @@ -723,7 +726,7 @@ static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, BOOL btnNext) /* Next button */ ABS_RIGHTNORMAL, ABS_RIGHTPRESSED, ABS_RIGHTDISABLED }; - int stateNum = btnNext ? 3 : 0; + int stateNum = button == DIRECTION_FORWARD ? 3 : 0; if (pressed) stateNum += 1; else @@ -734,7 +737,7 @@ static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, BOOL btnNext) } else { - int style = btnNext ? DFCS_SCROLLRIGHT : DFCS_SCROLLLEFT; + int style = button == DIRECTION_FORWARD ? DFCS_SCROLLRIGHT : DFCS_SCROLLLEFT; if (pressed) style |= DFCS_PUSHED; else @@ -750,24 +753,25 @@ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRU { static const WCHAR fmt_monthW[] = { '%','s',' ','%','l','d',0 }; RECT *title = &infoPtr->calendars[calIdx].title; + const SYSTEMTIME *st = &infoPtr->calendars[calIdx].month; WCHAR buf_month[80], buf_fmt[80]; HBRUSH hbr; SIZE sz; /* fill header box */ - hbr = CreateSolidBrush(infoPtr->titlebk); + hbr = CreateSolidBrush(infoPtr->colors[MCSC_TITLEBK]); FillRect(hdc, title, hbr); DeleteObject(hbr); /* month/year string */ - SetBkColor(hdc, infoPtr->titlebk); - SetTextColor(hdc, infoPtr->titletxt); + SetBkColor(hdc, infoPtr->colors[MCSC_TITLEBK]); + SetTextColor(hdc, infoPtr->colors[MCSC_TITLETEXT]); SelectObject(hdc, infoPtr->hBoldFont); - GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1+infoPtr->curSel.wMonth-1, + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1 + st->wMonth - 1, buf_month, countof(buf_month)); - wsprintfW(buf_fmt, fmt_monthW, buf_month, infoPtr->curSel.wYear); + wsprintfW(buf_fmt, fmt_monthW, buf_month, st->wYear); DrawTextW(hdc, buf_fmt, strlenW(buf_fmt), title, DT_CENTER | DT_VCENTER | DT_SINGLELINE); @@ -783,20 +787,22 @@ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRU static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps, INT calIdx) { + const SYSTEMTIME *date = &infoPtr->calendars[calIdx].month; static const WCHAR fmt_weekW[] = { '%','d',0 }; INT mindays, weeknum, weeknum1, startofprescal; - SYSTEMTIME st = infoPtr->curSel; - RECT r; - WCHAR buf[80]; INT i, prev_month; + SYSTEMTIME st; + WCHAR buf[80]; + HBRUSH hbr; + RECT r; if (!(infoPtr->dwStyle & MCS_WEEKNUMBERS)) return; MONTHCAL_GetMinDate(infoPtr, &st); startofprescal = st.wDay; - st = infoPtr->curSel; + st = *date; - prev_month = infoPtr->curSel.wMonth - 1; + prev_month = date->wMonth - 1; if(prev_month == 0) prev_month = 12; /* @@ -823,7 +829,7 @@ static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, con mindays = 0; } - if (infoPtr->curSel.wMonth == 1) + if (date->wMonth == 1) { /* calculate all those exceptions for january */ st.wDay = st.wMonth = 1; @@ -834,7 +840,7 @@ static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, con { weeknum = 0; for(i = 0; i < 11; i++) - weeknum += MONTHCAL_MonthLength(i+1, infoPtr->curSel.wYear - 1); + weeknum += MONTHCAL_MonthLength(i+1, date->wYear - 1); weeknum += startofprescal + 7; weeknum /= 7; @@ -847,7 +853,7 @@ static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, con { weeknum = 0; for(i = 0; i < prev_month - 1; i++) - weeknum += MONTHCAL_MonthLength(i+1, infoPtr->curSel.wYear); + weeknum += MONTHCAL_MonthLength(i+1, date->wYear); weeknum += startofprescal + 7; weeknum /= 7; @@ -857,6 +863,13 @@ static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, con } r = infoPtr->calendars[calIdx].weeknums; + + /* erase whole week numbers area */ + hbr = CreateSolidBrush(infoPtr->colors[MCSC_MONTHBK]); + FillRect(hdc, &r, hbr); + DeleteObject(hbr); + + /* reduce rectangle to one week number */ r.bottom = r.top + infoPtr->height_increment; for(i = 0; i < 6; i++) { @@ -919,8 +932,8 @@ static void MONTHCAL_PaintTodayTitle(const MONTHCAL_INFO *infoPtr, HDC hdc, cons /* today mark + focus */ static void MONTHCAL_PaintFocusAndCircle(const MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps) { - if((infoPtr->curSel.wMonth == infoPtr->todaysDate.wMonth) && - (infoPtr->curSel.wYear == infoPtr->todaysDate.wYear) && + if((infoPtr->minSel.wMonth == infoPtr->todaysDate.wMonth) && + (infoPtr->minSel.wYear == infoPtr->todaysDate.wYear) && !(infoPtr->dwStyle & MCS_NOTODAYCIRCLE)) { MONTHCAL_CircleDay(infoPtr, hdc, &infoPtr->todaysDate); @@ -937,19 +950,20 @@ static void MONTHCAL_PaintFocusAndCircle(const MONTHCAL_INFO *infoPtr, HDC hdc, /* paint a calendar area */ static void MONTHCAL_PaintCalendar(const MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps, INT calIdx) { - INT prev_month, i, j; + const SYSTEMTIME *date = &infoPtr->calendars[calIdx].month; + INT prev_month, i, j, length; + RECT r, fill_bk_rect; + SYSTEMTIME st; WCHAR buf[80]; HBRUSH hbr; - RECT r, fill_bk_rect; int mask; - SYSTEMTIME st; /* fill whole days area - from week days area to today note rectangle */ fill_bk_rect = infoPtr->calendars[calIdx].wdays; fill_bk_rect.bottom = infoPtr->calendars[calIdx].days.bottom + (infoPtr->todayrect.bottom - infoPtr->todayrect.top); - hbr = CreateSolidBrush(infoPtr->monthbk); + hbr = CreateSolidBrush(infoPtr->colors[MCSC_MONTHBK]); FillRect(hdc, &fill_bk_rect, hbr); DeleteObject(hbr); @@ -959,7 +973,7 @@ static void MONTHCAL_PaintCalendar(const MONTHCAL_INFO *infoPtr, HDC hdc, const LineTo(hdc, infoPtr->calendars[calIdx].days.right - 3, infoPtr->calendars[calIdx].title.bottom + infoPtr->textHeight + 1); - prev_month = infoPtr->curSel.wMonth - 1; + prev_month = date->wMonth - 1; if (prev_month == 0) prev_month = 12; infoPtr->calendars[calIdx].wdays.left = infoPtr->calendars[calIdx].days.left = @@ -967,8 +981,8 @@ static void MONTHCAL_PaintCalendar(const MONTHCAL_INFO *infoPtr, HDC hdc, const /* 1. draw day abbreviations */ SelectObject(hdc, infoPtr->hFont); - SetBkColor(hdc, infoPtr->monthbk); - SetTextColor(hdc, infoPtr->trailingtxt); + SetBkColor(hdc, infoPtr->colors[MCSC_MONTHBK]); + SetTextColor(hdc, infoPtr->colors[MCSC_TRAILINGTEXT]); /* rectangle to draw a single day abbreviation within */ r = infoPtr->calendars[calIdx].wdays; r.right = r.left + infoPtr->width_increment; @@ -985,15 +999,16 @@ static void MONTHCAL_PaintCalendar(const MONTHCAL_INFO *infoPtr, HDC hdc, const { SYSTEMTIME st_max; - SetTextColor(hdc, infoPtr->trailingtxt); + SetTextColor(hdc, infoPtr->colors[MCSC_TRAILINGTEXT]); /* draw prev month */ if (calIdx == 0) { MONTHCAL_GetMinDate(infoPtr, &st); mask = 1 << (st.wDay-1); + length = MONTHCAL_MonthLength(prev_month, date->wYear); - while(st.wDay <= MONTHCAL_MonthLength(prev_month, infoPtr->curSel.wYear)) + while(st.wDay <= length) { MONTHCAL_DrawDay(infoPtr, hdc, &st, infoPtr->monthdayState[0] & mask, ps); mask <<= 1; @@ -1004,7 +1019,7 @@ static void MONTHCAL_PaintCalendar(const MONTHCAL_INFO *infoPtr, HDC hdc, const /* draw next month */ if (calIdx == infoPtr->cal_num - 1) { - st = infoPtr->curSel; + st = *date; st.wDay = 1; MONTHCAL_GetNextMonth(&st); MONTHCAL_GetMaxDate(infoPtr, &st_max); @@ -1020,11 +1035,13 @@ static void MONTHCAL_PaintCalendar(const MONTHCAL_INFO *infoPtr, HDC hdc, const } /* 3. current month */ - SetTextColor(hdc, infoPtr->txt); - st = infoPtr->curSel; + SetTextColor(hdc, infoPtr->colors[MCSC_TEXT]); + st = *date; st.wDay = 1; mask = 1; - while(st.wDay <= MONTHCAL_MonthLength(infoPtr->curSel.wMonth, infoPtr->curSel.wYear)) { + length = MONTHCAL_MonthLength(date->wMonth, date->wYear); + while(st.wDay <= length) + { MONTHCAL_DrawDay(infoPtr, hdc, &st, infoPtr->monthdayState[1] & mask, ps); mask <<= 1; st.wDay++; @@ -1066,8 +1083,8 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT MONTHCAL_PaintTodayTitle(infoPtr, hdc, ps); /* navigation buttons */ - MONTHCAL_PaintButton(infoPtr, hdc, FALSE); - MONTHCAL_PaintButton(infoPtr, hdc, TRUE); + MONTHCAL_PaintButton(infoPtr, hdc, DIRECTION_BACKWARD); + MONTHCAL_PaintButton(infoPtr, hdc, DIRECTION_FORWARD); /* restore context */ SetBkColor(hdc, old_bk_clr); @@ -1076,91 +1093,51 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT } static LRESULT -MONTHCAL_GetMinReqRect(const MONTHCAL_INFO *infoPtr, LPRECT lpRect) +MONTHCAL_GetMinReqRect(const MONTHCAL_INFO *infoPtr, RECT *rect) { - TRACE("rect %p\n", lpRect); + TRACE("rect %p\n", rect); - if(!lpRect) return FALSE; + if(!rect) return FALSE; - lpRect->left = infoPtr->calendars[0].title.left; - lpRect->top = infoPtr->calendars[0].title.top; - lpRect->right = infoPtr->calendars[0].title.right; - lpRect->bottom = infoPtr->todayrect.bottom; + *rect = infoPtr->calendars[0].title; + rect->bottom = infoPtr->calendars[0].days.bottom + infoPtr->todayrect.bottom - + infoPtr->todayrect.top; - AdjustWindowRect(lpRect, infoPtr->dwStyle, FALSE); + AdjustWindowRect(rect, infoPtr->dwStyle, FALSE); /* minimal rectangle is zero based */ - OffsetRect(lpRect, -lpRect->left, -lpRect->top); + OffsetRect(rect, -rect->left, -rect->top); - TRACE("%s\n", wine_dbgstr_rect(lpRect)); + TRACE("%s\n", wine_dbgstr_rect(rect)); return TRUE; } - -static LRESULT -MONTHCAL_GetColor(const MONTHCAL_INFO *infoPtr, INT index) +static COLORREF +MONTHCAL_GetColor(const MONTHCAL_INFO *infoPtr, UINT index) { - TRACE("\n"); + TRACE("%p, %d\n", infoPtr, index); - switch(index) { - case MCSC_BACKGROUND: - return infoPtr->bk; - case MCSC_TEXT: - return infoPtr->txt; - case MCSC_TITLEBK: - return infoPtr->titlebk; - case MCSC_TITLETEXT: - return infoPtr->titletxt; - case MCSC_MONTHBK: - return infoPtr->monthbk; - case MCSC_TRAILINGTEXT: - return infoPtr->trailingtxt; - } - - return -1; + if (index > MCSC_TRAILINGTEXT) return -1; + return infoPtr->colors[index]; } - static LRESULT -MONTHCAL_SetColor(MONTHCAL_INFO *infoPtr, INT index, COLORREF color) +MONTHCAL_SetColor(MONTHCAL_INFO *infoPtr, UINT index, COLORREF color) { - COLORREF prev = -1; + COLORREF prev; - TRACE("%d: color %08x\n", index, color); + TRACE("%p, %d: color %08x\n", infoPtr, index, color); - switch(index) { - case MCSC_BACKGROUND: - prev = infoPtr->bk; - infoPtr->bk = color; - break; - case MCSC_TEXT: - prev = infoPtr->txt; - infoPtr->txt = color; - break; - case MCSC_TITLEBK: - prev = infoPtr->titlebk; - infoPtr->titlebk = color; - break; - case MCSC_TITLETEXT: - prev=infoPtr->titletxt; - infoPtr->titletxt = color; - break; - case MCSC_MONTHBK: - prev = infoPtr->monthbk; - infoPtr->monthbk = color; - break; - case MCSC_TRAILINGTEXT: - prev = infoPtr->trailingtxt; - infoPtr->trailingtxt = color; - break; - } + if (index > MCSC_TRAILINGTEXT) return -1; + + prev = infoPtr->colors[index]; + infoPtr->colors[index] = color; InvalidateRect(infoPtr->hwndSelf, NULL, index == MCSC_BACKGROUND ? TRUE : FALSE); return prev; } - static LRESULT MONTHCAL_GetMonthDelta(const MONTHCAL_INFO *infoPtr) { @@ -1399,7 +1376,7 @@ MONTHCAL_GetCurSel(const MONTHCAL_INFO *infoPtr, SYSTEMTIME *curSel) if(!curSel) return FALSE; if(infoPtr->dwStyle & MCS_MULTISELECT) return FALSE; - *curSel = infoPtr->curSel; + *curSel = infoPtr->minSel; TRACE("%d/%d/%d\n", curSel->wYear, curSel->wMonth, curSel->wDay); return TRUE; } @@ -1407,7 +1384,8 @@ MONTHCAL_GetCurSel(const MONTHCAL_INFO *infoPtr, SYSTEMTIME *curSel) static LRESULT MONTHCAL_SetCurSel(MONTHCAL_INFO *infoPtr, SYSTEMTIME *curSel) { - SYSTEMTIME prev = infoPtr->curSel; + SYSTEMTIME prev = infoPtr->minSel; + WORD day; TRACE("%p\n", curSel); if(!curSel) return FALSE; @@ -1415,21 +1393,23 @@ MONTHCAL_SetCurSel(MONTHCAL_INFO *infoPtr, SYSTEMTIME *curSel) if(!MONTHCAL_ValidateDate(curSel)) return FALSE; /* exit earlier if selection equals current */ - if (MONTHCAL_IsDateEqual(&infoPtr->curSel, curSel)) return TRUE; + if (MONTHCAL_IsDateEqual(&infoPtr->minSel, curSel)) return TRUE; if(!MONTHCAL_IsDateInValidRange(infoPtr, curSel, FALSE)) return FALSE; + infoPtr->calendars[0].month = *curSel; infoPtr->minSel = *curSel; infoPtr->maxSel = *curSel; /* if selection is still in current month, reduce rectangle */ + day = prev.wDay; prev.wDay = curSel->wDay; if (MONTHCAL_IsDateEqual(&prev, curSel)) { RECT r_prev, r_new; - /* note that infoPtr->curSel isn't updated yet */ - MONTHCAL_CalcPosFromDay(infoPtr, &infoPtr->curSel, &r_prev); + prev.wDay = day; + MONTHCAL_CalcPosFromDay(infoPtr, &prev, &r_prev); MONTHCAL_CalcPosFromDay(infoPtr, curSel, &r_new); InvalidateRect(infoPtr->hwndSelf, &r_prev, FALSE); @@ -1438,9 +1418,6 @@ MONTHCAL_SetCurSel(MONTHCAL_INFO *infoPtr, SYSTEMTIME *curSel) else InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); - infoPtr->curSel = *curSel; - infoPtr->calendars[0].month = *curSel; - return TRUE; } @@ -1519,13 +1496,11 @@ MONTHCAL_SetSelRange(MONTHCAL_INFO *infoPtr, SYSTEMTIME *range) infoPtr->minSel = range[1]; infoPtr->maxSel = range[0]; } - infoPtr->curSel = infoPtr->minSel; infoPtr->calendars[0].month = infoPtr->minSel; /* update day of week */ MONTHCAL_CalculateDayOfWeek(&infoPtr->minSel, TRUE); MONTHCAL_CalculateDayOfWeek(&infoPtr->maxSel, TRUE); - MONTHCAL_CalculateDayOfWeek(&infoPtr->curSel, TRUE); /* redraw if bounds changed */ /* FIXME: no actual need to redraw everything */ @@ -1612,10 +1587,22 @@ static INT MONTHCAL_GetCalendarFromPoint(const MONTHCAL_INFO *infoPtr, const POI return -1; } +static inline UINT fill_hittest_info(const MCHITTESTINFO *src, MCHITTESTINFO *dest) +{ + dest->uHit = src->uHit; + dest->st = src->st; + + if (dest->cbSize == sizeof(MCHITTESTINFO)) + memcpy(&dest->rc, &src->rc, sizeof(MCHITTESTINFO) - MCHITTESTINFO_V1_SIZE); + + return src->uHit; +} + static LRESULT MONTHCAL_HitTest(const MONTHCAL_INFO *infoPtr, MCHITTESTINFO *lpht) { INT day, wday, wnum, calIdx; + MCHITTESTINFO htinfo; SYSTEMTIME ht_month; UINT x, y; @@ -1624,7 +1611,11 @@ MONTHCAL_HitTest(const MONTHCAL_INFO *infoPtr, MCHITTESTINFO *lpht) x = lpht->pt.x; y = lpht->pt.y; - memset(&lpht->st, 0, sizeof(lpht->st)); + htinfo.st = st_null; + + /* we should preserve passed fields if hit area doesn't need them */ + if (lpht->cbSize == sizeof(MCHITTESTINFO)) + memcpy(&htinfo.rc, &lpht->rc, sizeof(MCHITTESTINFO) - MCHITTESTINFO_V1_SIZE); /* Comment in for debugging... TRACE("%d %d wd[%d %d %d %d] d[%d %d %d %d] t[%d %d %d %d] wn[%d %d %d %d]\n", x, y, @@ -1643,12 +1634,15 @@ MONTHCAL_HitTest(const MONTHCAL_INFO *infoPtr, MCHITTESTINFO *lpht) if (calIdx == -1) { if (PtInRect(&infoPtr->todayrect, lpht->pt)) - lpht->uHit = MCHT_TODAYLINK; + { + htinfo.uHit = MCHT_TODAYLINK; + htinfo.rc = infoPtr->todayrect; + } else /* outside of calendar area? What's left must be background :-) */ - lpht->uHit = MCHT_CALENDARBK; + htinfo.uHit = MCHT_CALENDARBK; - return lpht->uHit; + return fill_hittest_info(&htinfo, lpht); } ht_month = infoPtr->calendars[calIdx].month; @@ -1659,85 +1653,101 @@ MONTHCAL_HitTest(const MONTHCAL_INFO *infoPtr, MCHITTESTINFO *lpht) two calendars have buttons */ if (calIdx == 0 && PtInRect(&infoPtr->titlebtnprev, lpht->pt)) { - lpht->uHit = MCHT_TITLEBTNPREV; + htinfo.uHit = MCHT_TITLEBTNPREV; + htinfo.rc = infoPtr->titlebtnprev; } else if (PtInRect(&infoPtr->titlebtnnext, lpht->pt)) { - lpht->uHit = MCHT_TITLEBTNNEXT; + htinfo.uHit = MCHT_TITLEBTNNEXT; + htinfo.rc = infoPtr->titlebtnnext; } else if (PtInRect(&infoPtr->calendars[calIdx].titlemonth, lpht->pt)) { - lpht->uHit = MCHT_TITLEMONTH; + htinfo.uHit = MCHT_TITLEMONTH; + htinfo.rc = infoPtr->calendars[calIdx].titlemonth; + htinfo.iOffset = calIdx; } else if (PtInRect(&infoPtr->calendars[calIdx].titleyear, lpht->pt)) { - lpht->uHit = MCHT_TITLEYEAR; + htinfo.uHit = MCHT_TITLEYEAR; + htinfo.rc = infoPtr->calendars[calIdx].titleyear; + htinfo.iOffset = calIdx; } else - lpht->uHit = MCHT_TITLE; + { + htinfo.uHit = MCHT_TITLE; + htinfo.rc = infoPtr->calendars[calIdx].title; + htinfo.iOffset = calIdx; + } - return lpht->uHit; + return fill_hittest_info(&htinfo, lpht); } /* days area (including week days and week numbers */ day = MONTHCAL_CalcDayFromPos(infoPtr, x, y, &wday, &wnum); if (PtInRect(&infoPtr->calendars[calIdx].wdays, lpht->pt)) { - lpht->uHit = MCHT_CALENDARDAY; - lpht->st.wYear = ht_month.wYear; - lpht->st.wMonth = (day < 1) ? ht_month.wMonth -1 : ht_month.wMonth; - lpht->st.wDay = (day < 1) ? + htinfo.uHit = MCHT_CALENDARDAY; + htinfo.iOffset = calIdx; + htinfo.st.wYear = ht_month.wYear; + htinfo.st.wMonth = (day < 1) ? ht_month.wMonth -1 : ht_month.wMonth; + htinfo.st.wDay = (day < 1) ? MONTHCAL_MonthLength(ht_month.wMonth-1, ht_month.wYear) - day : day; + + MONTHCAL_CalcDayXY(infoPtr, &htinfo.st, &htinfo.iCol, &htinfo.iRow); } else if(PtInRect(&infoPtr->calendars[calIdx].weeknums, lpht->pt)) { - lpht->uHit = MCHT_CALENDARWEEKNUM; - lpht->st.wYear = ht_month.wYear; + htinfo.uHit = MCHT_CALENDARWEEKNUM; + htinfo.st.wYear = ht_month.wYear; + htinfo.iOffset = calIdx; - if (day < 1) { - lpht->st.wMonth = ht_month.wMonth - 1; + if (day < 1) + { + htinfo.st.wMonth = ht_month.wMonth - 1; + htinfo.st.wDay = MONTHCAL_MonthLength(ht_month.wMonth-1, ht_month.wYear) - day; } - else if (day > MONTHCAL_MonthLength(ht_month.wMonth, ht_month.wYear)) { - lpht->st.wMonth = ht_month.wMonth + 1; + else if (day > MONTHCAL_MonthLength(ht_month.wMonth, ht_month.wYear)) + { + htinfo.st.wMonth = ht_month.wMonth + 1; + htinfo.st.wDay = day - MONTHCAL_MonthLength(ht_month.wMonth, ht_month.wYear); } else - lpht->st.wMonth = ht_month.wMonth; - - if (day < 1) { - lpht->st.wDay = MONTHCAL_MonthLength(ht_month.wMonth-1, ht_month.wYear) - day; + { + htinfo.st.wMonth = ht_month.wMonth; + htinfo.st.wDay = day; } - else if (day > MONTHCAL_MonthLength(ht_month.wMonth, ht_month.wYear)) { - lpht->st.wDay = day - MONTHCAL_MonthLength(ht_month.wMonth, ht_month.wYear); - } - else - lpht->st.wDay = day; } else if(PtInRect(&infoPtr->calendars[calIdx].days, lpht->pt)) { - lpht->st.wYear = ht_month.wYear; - lpht->st.wMonth = ht_month.wMonth; + htinfo.iOffset = calIdx; + htinfo.st.wYear = ht_month.wYear; + htinfo.st.wMonth = ht_month.wMonth; if (day < 1) { - lpht->uHit = MCHT_CALENDARDATEPREV; - MONTHCAL_GetPrevMonth(&lpht->st); - lpht->st.wDay = MONTHCAL_MonthLength(lpht->st.wMonth, lpht->st.wYear) + day; + htinfo.uHit = MCHT_CALENDARDATEPREV; + MONTHCAL_GetPrevMonth(&htinfo.st); + htinfo.st.wDay = MONTHCAL_MonthLength(lpht->st.wMonth, lpht->st.wYear) + day; } else if (day > MONTHCAL_MonthLength(ht_month.wMonth, ht_month.wYear)) { - lpht->uHit = MCHT_CALENDARDATENEXT; - MONTHCAL_GetNextMonth(&lpht->st); - lpht->st.wDay = day - MONTHCAL_MonthLength(ht_month.wMonth, ht_month.wYear); + htinfo.uHit = MCHT_CALENDARDATENEXT; + MONTHCAL_GetNextMonth(&htinfo.st); + htinfo.st.wDay = day - MONTHCAL_MonthLength(ht_month.wMonth, ht_month.wYear); } - else { - lpht->uHit = MCHT_CALENDARDATE; - lpht->st.wDay = day; + else + { + htinfo.uHit = MCHT_CALENDARDATE; + htinfo.st.wDay = day; } + MONTHCAL_CalcDayXY(infoPtr, &htinfo.st, &htinfo.iCol, &htinfo.iRow); + MONTHCAL_CalcDayRect(infoPtr, &htinfo.rc, htinfo.iCol, htinfo.iRow); /* always update day of week */ - MONTHCAL_CalculateDayOfWeek(&lpht->st, TRUE); + MONTHCAL_CalculateDayOfWeek(&htinfo.st, TRUE); } - return lpht->uHit; + return fill_hittest_info(&htinfo, lpht); } /* MCN_GETDAYSTATE notification helper */ @@ -1753,8 +1763,8 @@ static void MONTHCAL_NotifyDayState(MONTHCAL_INFO *infoPtr) nmds.prgDayState = Alloc(infoPtr->monthRange * sizeof(MONTHDAYSTATE)); nmds.stStart = infoPtr->todaysDate; - nmds.stStart.wYear = infoPtr->curSel.wYear; - nmds.stStart.wMonth = infoPtr->curSel.wMonth; + nmds.stStart.wYear = infoPtr->minSel.wYear; + nmds.stStart.wMonth = infoPtr->minSel.wMonth; nmds.stStart.wDay = 1; SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, nmds.nmhdr.idFrom, (LPARAM)&nmds); @@ -1764,41 +1774,62 @@ static void MONTHCAL_NotifyDayState(MONTHCAL_INFO *infoPtr) } } -static void MONTHCAL_GoToPrevNextMonth(MONTHCAL_INFO *infoPtr, BOOL prev) +/* no valid range check performed */ +static void MONTHCAL_Scroll(MONTHCAL_INFO *infoPtr, INT delta) { - SYSTEMTIME st = infoPtr->curSel; + INT i, selIdx = -1; - TRACE("%s\n", prev ? "prev" : "next"); + for(i = 0; i < infoPtr->cal_num; i++) + { + /* save selection position to shift it later */ + if (selIdx == -1 && MONTHCAL_CompareMonths(&infoPtr->minSel, &infoPtr->calendars[i].month) == 0) + selIdx = i; - if(prev) MONTHCAL_GetPrevMonth(&st); else MONTHCAL_GetNextMonth(&st); - - if(!MONTHCAL_IsDateInValidRange(infoPtr, &st, FALSE)) return; + MONTHCAL_GetMonth(&infoPtr->calendars[i].month, delta); + } + /* selection is always shifted to first calendar */ if(infoPtr->dwStyle & MCS_MULTISELECT) { SYSTEMTIME range[2]; - range[0] = infoPtr->minSel; - range[1] = infoPtr->maxSel; - - if(prev) - { - MONTHCAL_GetPrevMonth(&range[0]); - MONTHCAL_GetPrevMonth(&range[1]); - } - else - { - MONTHCAL_GetNextMonth(&range[0]); - MONTHCAL_GetNextMonth(&range[1]); - } - + MONTHCAL_GetSelRange(infoPtr, range); + MONTHCAL_GetMonth(&range[0], delta - selIdx); + MONTHCAL_GetMonth(&range[1], delta - selIdx); MONTHCAL_SetSelRange(infoPtr, range); } else + { + SYSTEMTIME st = infoPtr->minSel; + + MONTHCAL_GetMonth(&st, delta - selIdx); MONTHCAL_SetCurSel(infoPtr, &st); + } +} +static void MONTHCAL_GoToMonth(MONTHCAL_INFO *infoPtr, enum nav_direction direction) +{ + INT delta = infoPtr->delta ? infoPtr->delta : infoPtr->cal_num; + SYSTEMTIME st; + + TRACE("%s\n", direction == DIRECTION_BACKWARD ? "back" : "fwd"); + + /* check if change allowed by range set */ + if(direction == DIRECTION_BACKWARD) + { + st = infoPtr->calendars[0].month; + MONTHCAL_GetMonth(&st, -delta); + } + else + { + st = infoPtr->calendars[infoPtr->cal_num-1].month; + MONTHCAL_GetMonth(&st, delta); + } + + if(!MONTHCAL_IsDateInValidRange(infoPtr, &st, FALSE)) return; + + MONTHCAL_Scroll(infoPtr, direction == DIRECTION_BACKWARD ? -delta : delta); MONTHCAL_NotifyDayState(infoPtr); - MONTHCAL_NotifySelectionChange(infoPtr); } @@ -1823,7 +1854,6 @@ MONTHCAL_RButtonUp(MONTHCAL_INFO *infoPtr, LPARAM lParam) if( TrackPopupMenu(hMenu, TPM_RIGHTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD, menupoint.x, menupoint.y, 0, infoPtr->hwndSelf, NULL)) { - infoPtr->curSel = infoPtr->todaysDate; infoPtr->calendars[0].month = infoPtr->todaysDate; infoPtr->minSel = infoPtr->todaysDate; infoPtr->maxSel = infoPtr->todaysDate; @@ -1881,12 +1911,15 @@ static LRESULT CALLBACK EditWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM } /* creates updown control and edit box */ -static void MONTHCAL_EditYear(MONTHCAL_INFO *infoPtr) +static void MONTHCAL_EditYear(MONTHCAL_INFO *infoPtr, INT calIdx) { + RECT *rc = &infoPtr->calendars[calIdx].titleyear; + RECT *title = &infoPtr->calendars[calIdx].title; + infoPtr->hWndYearEdit = CreateWindowExW(0, WC_EDITW, 0, WS_VISIBLE | WS_CHILD | ES_READONLY, - infoPtr->calendars[0].titleyear.left + 3, infoPtr->titlebtnnext.top, - infoPtr->calendars[0].titleyear.right - infoPtr->calendars[0].titleyear.left + 4, + rc->left + 3, (title->bottom + title->top - infoPtr->textHeight) / 2, + rc->right - rc->left + 4, infoPtr->textHeight, infoPtr->hwndSelf, NULL, NULL, NULL); @@ -1895,7 +1928,7 @@ static void MONTHCAL_EditYear(MONTHCAL_INFO *infoPtr) infoPtr->hWndYearUpDown = CreateWindowExW(0, UPDOWN_CLASSW, 0, WS_VISIBLE | WS_CHILD | UDS_SETBUDDYINT | UDS_NOTHOUSANDS | UDS_ARROWKEYS, - infoPtr->calendars[0].titleyear.right + 7, infoPtr->titlebtnnext.top, + rc->right + 7, (title->bottom + title->top - infoPtr->textHeight) / 2, 18, infoPtr->textHeight, infoPtr->hwndSelf, NULL, NULL, NULL); @@ -1903,7 +1936,7 @@ static void MONTHCAL_EditYear(MONTHCAL_INFO *infoPtr) SendMessageW(infoPtr->hWndYearUpDown, UDM_SETRANGE, 0, MAKELONG(max_allowed_date.wYear, min_allowed_date.wYear)); SendMessageW(infoPtr->hWndYearUpDown, UDM_SETBUDDY, (WPARAM)infoPtr->hWndYearEdit, 0); - SendMessageW(infoPtr->hWndYearUpDown, UDM_SETPOS, 0, infoPtr->curSel.wYear); + SendMessageW(infoPtr->hWndYearUpDown, UDM_SETPOS, 0, infoPtr->calendars[calIdx].month.wYear); /* subclass edit box */ infoPtr->EditWndProc = (WNDPROC)SetWindowLongPtrW(infoPtr->hWndYearEdit, @@ -1939,14 +1972,14 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam) switch(hit) { case MCHT_TITLEBTNNEXT: - MONTHCAL_GoToPrevNextMonth(infoPtr, FALSE); + MONTHCAL_GoToMonth(infoPtr, DIRECTION_FORWARD); infoPtr->status = MC_NEXTPRESSED; SetTimer(infoPtr->hwndSelf, MC_PREVNEXTMONTHTIMER, MC_PREVNEXTMONTHDELAY, 0); InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); return 0; case MCHT_TITLEBTNPREV: - MONTHCAL_GoToPrevNextMonth(infoPtr, TRUE); + MONTHCAL_GoToMonth(infoPtr, DIRECTION_BACKWARD); infoPtr->status = MC_PREVPRESSED; SetTimer(infoPtr->hwndSelf, MC_PREVNEXTMONTHTIMER, MC_PREVNEXTMONTHDELAY, 0); InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); @@ -1970,22 +2003,33 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam) i = TrackPopupMenu(hMenu,TPM_LEFTALIGN | TPM_NONOTIFY | TPM_RIGHTBUTTON | TPM_RETURNCMD, menupoint.x, menupoint.y, 0, infoPtr->hwndSelf, NULL); - if ((i > 0) && (i < 13) && infoPtr->curSel.wMonth != i) + if ((i > 0) && (i < 13) && infoPtr->calendars[ht.iOffset].month.wMonth != i) { - infoPtr->curSel.wMonth = i; - MONTHCAL_IsDateInValidRange(infoPtr, &infoPtr->curSel, TRUE); - InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); + INT delta = i - infoPtr->calendars[ht.iOffset].month.wMonth; + SYSTEMTIME st; + + /* check if change allowed by range set */ + st = delta < 0 ? infoPtr->calendars[0].month : + infoPtr->calendars[infoPtr->cal_num-1].month; + MONTHCAL_GetMonth(&st, delta); + + if (MONTHCAL_IsDateInValidRange(infoPtr, &st, FALSE)) + { + MONTHCAL_Scroll(infoPtr, delta); + MONTHCAL_NotifyDayState(infoPtr); + MONTHCAL_NotifySelectionChange(infoPtr); + InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); + } } return 0; } case MCHT_TITLEYEAR: { - MONTHCAL_EditYear(infoPtr); + MONTHCAL_EditYear(infoPtr, ht.iOffset); return 0; } case MCHT_TODAYLINK: { - infoPtr->curSel = infoPtr->todaysDate; infoPtr->calendars[0].month = infoPtr->todaysDate; infoPtr->minSel = infoPtr->todaysDate; infoPtr->maxSel = infoPtr->todaysDate; @@ -2058,7 +2102,7 @@ MONTHCAL_LButtonUp(MONTHCAL_INFO *infoPtr, LPARAM lParam) if((hit & MCHT_CALENDARDATE) == MCHT_CALENDARDATE) { - SYSTEMTIME sel = infoPtr->curSel; + SYSTEMTIME sel = infoPtr->minSel; /* will be invalidated here */ MONTHCAL_SetCurSel(infoPtr, &ht.st); @@ -2081,8 +2125,8 @@ MONTHCAL_Timer(MONTHCAL_INFO *infoPtr, WPARAM id) switch(id) { case MC_PREVNEXTMONTHTIMER: - if(infoPtr->status & MC_NEXTPRESSED) MONTHCAL_GoToPrevNextMonth(infoPtr, FALSE); - if(infoPtr->status & MC_PREVPRESSED) MONTHCAL_GoToPrevNextMonth(infoPtr, TRUE); + if(infoPtr->status & MC_NEXTPRESSED) MONTHCAL_GoToMonth(infoPtr, DIRECTION_FORWARD); + if(infoPtr->status & MC_PREVPRESSED) MONTHCAL_GoToMonth(infoPtr, DIRECTION_BACKWARD); InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); break; case MC_TODAYUPDATETIMER: @@ -2199,7 +2243,7 @@ MONTHCAL_EraseBkgnd(const MONTHCAL_INFO *infoPtr, HDC hdc) if (!GetClipBox(hdc, &rc)) return FALSE; /* fill background */ - hbr = CreateSolidBrush (infoPtr->bk); + hbr = CreateSolidBrush (infoPtr->colors[MCSC_BACKGROUND]); FillRect(hdc, &rc, hbr); DeleteObject(hbr); @@ -2374,8 +2418,6 @@ static LRESULT MONTHCAL_Size(MONTHCAL_INFO *infoPtr, int Width, int Height) TRACE("(width=%d, height=%d)\n", Width, Height); MONTHCAL_UpdateSize(infoPtr); - - /* invalidate client area and erase background */ InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); return 0; @@ -2489,16 +2531,15 @@ MONTHCAL_Create(HWND hwnd, LPCREATESTRUCTW lpcs) infoPtr->monthdayState = Alloc(infoPtr->monthRange * sizeof(MONTHDAYSTATE)); if (!infoPtr->monthdayState) goto fail; - infoPtr->titlebk = comctl32_color.clrActiveCaption; - infoPtr->titletxt = comctl32_color.clrWindow; - infoPtr->monthbk = comctl32_color.clrWindow; - infoPtr->trailingtxt = comctl32_color.clrGrayText; - infoPtr->bk = comctl32_color.clrWindow; - infoPtr->txt = comctl32_color.clrWindowText; + infoPtr->colors[MCSC_BACKGROUND] = comctl32_color.clrWindow; + infoPtr->colors[MCSC_TEXT] = comctl32_color.clrWindowText; + infoPtr->colors[MCSC_TITLEBK] = comctl32_color.clrActiveCaption; + infoPtr->colors[MCSC_TITLETEXT] = comctl32_color.clrWindow; + infoPtr->colors[MCSC_MONTHBK] = comctl32_color.clrWindow; + infoPtr->colors[MCSC_TRAILINGTEXT] = comctl32_color.clrGrayText; infoPtr->minSel = infoPtr->todaysDate; infoPtr->maxSel = infoPtr->todaysDate; - infoPtr->curSel = infoPtr->todaysDate; infoPtr->calendars[0].month = infoPtr->todaysDate; infoPtr->isUnicode = TRUE; @@ -2545,16 +2586,12 @@ MONTHCAL_Notify(MONTHCAL_INFO *infoPtr, NMHDR *hdr) { NMUPDOWN *nmud = (NMUPDOWN*)hdr; - if (hdr->hwndFrom == infoPtr->hWndYearUpDown) + if (hdr->hwndFrom == infoPtr->hWndYearUpDown && nmud->iDelta) { /* year value limits are set up explicitly after updown creation */ - if ((nmud->iDelta + nmud->iPos) != infoPtr->curSel.wYear) - { - SYSTEMTIME new_date = infoPtr->curSel; - - new_date.wYear = nmud->iDelta + nmud->iPos; - MONTHCAL_SetCurSel(infoPtr, &new_date); - } + MONTHCAL_Scroll(infoPtr, 12 * nmud->iDelta); + MONTHCAL_NotifyDayState(infoPtr); + MONTHCAL_NotifySelectionChange(infoPtr); } } return 0; @@ -2577,11 +2614,10 @@ MONTHCAL_GetUnicodeFormat(const MONTHCAL_INFO *infoPtr) static LRESULT WINAPI MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - MONTHCAL_INFO *infoPtr; + MONTHCAL_INFO *infoPtr = (MONTHCAL_INFO *)GetWindowLongPtrW(hwnd, 0); TRACE("hwnd=%p msg=%x wparam=%lx lparam=%lx\n", hwnd, uMsg, wParam, lParam); - infoPtr = MONTHCAL_GetInfoPtr(hwnd); if (!infoPtr && (uMsg != WM_CREATE)) return DefWindowProcW(hwnd, uMsg, wParam, lParam); switch(uMsg) diff --git a/reactos/dll/win32/comctl32/pager.c b/reactos/dll/win32/comctl32/pager.c index f3461fde88d..e1420e06ab5 100644 --- a/reactos/dll/win32/comctl32/pager.c +++ b/reactos/dll/win32/comctl32/pager.c @@ -99,11 +99,7 @@ PAGER_GetButtonRects(const PAGER_INFO* infoPtr, RECT* prcTopLeft, RECT* prcBotto GetWindowRect (infoPtr->hwndSelf, &rcWindow); if (bClientCoords) - { - POINT pt = {rcWindow.left, rcWindow.top}; - ScreenToClient(infoPtr->hwndSelf, &pt); - OffsetRect(&rcWindow, -(rcWindow.left-pt.x), -(rcWindow.top-pt.y)); - } + MapWindowPoints( 0, infoPtr->hwndSelf, (POINT *)&rcWindow, 2 ); else OffsetRect(&rcWindow, -rcWindow.left, -rcWindow.top); diff --git a/reactos/dll/win32/comctl32/progress.c b/reactos/dll/win32/comctl32/progress.c index c44b816a2b8..71fba9d4c05 100644 --- a/reactos/dll/win32/comctl32/progress.c +++ b/reactos/dll/win32/comctl32/progress.c @@ -29,11 +29,6 @@ * * TODO: * - * Messages: - * -- PBM_GETSTEP - * -- PBM_SETSTATE - * -- PBM_GETSTATE - * * Styles: * -- PBS_SMOOTHREVERSE * @@ -380,8 +375,7 @@ static LRESULT PROGRESS_Draw (PROGRESS_INFO *infoPtr, HDC hdc) if (pdi.theme) { GetWindowRect( infoPtr->Self, &pdi.bgRect ); - ScreenToClient( infoPtr->Self, (POINT*)&pdi.bgRect ); - ScreenToClient( infoPtr->Self, (POINT*)&pdi.bgRect.right ); + MapWindowPoints( infoPtr->Self, 0, (POINT*)&pdi.bgRect, 2 ); } if (!barSmooth) @@ -663,6 +657,9 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, return oldStep; } + case PBM_GETSTEP: + return infoPtr->Step; + case PBM_STEPIT: { INT oldVal; @@ -708,6 +705,14 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, case PBM_GETBKCOLOR: return infoPtr->ColorBk; + case PBM_SETSTATE: + if(wParam != PBST_NORMAL) + FIXME("state %04lx not yet handled\n", wParam); + return PBST_NORMAL; + + case PBM_GETSTATE: + return PBST_NORMAL; + case PBM_SETMARQUEE: if(wParam != 0) { diff --git a/reactos/dll/win32/comctl32/propsheet.c b/reactos/dll/win32/comctl32/propsheet.c index 3e313bad59e..2172a8507ad 100644 --- a/reactos/dll/win32/comctl32/propsheet.c +++ b/reactos/dll/win32/comctl32/propsheet.c @@ -613,7 +613,7 @@ static INT_PTR PROPSHEET_CreateDialog(PropSheetInfo* psInfo) DWORD resSize; WORD resID = IDD_PROPSHEET; - TRACE("\n"); + TRACE("(%p)\n", psInfo); if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD) resID = IDD_WIZARD; @@ -1074,18 +1074,13 @@ static PADDING_INFO PROPSHEET_GetPaddingInfo(HWND hwndDlg) { HWND hwndTab = GetDlgItem(hwndDlg, IDC_TABCONTROL); RECT rcTab; - POINT tl; PADDING_INFO padding; GetWindowRect(hwndTab, &rcTab); + MapWindowPoints( 0, hwndDlg, (POINT *)&rcTab, 2 ); - tl.x = rcTab.left; - tl.y = rcTab.top; - - ScreenToClient(hwndDlg, &tl); - - padding.x = tl.x; - padding.y = tl.y; + padding.x = rcTab.left; + padding.y = rcTab.top; return padding; } @@ -1131,21 +1126,17 @@ static PADDING_INFO PROPSHEET_GetPaddingInfoWizard(HWND hwndDlg, const PropSheet hwndControl = GetDlgItem(hwndDlg, idButton); GetWindowRect(hwndControl, &rc); - + MapWindowPoints( 0, hwndDlg, (POINT *)&rc, 2 ); ptButton.x = rc.left; ptButton.y = rc.top; - ScreenToClient(hwndDlg, &ptButton); - /* Line */ hwndControl = GetDlgItem(hwndDlg, IDC_SUNKEN_LINE); GetWindowRect(hwndControl, &rc); - + MapWindowPoints( 0, hwndDlg, (POINT *)&rc, 2 ); ptLine.x = rc.left; ptLine.y = rc.bottom; - ScreenToClient(hwndDlg, &ptLine); - padding.y = ptButton.y - ptLine.y; if (padding.y < 0) @@ -2421,6 +2412,28 @@ static BOOL PROPSHEET_RemovePage(HWND hwndDlg, return FALSE; } +BOOL CALLBACK +EnumChildProc(HWND hwnd, LPARAM lParam) +{ + WCHAR szType[20]; + RealGetWindowClassW(hwnd, szType, 20); + + if (strcmpW(szType, WC_EDITW) == 0) + { + if (IsWindowEnabled(hwnd) && IsWindowVisible(hwnd)) + { + SetFocus(hwnd); + return FALSE; + } + } + else + { + EnumChildWindows(hwnd, EnumChildProc, 0); + } + + return TRUE; +} + /****************************************************************************** * PROPSHEET_SetWizButtons * @@ -2442,17 +2455,6 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags) EnableWindow(hwndNext, FALSE); EnableWindow(hwndFinish, FALSE); - /* set the default pushbutton to an enabled button */ - if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH)) - SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0); - else if (dwFlags & PSWIZB_NEXT) - SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0); - else if (dwFlags & PSWIZB_BACK) - SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0); - else - SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0); - - if (dwFlags & PSWIZB_BACK) EnableWindow(hwndBack, TRUE); @@ -2482,6 +2484,31 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags) } else if (!(dwFlags & PSWIZB_DISABLEDFINISH)) EnableWindow(hwndFinish, TRUE); + + /* set the default pushbutton to an enabled button and give it focus */ + if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH)) + { + SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0); + SetFocus(hwndFinish); + } + else if (dwFlags & PSWIZB_NEXT) + { + SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0); + SetFocus(hwndNext); + } + else if (dwFlags & PSWIZB_BACK) + { + SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0); + SetFocus(hwndBack); + } + else + { + SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0); + SetFocus(GetDlgItem(hwndDlg, IDCANCEL)); + } + + /* Now try to find an edit control that deserves focus */ + EnumChildWindows(PropSheet_GetCurrentPageHwnd(hwndDlg), EnumChildProc, 0); } /****************************************************************************** @@ -3415,10 +3442,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { /* set up the Next and Back buttons by default */ PROPSHEET_SetWizButtons(hwnd, PSWIZB_BACK|PSWIZB_NEXT); - SetFocus(GetDlgItem(hwnd, IDC_NEXT_BUTTON)); } - else - SetFocus(GetDlgItem(hwnd, IDOK)); /* Set up fonts */ SystemParametersInfoW (SPI_GETICONTITLELOGFONT, 0, &logFont, 0); @@ -3464,6 +3488,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ShowWindow(hwndTabCtrl, SW_HIDE); PROPSHEET_AdjustSizeWizard(hwnd, psInfo); PROPSHEET_AdjustButtonsWizard(hwnd, psInfo); + SetFocus(GetDlgItem(hwnd, IDC_NEXT_BUTTON)); } else { @@ -3472,6 +3497,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) PROPSHEET_AdjustSize(hwnd, psInfo); PROPSHEET_AdjustButtons(hwnd, psInfo); } + SetFocus(GetDlgItem(hwnd, IDOK)); } if (IS_INTRESOURCE(psInfo->ppshheader.pszCaption) && diff --git a/reactos/dll/win32/comctl32/rebar.c b/reactos/dll/win32/comctl32/rebar.c index c254e34d8df..8e9c38b7a79 100644 --- a/reactos/dll/win32/comctl32/rebar.c +++ b/reactos/dll/win32/comctl32/rebar.c @@ -1180,8 +1180,6 @@ static void REBAR_SetRowRectsX(const REBAR_INFO *infoPtr, INT iBeginBand, INT iE for (i = iBeginBand; i < iEndBand; i = next_visible(infoPtr, i)) { REBAR_BAND *lpBand = REBAR_GetBand(infoPtr, i); - - lpBand = REBAR_GetBand(infoPtr, i); if (lpBand->rcBand.left != xPos || lpBand->rcBand.right != xPos + lpBand->cxEffective) { lpBand->fDraw |= NTF_INVALIDATE; TRACE("Setting rect %d to %d,%d\n", i, xPos, xPos + lpBand->cxEffective); @@ -1264,6 +1262,57 @@ static int REBAR_ShrinkBandsLTR(const REBAR_INFO *infoPtr, INT iBeginBand, INT i return cxShrink; } +/* Tries to move a band to a given offset within a row. */ +static int REBAR_MoveBandToRowOffset(REBAR_INFO *infoPtr, INT iBand, INT iFirstBand, + INT iLastBand, INT xOff, BOOL reorder) +{ + REBAR_BAND *insertBand = REBAR_GetBand(infoPtr, iBand); + int xPos = 0, i; + const BOOL setBreak = REBAR_GetBand(infoPtr, iFirstBand)->fStyle & RBBS_BREAK; + + /* Find the band's new position */ + if(reorder) + { + /* Used during an LR band reorder drag */ + for (i = iFirstBand; i < iLastBand; i = next_visible(infoPtr, i)) + { + if(xPos > xOff) + break; + xPos += REBAR_GetBand(infoPtr, i)->cxEffective + SEP_WIDTH; + } + } + else + { + /* Used during a UD band insertion drag */ + for (i = iFirstBand; i < iLastBand; i = next_visible(infoPtr, i)) + { + const REBAR_BAND *band = REBAR_GetBand(infoPtr, i); + if(xPos + band->cxMinBand / 2 > xOff) + break; + xPos += band->cxEffective + SEP_WIDTH; + } + } + + /* Move the band to its new position */ + DPA_DeletePtr(infoPtr->bands, iBand); + if(i > iBand) + i--; + DPA_InsertPtr(infoPtr->bands, i, insertBand); + + /* Ensure only the last band has the RBBS_BREAK flag set */ + insertBand->fStyle &= ~RBBS_BREAK; + if(setBreak) + REBAR_GetBand(infoPtr, iFirstBand)->fStyle |= RBBS_BREAK; + + /* Return the currently grabbed band */ + if(infoPtr->iGrabbedBand == iBand) + { + infoPtr->iGrabbedBand = i; + return i; + } + else return -1; +} + /* Set the heights of the visible bands in [iBeginBand; iEndBand) to the max height. iBeginBand must be visible */ static int REBAR_SetBandsHeight(const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT yStart) { @@ -2002,26 +2051,11 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, const POINT *ptsmove) /* Gripper drag within a row. It will not implement "out- */ /* of-row" drags. (They are detected and handled in */ /* REBAR_MouseMove.) */ - /* **** FIXME Switching order of bands in a row not **** */ - /* **** yet implemented. **** */ { REBAR_BAND *hitBand; INT iHitBand, iRowBegin, iRowEnd; - INT movement, xBand; - - /* on first significant mouse movement, issue notify */ - if (!(infoPtr->fStatus & BEGIN_DRAG_ISSUED)) { - if (REBAR_Notify_NMREBAR (infoPtr, -1, RBN_BEGINDRAG)) { - /* Notify returned TRUE - abort drag */ - infoPtr->dragStart.x = 0; - infoPtr->dragStart.y = 0; - infoPtr->dragNow = infoPtr->dragStart; - infoPtr->iGrabbedBand = -1; - ReleaseCapture (); - return ; - } - infoPtr->fStatus |= BEGIN_DRAG_ISSUED; - } + INT movement, xBand, cxLeft = 0; + BOOL shrunkBands = FALSE; iHitBand = infoPtr->iGrabbedBand; iRowBegin = get_row_begin_for_band(infoPtr, iHitBand); @@ -2032,21 +2066,44 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, const POINT *ptsmove) movement = (infoPtr->dwStyle&CCS_VERT ? ptsmove->y : ptsmove->x) - (xBand + REBAR_PRE_GRIPPER - infoPtr->ihitoffset); - if (movement < 0) { - INT cxLeft = REBAR_ShrinkBandsRTL(infoPtr, iRowBegin, iHitBand, -movement, TRUE); - hitBand->cxEffective += -movement - cxLeft; - hitBand->cx = hitBand->cxEffective; - } else if (movement > 0) { - INT prev; + /* Dragging the first band in a row cannot cause shrinking */ + if(iHitBand != iRowBegin) + { + if (movement < 0) { + cxLeft = REBAR_ShrinkBandsRTL(infoPtr, iRowBegin, iHitBand, -movement, TRUE); + + if(cxLeft < -movement) + { + hitBand->cxEffective += -movement - cxLeft; + hitBand->cx = hitBand->cxEffective; + shrunkBands = TRUE; + } + + } else if (movement > 0) { + + cxLeft = movement; + if (prev_visible(infoPtr, iHitBand) >= 0) + cxLeft = REBAR_ShrinkBandsLTR(infoPtr, iHitBand, iRowEnd, movement, TRUE); + + if(cxLeft < movement) + { + REBAR_BAND *lpPrev = REBAR_GetBand(infoPtr, prev_visible(infoPtr, iHitBand)); + lpPrev->cxEffective += movement - cxLeft; + lpPrev->cx = hitBand->cxEffective; + shrunkBands = TRUE; + } - if ((prev = prev_visible(infoPtr, iHitBand)) >= 0) { - INT cxLeft = REBAR_ShrinkBandsLTR(infoPtr, iHitBand, iRowEnd, movement, TRUE); - REBAR_BAND *lpPrev = REBAR_GetBand(infoPtr, prev_visible(infoPtr, iHitBand)); - lpPrev->cxEffective += movement - cxLeft; - lpPrev->cx = lpPrev->cxEffective; } } + if(!shrunkBands) + { + /* It was not possible to move the band by shrinking bands. + * Try relocating the band instead. */ + REBAR_MoveBandToRowOffset(infoPtr, iHitBand, iRowBegin, + iRowEnd, xBand + movement, TRUE); + } + REBAR_SetRowRectsX(infoPtr, iRowBegin, iRowEnd); if (infoPtr->dwStyle & CCS_VERT) REBAR_CalcVertBand(infoPtr, 0, infoPtr->uNumBands); @@ -2055,6 +2112,71 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, const POINT *ptsmove) REBAR_MoveChildWindows(infoPtr, iRowBegin, iRowEnd); } +static void +REBAR_HandleUDDrag (REBAR_INFO *infoPtr, const POINT *ptsmove) +{ + INT yOff = (infoPtr->dwStyle & CCS_VERT) ? ptsmove->x : ptsmove->y; + INT iHitBand, iRowBegin, iNextRowBegin; + REBAR_BAND *hitBand, *rowBeginBand; + + if(infoPtr->uNumBands <= 0) + ERR("There are no bands in this rebar"); + + /* Up/down dragging can only occur when there is more than one + * band in the rebar */ + if(infoPtr->uNumBands <= 1) + return; + + iHitBand = infoPtr->iGrabbedBand; + hitBand = REBAR_GetBand(infoPtr, iHitBand); + + /* If we're taking a band that has the RBBS_BREAK style set, this + * style needs to be reapplied to the band that is going to become + * the new start of the row. */ + if((hitBand->fStyle & RBBS_BREAK) && + (iHitBand < infoPtr->uNumBands - 1)) + REBAR_GetBand(infoPtr, iHitBand + 1)->fStyle |= RBBS_BREAK; + + if(yOff < 0) + { + /* Place the band above the current top row */ + DPA_DeletePtr(infoPtr->bands, iHitBand); + hitBand->fStyle &= RBBS_BREAK; + REBAR_GetBand(infoPtr, 0)->fStyle |= RBBS_BREAK; + infoPtr->iGrabbedBand = DPA_InsertPtr( + infoPtr->bands, 0, hitBand); + } + else if(yOff > REBAR_GetBand(infoPtr, infoPtr->uNumBands - 1)->rcBand.bottom) + { + /* Place the band below the current bottom row */ + DPA_DeletePtr(infoPtr->bands, iHitBand); + hitBand->fStyle |= RBBS_BREAK; + infoPtr->iGrabbedBand = DPA_InsertPtr( + infoPtr->bands, infoPtr->uNumBands - 1, hitBand); + } + else + { + /* Place the band in the prexisting row the mouse is hovering over */ + iRowBegin = first_visible(infoPtr); + while(iRowBegin < infoPtr->uNumBands) + { + iNextRowBegin = get_row_end_for_band(infoPtr, iRowBegin); + rowBeginBand = REBAR_GetBand(infoPtr, iRowBegin); + if(rowBeginBand->rcBand.bottom > yOff) + { + REBAR_MoveBandToRowOffset( + infoPtr, iHitBand, iRowBegin, iNextRowBegin, + ((infoPtr->dwStyle & CCS_VERT) ? ptsmove->y : ptsmove->x) + - REBAR_PRE_GRIPPER - infoPtr->ihitoffset, FALSE); + break; + } + + iRowBegin = iNextRowBegin; + } + } + + REBAR_Layout(infoPtr); +} /* << REBAR_BeginDrag >> */ @@ -2397,7 +2519,7 @@ REBAR_IdToIndex (const REBAR_INFO *infoPtr, UINT uId) static LRESULT -REBAR_InsertBandT(REBAR_INFO *infoPtr, INT iIndex, LPREBARBANDINFOW lprbbi, BOOL bUnicode) +REBAR_InsertBandT(REBAR_INFO *infoPtr, INT iIndex, const REBARBANDINFOW *lprbbi, BOOL bUnicode) { REBAR_BAND *lpBand; @@ -2613,7 +2735,7 @@ REBAR_strdifW( LPCWSTR a, LPCWSTR b ) } static LRESULT -REBAR_SetBandInfoT(REBAR_INFO *infoPtr, INT iBand, LPREBARBANDINFOW lprbbi, BOOL bUnicode) +REBAR_SetBandInfoT(REBAR_INFO *infoPtr, INT iBand, const REBARBANDINFOW *lprbbi, BOOL bUnicode) { REBAR_BAND *lpBand; UINT uChanged; @@ -2661,7 +2783,7 @@ REBAR_SetBandInfoT(REBAR_INFO *infoPtr, INT iBand, LPREBARBANDINFOW lprbbi, BOOL static LRESULT -REBAR_SetBarInfo (REBAR_INFO *infoPtr, LPREBARINFO lpInfo) +REBAR_SetBarInfo (REBAR_INFO *infoPtr, const REBARINFO *lpInfo) { REBAR_BAND *lpBand; UINT i; @@ -3025,25 +3147,36 @@ REBAR_MouseMove (REBAR_INFO *infoPtr, LPARAM lParam) /* if we are currently dragging a band */ if (infoPtr->iGrabbedBand >= 0) { - REBAR_BAND *band1 = NULL, *band2; + REBAR_BAND *band; int yPtMove = (infoPtr->dwStyle & CCS_VERT ? ptMove.x : ptMove.y); if (GetCapture() != infoPtr->hwndSelf) ERR("We are dragging but haven't got capture?!?\n"); - if (infoPtr->iGrabbedBand > 0) - band1 = REBAR_GetBand(infoPtr, infoPtr->iGrabbedBand - 1); - band2 = REBAR_GetBand(infoPtr, infoPtr->iGrabbedBand); + band = REBAR_GetBand(infoPtr, infoPtr->iGrabbedBand); /* if mouse did not move much, exit */ if ((abs(ptMove.x - infoPtr->dragNow.x) <= mindragx) && (abs(ptMove.y - infoPtr->dragNow.y) <= mindragy)) return 0; + /* on first significant mouse movement, issue notify */ + if (!(infoPtr->fStatus & BEGIN_DRAG_ISSUED)) { + if (REBAR_Notify_NMREBAR (infoPtr, -1, RBN_BEGINDRAG)) { + /* Notify returned TRUE - abort drag */ + infoPtr->dragStart.x = 0; + infoPtr->dragStart.y = 0; + infoPtr->dragNow = infoPtr->dragStart; + infoPtr->iGrabbedBand = -1; + ReleaseCapture (); + return 0; + } + infoPtr->fStatus |= BEGIN_DRAG_ISSUED; + } + /* Test for valid drag case - must not be first band in row */ - if ((yPtMove < band2->rcBand.top) || - (yPtMove > band2->rcBand.bottom) || - ((infoPtr->iGrabbedBand > 0) && (band1->iRow != band2->iRow))) { - FIXME("Cannot drag to other rows yet!!\n"); + if ((yPtMove < band->rcBand.top) || + (yPtMove > band->rcBand.bottom)) { + REBAR_HandleUDDrag (infoPtr, &ptMove); } else { REBAR_HandleLRDrag (infoPtr, &ptMove); @@ -3126,7 +3259,7 @@ REBAR_NCCalcSize (const REBAR_INFO *infoPtr, RECT *rect) static LRESULT -REBAR_NCCreate (HWND hwnd, LPCREATESTRUCTW cs) +REBAR_NCCreate (HWND hwnd, const CREATESTRUCTW *cs) { REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd); RECT wnrc1, clrc1; diff --git a/reactos/dll/win32/comctl32/rsrc.rc b/reactos/dll/win32/comctl32/rsrc.rc index a95d0fb531c..350834fded7 100644 --- a/reactos/dll/win32/comctl32/rsrc.rc +++ b/reactos/dll/win32/comctl32/rsrc.rc @@ -98,14 +98,14 @@ IDI_TT_ERROR_SM ICON idi_tt_error_sm.ico #include "comctl_Hu.rc" #include "comctl_It.rc" #include "comctl_Ko.rc" -#include "comctl_Nl.rc" -#include "comctl_No.rc" -#include "comctl_Pl.rc" -#include "comctl_Sk.rc" -#include "comctl_Sv.rc" -#include "comctl_Th.rc" -#include "comctl_Tr.rc" -#include "comctl_Uk.rc" +//#include "comctl_Nl.rc" +//#include "comctl_No.rc" +//#include "comctl_Pl.rc" +//#include "comctl_Sk.rc" +//#include "comctl_Sv.rc" +//#include "comctl_Th.rc" +//#include "comctl_Tr.rc" +//#include "comctl_Uk.rc" /* UTF-8 */ #include "comctl_Da.rc" diff --git a/reactos/dll/win32/comctl32/status.c b/reactos/dll/win32/comctl32/status.c index 1b69ef2d053..eeaf299f6b3 100644 --- a/reactos/dll/win32/comctl32/status.c +++ b/reactos/dll/win32/comctl32/status.c @@ -1047,7 +1047,10 @@ STATUSBAR_WMNCHitTest (const STATUS_INFO *infoPtr, INT x, INT y) rect.top += 2; if (PtInRect (&rect, pt)) - return HTBOTTOMRIGHT; + { + if (GetWindowLongW( infoPtr->Self, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL) return HTBOTTOMLEFT; + else return HTBOTTOMRIGHT; + } } return HTERROR; diff --git a/reactos/dll/win32/comctl32/tab.c b/reactos/dll/win32/comctl32/tab.c index c99153eea31..fe82d59e90f 100644 --- a/reactos/dll/win32/comctl32/tab.c +++ b/reactos/dll/win32/comctl32/tab.c @@ -83,8 +83,10 @@ typedef struct BYTE extra[1]; /* Space for caller supplied info, variable size */ } TAB_ITEM; -/* The size of a tab item depends on how much extra data is requested */ -#define TAB_ITEM_SIZE(infoPtr) (FIELD_OFFSET(TAB_ITEM, extra[(infoPtr)->cbInfo])) +/* The size of a tab item depends on how much extra data is requested. + TCM_INSERTITEM always stores at least LPARAM sized data. */ +#define EXTRA_ITEM_SIZE(infoPtr) (max((infoPtr)->cbInfo, sizeof(LPARAM))) +#define TAB_ITEM_SIZE(infoPtr) FIELD_OFFSET(TAB_ITEM, extra[EXTRA_ITEM_SIZE(infoPtr)]) typedef struct { @@ -1163,14 +1165,14 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr) if (!(infoPtr->fHeightSet)) { int item_height; - int icon_height = 0; + INT icon_height = 0, cx; /* Use the current font to determine the height of a tab. */ GetTextMetricsW(hdc, &fontMetrics); /* Get the icon height */ if (infoPtr->himl) - ImageList_GetIconSize(infoPtr->himl, 0, &icon_height); + ImageList_GetIconSize(infoPtr->himl, &cx, &icon_height); /* Take the highest between font or icon */ if (fontMetrics.tmHeight > icon_height) @@ -1195,7 +1197,9 @@ static void TAB_SetItemBounds (TAB_INFO *infoPtr) /* Get the icon width */ if (infoPtr->himl) { - ImageList_GetIconSize(infoPtr->himl, &icon_width, 0); + INT cy; + + ImageList_GetIconSize(infoPtr->himl, &icon_width, &cy); if (infoPtr->dwStyle & TCS_FIXEDWIDTH) icon_width += 4; @@ -1726,7 +1730,7 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect /* * if owner draw, tell the owner to draw */ - if ((infoPtr->dwStyle & TCS_OWNERDRAWFIXED) && GetParent(infoPtr->hwnd)) + if ((infoPtr->dwStyle & TCS_OWNERDRAWFIXED) && IsWindow(infoPtr->hwndNotify)) { DRAWITEMSTRUCT dis; UINT id; @@ -1739,14 +1743,9 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect drawRect->left += 1; } - /* - * get the control id - */ id = (UINT)GetWindowLongPtrW( infoPtr->hwnd, GWLP_ID ); - /* - * put together the DRAWITEMSTRUCT - */ + /* fill DRAWITEMSTRUCT */ dis.CtlType = ODT_TAB; dis.CtlID = id; dis.itemID = iItem; @@ -1759,11 +1758,18 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect dis.hwndItem = infoPtr->hwnd; dis.hDC = hdc; CopyRect(&dis.rcItem,drawRect); - dis.itemData = (ULONG_PTR)TAB_GetItem(infoPtr, iItem)->extra; - /* - * send the draw message - */ + /* when extra data fits ULONG_PTR, store it directly */ + if (infoPtr->cbInfo > sizeof(LPARAM)) + dis.itemData = (ULONG_PTR) TAB_GetItem(infoPtr, iItem)->extra; + else + { + /* this could be considered broken on 64 bit, but that's how it works - + only first 4 bytes are copied */ + memcpy(&dis.itemData, (ULONG_PTR*)TAB_GetItem(infoPtr, iItem)->extra, 4); + } + + /* draw notification */ SendMessageW( infoPtr->hwndNotify, WM_DRAWITEM, id, (LPARAM)&dis ); } else @@ -2620,7 +2626,7 @@ static inline LRESULT TAB_Paint (TAB_INFO *infoPtr, HDC hdcPaint) } static LRESULT -TAB_InsertItemT (TAB_INFO *infoPtr, INT iItem, TCITEMW *pti, BOOL bUnicode) +TAB_InsertItemT (TAB_INFO *infoPtr, INT iItem, const TCITEMW *pti, BOOL bUnicode) { TAB_ITEM *item; RECT rect; @@ -2684,10 +2690,10 @@ TAB_InsertItemT (TAB_INFO *infoPtr, INT iItem, TCITEMW *pti, BOOL bUnicode) item->iImage = -1; if (pti->mask & TCIF_PARAM) - memcpy(item->extra, &pti->lParam, infoPtr->cbInfo); + memcpy(item->extra, &pti->lParam, EXTRA_ITEM_SIZE(infoPtr)); else - memset(item->extra, 0, infoPtr->cbInfo); - + memset(item->extra, 0, EXTRA_ITEM_SIZE(infoPtr)); + TAB_SetItemBounds(infoPtr); if (infoPtr->uNumItem > 1) TAB_InvalidateTabArea(infoPtr); @@ -3188,15 +3194,8 @@ TAB_SetItemExtra (TAB_INFO *infoPtr, INT cbInfo) { TRACE("(%p %d)\n", infoPtr, cbInfo); - if (cbInfo <= 0) - return FALSE; + if (cbInfo < 0 || infoPtr->uNumItem) return FALSE; - if (infoPtr->uNumItem) - { - /* FIXME: MSDN says this is not allowed, but this hasn't been verified */ - return FALSE; - } - infoPtr->cbInfo = cbInfo; return TRUE; } diff --git a/reactos/dll/win32/comctl32/toolbar.c b/reactos/dll/win32/comctl32/toolbar.c index 9b41732c289..0b9dec24ee0 100644 --- a/reactos/dll/win32/comctl32/toolbar.c +++ b/reactos/dll/win32/comctl32/toolbar.c @@ -2900,13 +2900,27 @@ TOOLBAR_AddStringW (TOOLBAR_INFO *infoPtr, HINSTANCE hInstance, LPARAM lParam) BOOL fFirstString = (infoPtr->nNumStrings == 0); INT nIndex = infoPtr->nNumStrings; - if (hInstance && IS_INTRESOURCE(lParam)) { + TRACE("%p, %lx\n", hInstance, lParam); + + if (IS_INTRESOURCE(lParam)) { WCHAR szString[MAX_RESOURCE_STRING_LENGTH]; WCHAR delimiter; WCHAR *next_delim; + HRSRC hrsrc; WCHAR *p; INT len; - TRACE("adding string from resource!\n"); + + TRACE("adding string from resource\n"); + + if (!hInstance) return -1; + + hrsrc = FindResourceW( hInstance, MAKEINTRESOURCEW((LOWORD(lParam) >> 4) + 1), + (LPWSTR)RT_STRING ); + if (!hrsrc) + { + TRACE("string not found in resources\n"); + return -1; + } len = LoadStringW (hInstance, (UINT)lParam, szString, MAX_RESOURCE_STRING_LENGTH); @@ -2915,7 +2929,7 @@ TOOLBAR_AddStringW (TOOLBAR_INFO *infoPtr, HINSTANCE hInstance, LPARAM lParam) if (len == 0 || len == 1) return nIndex; - TRACE("Delimiter: 0x%x\n", *szString); + TRACE("delimiter: 0x%x\n", *szString); delimiter = *szString; p = szString + 1; @@ -2941,7 +2955,7 @@ TOOLBAR_AddStringW (TOOLBAR_INFO *infoPtr, HINSTANCE hInstance, LPARAM lParam) if (p == NULL) return -1; - TRACE("adding string(s) from array!\n"); + TRACE("adding string(s) from array\n"); while (*p) { len = strlenW (p); @@ -2968,14 +2982,16 @@ TOOLBAR_AddStringA (TOOLBAR_INFO *infoPtr, HINSTANCE hInstance, LPARAM lParam) INT nIndex; INT len; - if (hInstance && IS_INTRESOURCE(lParam)) /* load from resources */ + TRACE("%p, %lx\n", hInstance, lParam); + + if (IS_INTRESOURCE(lParam)) /* load from resources */ return TOOLBAR_AddStringW(infoPtr, hInstance, lParam); p = (LPSTR)lParam; if (p == NULL) return -1; - TRACE("adding string(s) from array!\n"); + TRACE("adding string(s) from array\n"); nIndex = infoPtr->nNumStrings; while (*p) { len = strlen (p); @@ -3033,7 +3049,7 @@ TOOLBAR_AutoSize (TOOLBAR_INFO *infoPtr) if ((infoPtr->dwStyle & CCS_BOTTOM) == CCS_NOMOVEY) { GetWindowRect(infoPtr->hwndSelf, &window_rect); - ScreenToClient(parent, (LPPOINT)&window_rect.left); + MapWindowPoints( 0, parent, (POINT *)&window_rect, 2 ); y = window_rect.top; } if ((infoPtr->dwStyle & CCS_BOTTOM) == CCS_BOTTOM) diff --git a/reactos/dll/win32/comctl32/tooltips.c b/reactos/dll/win32/comctl32/tooltips.c index 688d3b5ec44..49e20cf3515 100644 --- a/reactos/dll/win32/comctl32/tooltips.c +++ b/reactos/dll/win32/comctl32/tooltips.c @@ -636,7 +636,8 @@ TOOLTIPS_Show (TOOLTIPS_INFO *infoPtr, BOOL track_activate) if (!(style & TTS_BALLOON)) rect.top -= (size.cy / 2); } - infoPtr->bToolBelow = TRUE; + if (!(infoPtr->bToolBelow = (infoPtr->yTrackPos + size.cy <= GetSystemMetrics(SM_CYSCREEN)))) + rect.top -= size.cy; if (!(toolPtr->uFlags & TTF_ABSOLUTE)) { @@ -1430,7 +1431,7 @@ TOOLTIPS_HitTestT (const TOOLTIPS_INFO *infoPtr, LPTTHITTESTINFOW lptthit, static LRESULT -TOOLTIPS_NewToolRectT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW) +TOOLTIPS_NewToolRectT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti) { INT nTool; @@ -1840,15 +1841,7 @@ TOOLTIPS_UpdateTipTextT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW static LRESULT -TOOLTIPS_WindowFromPoint (HWND hwnd, WPARAM wParam, LPARAM lParam) -{ - return (LRESULT)WindowFromPoint (*((LPPOINT)lParam)); -} - - - -static LRESULT -TOOLTIPS_Create (HWND hwnd, const CREATESTRUCTW *lpcs) +TOOLTIPS_Create (HWND hwnd) { TOOLTIPS_INFO *infoPtr; @@ -1944,7 +1937,7 @@ TOOLTIPS_MouseMessage (TOOLTIPS_INFO *infoPtr) static LRESULT -TOOLTIPS_NCCreate (HWND hwnd, const CREATESTRUCTW *lpcs) +TOOLTIPS_NCCreate (HWND hwnd) { DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE); DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE); @@ -1986,7 +1979,32 @@ TOOLTIPS_NCHitTest (const TOOLTIPS_INFO *infoPtr, WPARAM wParam, LPARAM lParam) static LRESULT TOOLTIPS_NotifyFormat (TOOLTIPS_INFO *infoPtr, WPARAM wParam, LPARAM lParam) { - FIXME ("hwnd=%p wParam=%lx lParam=%lx\n", infoPtr->hwndSelf, wParam, lParam); + TTTOOL_INFO *toolPtr = infoPtr->tools; + LRESULT nResult; + + TRACE("infoPtr=%p wParam=%lx lParam=%p\n", infoPtr, wParam, (PVOID)lParam); + + if (lParam == NF_QUERY) { + if (toolPtr->bNotifyUnicode) { + return NFR_UNICODE; + } else { + return NFR_ANSI; + } + } + else if (lParam == NF_REQUERY) { + nResult = SendMessageW (toolPtr->hwnd, WM_NOTIFYFORMAT, + (WPARAM)infoPtr->hwndSelf, (LPARAM)NF_QUERY); + if (nResult == NFR_ANSI) { + toolPtr->bNotifyUnicode = FALSE; + TRACE(" -- WM_NOTIFYFORMAT returns: NFR_ANSI\n"); + } else if (nResult == NFR_UNICODE) { + toolPtr->bNotifyUnicode = TRUE; + TRACE(" -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n"); + } else { + TRACE (" -- WM_NOTIFYFORMAT returns: error!\n"); + } + return nResult; + } return 0; } @@ -2220,8 +2238,8 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) uMsg == TTM_HITTESTW); case TTM_NEWTOOLRECTA: case TTM_NEWTOOLRECTW: - return TOOLTIPS_NewToolRectT (infoPtr, (LPTTTOOLINFOW)lParam, - uMsg == TTM_NEWTOOLRECTW); + return TOOLTIPS_NewToolRectT (infoPtr, (LPTTTOOLINFOW)lParam); + case TTM_POP: return TOOLTIPS_Pop (infoPtr); @@ -2268,11 +2286,10 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) uMsg == TTM_UPDATETIPTEXTW); case TTM_WINDOWFROMPOINT: - return TOOLTIPS_WindowFromPoint (hwnd, wParam, lParam); - + return (LRESULT)WindowFromPoint (*((LPPOINT)lParam)); case WM_CREATE: - return TOOLTIPS_Create (hwnd, (LPCREATESTRUCTW)lParam); + return TOOLTIPS_Create (hwnd); case WM_DESTROY: return TOOLTIPS_Destroy (infoPtr); @@ -2300,7 +2317,7 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return TOOLTIPS_MouseMessage (infoPtr); case WM_NCCREATE: - return TOOLTIPS_NCCreate (hwnd, (LPCREATESTRUCTW)lParam); + return TOOLTIPS_NCCreate (hwnd); case WM_NCHITTEST: return TOOLTIPS_NCHitTest (infoPtr, wParam, lParam); diff --git a/reactos/dll/win32/comctl32/treeview.c b/reactos/dll/win32/comctl32/treeview.c index c3b43c4ad13..de692bc1674 100644 --- a/reactos/dll/win32/comctl32/treeview.c +++ b/reactos/dll/win32/comctl32/treeview.c @@ -33,7 +33,8 @@ * * missing styles: TVS_FULLROWSELECT, TVS_INFOTIP, TVS_RTLREADING, * - * missing item styles: TVIS_CUT, TVIS_EXPANDPARTIAL + * missing item styles: TVIS_CUT, TVIS_EXPANDPARTIAL, TVIS_EX_FLAT, + * TVIS_EX_DISABLED * * Make the insertion mark look right. * Scroll (instead of repaint) as much as possible. @@ -69,6 +70,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(treeview); typedef struct _TREEITEM /* HTREEITEM is a _TREEINFO *. */ { + HTREEITEM parent; /* handle to parent or 0 if at root */ + HTREEITEM nextSibling; /* handle to next item in list, 0 if last */ + HTREEITEM firstChild; /* handle to first child or 0 if no child */ + UINT callbackMask; UINT state; UINT stateMask; @@ -81,11 +86,8 @@ typedef struct _TREEITEM /* HTREEITEM is a _TREEINFO *. */ LPARAM lParam; int iIntegral; /* item height multiplier (1 is normal) */ int iLevel; /* indentation level:0=root level */ - HTREEITEM parent; /* handle to parent or 0 if at root */ - HTREEITEM firstChild; /* handle to first child or 0 if no child */ HTREEITEM lastChild; HTREEITEM prevSibling; /* handle to prev item in list, 0 if first */ - HTREEITEM nextSibling; /* handle to next item in list, 0 if last */ RECT rect; LONG linesOffset; LONG stateOffset; @@ -488,10 +490,10 @@ static INT get_notifycode(const TREEVIEW_INFO *infoPtr, INT code) } static inline BOOL -TREEVIEW_SendRealNotify(const TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam) +TREEVIEW_SendRealNotify(const TREEVIEW_INFO *infoPtr, WPARAM wParam, LPNMHDR pnmh) { - TRACE("wParam=%ld, lParam=%ld\n", wParam, lParam); - return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, wParam, lParam); + TRACE("wParam=%ld, lParam=%p\n", wParam, pnmh); + return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, wParam, (LPARAM)pnmh); } static BOOL @@ -505,7 +507,7 @@ TREEVIEW_SendSimpleNotify(const TREEVIEW_INFO *infoPtr, UINT code) nmhdr.idFrom = GetWindowLongPtrW(hwnd, GWLP_ID); nmhdr.code = get_notifycode(infoPtr, code); - return TREEVIEW_SendRealNotify(infoPtr, nmhdr.idFrom, (LPARAM)&nmhdr); + return TREEVIEW_SendRealNotify(infoPtr, nmhdr.idFrom, &nmhdr); } static VOID @@ -568,7 +570,7 @@ TREEVIEW_SendTreeviewNotify(const TREEVIEW_INFO *infoPtr, UINT code, UINT action nmhdr.ptDrag.x = 0; nmhdr.ptDrag.y = 0; - ret = TREEVIEW_SendRealNotify(infoPtr, nmhdr.hdr.idFrom, (LPARAM)&nmhdr); + ret = TREEVIEW_SendRealNotify(infoPtr, nmhdr.hdr.idFrom, &nmhdr.hdr); if (!infoPtr->bNtfUnicode) { Free(nmhdr.itemOld.pszText); @@ -598,7 +600,7 @@ TREEVIEW_SendTreeviewDnDNotify(const TREEVIEW_INFO *infoPtr, UINT code, nmhdr.ptDrag.x = pt.x; nmhdr.ptDrag.y = pt.y; - return TREEVIEW_SendRealNotify(infoPtr, nmhdr.hdr.idFrom, (LPARAM)&nmhdr); + return TREEVIEW_SendRealNotify(infoPtr, nmhdr.hdr.idFrom, &nmhdr.hdr); } @@ -626,7 +628,7 @@ TREEVIEW_SendCustomDrawNotify(const TREEVIEW_INFO *infoPtr, DWORD dwDrawStage, nmcdhdr.clrTextBk = infoPtr->clrBk; nmcdhdr.iLevel = 0; - return TREEVIEW_SendRealNotify(infoPtr, nmcd->hdr.idFrom, (LPARAM)&nmcdhdr); + return TREEVIEW_SendRealNotify(infoPtr, nmcd->hdr.idFrom, &nmcdhdr.nmcd.hdr); } @@ -670,7 +672,7 @@ TREEVIEW_SendCustomDrawItemNotify(const TREEVIEW_INFO *infoPtr, HDC hdc, nmcd->dwDrawStage, nmcd->hdc, nmcd->dwItemSpec, nmcd->uItemState, nmcd->lItemlParam); - return TREEVIEW_SendRealNotify(infoPtr, nmcd->hdr.idFrom, (LPARAM)nmcdhdr); + return TREEVIEW_SendRealNotify(infoPtr, nmcd->hdr.idFrom, &nmcdhdr->nmcd.hdr); } static BOOL @@ -687,7 +689,7 @@ TREEVIEW_BeginLabelEditNotify(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *editI TREEVIEW_TVItemFromItem(infoPtr, TVIF_HANDLE | TVIF_STATE | TVIF_PARAM | TVIF_TEXT, &tvdi.item, editItem); - ret = TREEVIEW_SendRealNotify(infoPtr, tvdi.hdr.idFrom, (LPARAM)&tvdi); + ret = TREEVIEW_SendRealNotify(infoPtr, tvdi.hdr.idFrom, &tvdi.hdr); if (!infoPtr->bNtfUnicode) Free(tvdi.item.pszText); @@ -725,7 +727,8 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, if (mask & TVIF_TEXT) wineItem->textWidth = 0; - TREEVIEW_SendRealNotify(infoPtr, callback.hdr.idFrom, (LPARAM)&callback); + TREEVIEW_SendRealNotify(infoPtr, callback.hdr.idFrom, &callback.hdr); + TRACE("resulting code 0x%08x\n", callback.hdr.code); /* It may have changed due to a call to SetItem. */ mask &= wineItem->callbackMask; @@ -733,7 +736,7 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, if ((mask & TVIF_TEXT) && callback.item.pszText != wineItem->pszText) { /* Instead of copying text into our buffer user specified its own */ - if (!infoPtr->bNtfUnicode) { + if (!infoPtr->bNtfUnicode && (callback.hdr.code == TVN_GETDISPINFOA)) { LPWSTR newText; int buflen; int len = MultiByteToWideChar( CP_ACP, 0, @@ -774,7 +777,7 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, } else if (mask & TVIF_TEXT) { /* User put text into our buffer, that is ok unless A string */ - if (!infoPtr->bNtfUnicode) { + if (!infoPtr->bNtfUnicode && (callback.hdr.code == TVN_GETDISPINFOA)) { LPWSTR newText; LPWSTR oldText = NULL; int buflen; @@ -1005,7 +1008,7 @@ TREEVIEW_AllocateItem(const TREEVIEW_INFO *infoPtr) * inc/dec to toggle the images. */ newItem->iImage = 0; newItem->iSelectedImage = 0; - newItem->iExpandedImage = 0; + newItem->iExpandedImage = (WORD)I_IMAGENONE; if (DPA_InsertPtr(infoPtr->items, INT_MAX, newItem) == -1) { @@ -1478,12 +1481,12 @@ TREEVIEW_RemoveItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem) { TRACE("%p, (%s)\n", wineItem, TREEVIEW_ItemName(wineItem)); - TREEVIEW_SendTreeviewNotify(infoPtr, TVN_DELETEITEMW, TVC_UNKNOWN, - TVIF_HANDLE | TVIF_PARAM, wineItem, 0); - if (wineItem->firstChild) TREEVIEW_RemoveAllChildren(infoPtr, wineItem); + TREEVIEW_SendTreeviewNotify(infoPtr, TVN_DELETEITEMW, TVC_UNKNOWN, + TVIF_HANDLE | TVIF_PARAM, wineItem, 0); + TREEVIEW_UnlinkItem(wineItem); infoPtr->uNumItems--; @@ -1512,7 +1515,7 @@ TREEVIEW_DeleteItem(TREEVIEW_INFO *infoPtr, HTREEITEM wineItem) TREEVIEW_ITEM *parent, *prev = NULL; BOOL visible = FALSE; - if (wineItem == TVI_ROOT) + if (wineItem == TVI_ROOT || !wineItem) { TRACE("TVI_ROOT\n"); parent = infoPtr->root; @@ -1827,7 +1830,7 @@ TREEVIEW_SetItemHeight(TREEVIEW_INFO *infoPtr, INT newHeight) { INT prevHeight = infoPtr->uItemHeight; - TRACE("%d\n", newHeight); + TRACE("new=%d, old=%d\n", newHeight, prevHeight); if (newHeight == -1) { infoPtr->uItemHeight = TREEVIEW_NaturalHeight(infoPtr); @@ -1835,13 +1838,17 @@ TREEVIEW_SetItemHeight(TREEVIEW_INFO *infoPtr, INT newHeight) } else { - infoPtr->uItemHeight = newHeight; - infoPtr->bHeightSet = TRUE; + if (newHeight == 0) newHeight = 1; + infoPtr->uItemHeight = newHeight; + infoPtr->bHeightSet = TRUE; } /* Round down, unless we support odd ("non even") heights. */ - if (!(infoPtr->dwStyle & TVS_NONEVENHEIGHT)) - infoPtr->uItemHeight &= ~1; + if (!(infoPtr->dwStyle & TVS_NONEVENHEIGHT) && infoPtr->uItemHeight != 1) + { + infoPtr->uItemHeight &= ~1; + TRACE("after rounding=%d\n", infoPtr->uItemHeight); + } if (infoPtr->uItemHeight != prevHeight) { @@ -2061,6 +2068,7 @@ static inline LRESULT TREEVIEW_GetVisibleCount(const TREEVIEW_INFO *infoPtr) { /* Surprise! This does not take integral height into account. */ + TRACE("client=%d, item=%d\n", infoPtr->clientHeight, infoPtr->uItemHeight); return infoPtr->clientHeight / infoPtr->uItemHeight; } @@ -2142,6 +2150,13 @@ TREEVIEW_GetItemT(const TREEVIEW_INFO *infoPtr, LPTVITEMEXW tvItem, BOOL isW) } } } + + if (tvItem->mask & TVIF_STATEEX) + { + FIXME("Extended item state not supported, returning 0.\n"); + tvItem->uStateEx = 0; + } + TRACE("item <%p>, txt %p, img %p, mask %x\n", wineItem, tvItem->pszText, &tvItem->iImage, tvItem->mask); @@ -2575,7 +2590,7 @@ TREEVIEW_DrawItem(const TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *wineItem /* The item is currently selected */ imageIndex = wineItem->iSelectedImage; } - else if ((wineItem->state & TVIS_EXPANDED) && (wineItem->iExpandedImage >= 0)) + else if ((wineItem->state & TVIS_EXPANDED) && (wineItem->iExpandedImage != (WORD)I_IMAGENONE)) { /* The item is currently not selected but expanded */ imageIndex = wineItem->iExpandedImage; @@ -2878,6 +2893,7 @@ TREEVIEW_Refresh(TREEVIEW_INFO *infoPtr, HDC hdc, const RECT *rc) } } + // // This is correct, but is causes and infinite loop of WM_PAINT messages, resulting // in continuous painting of the scroll bar in reactos. Comment out until the real // bug is found @@ -2917,6 +2933,7 @@ TREEVIEW_Paint(TREEVIEW_INFO *infoPtr, HDC hdc_ref) { hdc = hdc_ref; GetClientRect(infoPtr->hwnd, &rc); + TREEVIEW_FillBkgnd(infoPtr, hdc, &rc); } else { @@ -3309,7 +3326,7 @@ TREEVIEW_Collapse(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, static BOOL TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, - BOOL bExpandPartial, BOOL bUser) + BOOL partial, BOOL user) { LONG scrollDist; LONG orgNextTop = 0; @@ -3317,7 +3334,7 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, TREEVIEW_ITEM *nextItem, *tmpItem; BOOL sendsNotifications; - TRACE("(%p, %p, partial=%d, %d\n", infoPtr, wineItem, bExpandPartial, bUser); + TRACE("(%p, %p, partial=%d, %d\n", infoPtr, wineItem, partial, user); if (wineItem->state & TVIS_EXPANDED) return TRUE; @@ -3338,7 +3355,7 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, TRACE("TVE_EXPAND %p %s\n", wineItem, TREEVIEW_ItemName(wineItem)); - sendsNotifications = bUser || ((wineItem->cChildren != 0) && + sendsNotifications = user || ((wineItem->cChildren != 0) && !(wineItem->state & TVIS_EXPANDEDONCE)); if (sendsNotifications) { @@ -3353,7 +3370,7 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, wineItem->state |= TVIS_EXPANDED; - if (bExpandPartial) + if (partial) FIXME("TVE_EXPANDPARTIAL not implemented\n"); if (ISVISIBLE(wineItem)) @@ -3419,6 +3436,58 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, return TRUE; } +/* Handler for TVS_SINGLEEXPAND behaviour. Used on response + to mouse messages and TVM_SELECTITEM. + + selection - previously selected item, used to collapse a part of a tree + item - new selected item +*/ +static void TREEVIEW_SingleExpand(TREEVIEW_INFO *infoPtr, + HTREEITEM selection, HTREEITEM item) +{ + TREEVIEW_ITEM *SelItem; + + if ((infoPtr->dwStyle & TVS_SINGLEEXPAND) == 0 || infoPtr->hwndEdit || !item) return; + + TREEVIEW_SendTreeviewNotify(infoPtr, TVN_SINGLEEXPAND, TVC_UNKNOWN, TVIF_HANDLE | TVIF_PARAM, item, 0); + + /* + * Close the previous selection all the way to the root + * as long as the new selection is not a child + */ + if(selection && (selection != item)) + { + BOOL closeit = TRUE; + SelItem = item; + + /* determine if the hitItem is a child of the currently selected item */ + while(closeit && SelItem && TREEVIEW_ValidItem(infoPtr, SelItem) && + (SelItem->parent != infoPtr->root)) + { + closeit = (SelItem != selection); + SelItem = SelItem->parent; + } + + if(closeit) + { + if(TREEVIEW_ValidItem(infoPtr, selection)) + SelItem = selection; + + while(SelItem && (SelItem != item) && TREEVIEW_ValidItem(infoPtr, SelItem) && + SelItem->parent != infoPtr->root) + { + TREEVIEW_Collapse(infoPtr, SelItem, FALSE, FALSE); + SelItem = SelItem->parent; + } + } + } + + /* + * Expand the current item + */ + TREEVIEW_Expand(infoPtr, item, FALSE, FALSE); +} + static BOOL TREEVIEW_Toggle(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, BOOL bUser) { @@ -3865,7 +3934,7 @@ TREEVIEW_EndEditLabelNow(TREEVIEW_INFO *infoPtr, BOOL bCancel) tvdi.item.cchTextMax = 0; } - bCommit = TREEVIEW_SendRealNotify(infoPtr, tvdi.hdr.idFrom, (LPARAM)&tvdi); + bCommit = TREEVIEW_SendRealNotify(infoPtr, tvdi.hdr.idFrom, &tvdi.hdr); if (!bCancel && bCommit) /* Apply the changes */ { @@ -4136,58 +4205,11 @@ TREEVIEW_LButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam) } else if (ht.flags & (TVHT_ONITEMICON|TVHT_ONITEMLABEL)) /* select the item if the hit was inside of the icon or text */ { - /* - * if we are TVS_SINGLEEXPAND then we want this single click to - * do a bunch of things. - */ - if((infoPtr->dwStyle & TVS_SINGLEEXPAND) && - (infoPtr->hwndEdit == 0)) - { - TREEVIEW_ITEM *SelItem; - - /* - * Send the notification - */ - TREEVIEW_SendTreeviewNotify(infoPtr, TVN_SINGLEEXPAND, TVC_UNKNOWN, TVIF_HANDLE | TVIF_PARAM, ht.hItem, 0); - - /* - * Close the previous selection all the way to the root - * as long as the new selection is not a child - */ - if((infoPtr->selectedItem) - && (infoPtr->selectedItem != ht.hItem)) - { - BOOL closeit = TRUE; - SelItem = ht.hItem; - - /* determine if the hitItem is a child of the currently selected item */ - while(closeit && SelItem && TREEVIEW_ValidItem(infoPtr, SelItem) && (SelItem != infoPtr->root)) - { - closeit = (SelItem != infoPtr->selectedItem); - SelItem = SelItem->parent; - } - - if(closeit) - { - if(TREEVIEW_ValidItem(infoPtr, infoPtr->selectedItem)) - SelItem = infoPtr->selectedItem; - - while(SelItem && (SelItem != ht.hItem) && TREEVIEW_ValidItem(infoPtr, SelItem) && (SelItem != infoPtr->root)) - { - TREEVIEW_Collapse(infoPtr, SelItem, FALSE, FALSE); - SelItem = SelItem->parent; - } - } - } - - /* - * Expand the current item - */ - TREEVIEW_Expand(infoPtr, ht.hItem, TVE_TOGGLE, FALSE); - } + TREEVIEW_ITEM *selection = infoPtr->selectedItem; /* Select the current item */ TREEVIEW_DoSelectItem(infoPtr, TVGN_CARET, ht.hItem, TVC_BYMOUSE); + TREEVIEW_SingleExpand(infoPtr, selection, ht.hItem); } else if (ht.flags & TVHT_ONITEMSTATEICON) { @@ -4350,6 +4372,9 @@ TREEVIEW_DoSelectItem(TREEVIEW_INFO *infoPtr, INT action, HTREEITEM newSelect, switch (action) { + case TVGN_CARET|TVSI_NOSINGLEEXPAND: + FIXME("TVSI_NOSINGLEEXPAND specified.\n"); + /* Fall through */ case TVGN_CARET: prevSelect = infoPtr->selectedItem; @@ -4419,7 +4444,9 @@ TREEVIEW_DoSelectItem(TREEVIEW_INFO *infoPtr, INT action, HTREEITEM newSelect, static LRESULT TREEVIEW_SelectItem(TREEVIEW_INFO *infoPtr, INT wParam, HTREEITEM item) { - if (item != NULL && !TREEVIEW_ValidItem(infoPtr, item)) + TREEVIEW_ITEM *selection = infoPtr->selectedItem; + + if (item && !TREEVIEW_ValidItem(infoPtr, item)) return FALSE; TRACE("%p (%s) %d\n", item, TREEVIEW_ItemName(item), wParam); @@ -4427,6 +4454,8 @@ TREEVIEW_SelectItem(TREEVIEW_INFO *infoPtr, INT wParam, HTREEITEM item) if (!TREEVIEW_DoSelectItem(infoPtr, wParam, item, TVC_UNKNOWN)) return FALSE; + TREEVIEW_SingleExpand(infoPtr, selection, item); + return TRUE; } @@ -5474,7 +5503,7 @@ TREEVIEW_SetCursor(const TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam) nmmouse.pt.x = 0; nmmouse.pt.y = 0; nmmouse.dwHitInfo = lParam; - if (TREEVIEW_SendRealNotify(infoPtr, nmmouse.hdr.idFrom, (LPARAM)&nmmouse)) + if (TREEVIEW_SendRealNotify(infoPtr, nmmouse.hdr.idFrom, &nmmouse.hdr)) return 0; if (item && (infoPtr->dwStyle & TVS_TRACKSELECT)) @@ -5824,10 +5853,10 @@ TREEVIEW_Unregister(void) /* Tree Verification ****************************************************/ static inline void -TREEVIEW_VerifyChildren(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item); +TREEVIEW_VerifyChildren(TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item); static inline void TREEVIEW_VerifyItemCommon(TREEVIEW_INFO *infoPtr, - TREEVIEW_ITEM *item) + const TREEVIEW_ITEM *item) { assert(infoPtr != NULL); assert(item != NULL); @@ -5866,7 +5895,7 @@ static inline void TREEVIEW_VerifyItemCommon(TREEVIEW_INFO *infoPtr, } static inline void -TREEVIEW_VerifyItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item) +TREEVIEW_VerifyItem(TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item) { assert(item != NULL); @@ -5882,9 +5911,9 @@ TREEVIEW_VerifyItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item) } static inline void -TREEVIEW_VerifyChildren(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item) +TREEVIEW_VerifyChildren(TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item) { - TREEVIEW_ITEM *child; + const TREEVIEW_ITEM *child; assert(item != NULL); for (child = item->firstChild; child != NULL; child = child->nextSibling) diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index adaff2f0e71..1385a5967a6 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -48,7 +48,7 @@ reactos/dll/win32/browseui # Out of sync reactos/dll/win32/cabinet # Autosync reactos/dll/win32/clusapi # Autosync reactos/dll/win32/comcat # Autosync -reactos/dll/win32/comctl32 # Autosync +reactos/dll/win32/comctl32 # Synced to Wine 1.3.14 reactos/dll/win32/comdlg32 # Autosync reactos/dll/win32/compstui # Autosync reactos/dll/win32/credui # Autosync