diff --git a/dlls/hhctrl.ocx/En.rc b/dlls/hhctrl.ocx/En.rc index 9927fafcb95..b43599fd2dd 100644 --- a/dlls/hhctrl.ocx/En.rc +++ b/dlls/hhctrl.ocx/En.rc @@ -21,6 +21,14 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +STRINGTABLE +BEGIN + IDS_CONTENTS "&Contents" + IDS_INDEX "I&ndex" + IDS_SEARCH "&Search" + IDS_FAVORITES "Favor&ites" +END + STRINGTABLE BEGIN IDTB_EXPAND "Show" diff --git a/dlls/hhctrl.ocx/help.c b/dlls/hhctrl.ocx/help.c index 9b905262782..0bcc5ea1ddb 100644 --- a/dlls/hhctrl.ocx/help.c +++ b/dlls/hhctrl.ocx/help.c @@ -30,6 +30,8 @@ #include "ole2.h" #include "wine/unicode.h" +#include "resource.h" + /* Window type defaults */ #define WINTYPE_DEFAULT_X 280 @@ -44,6 +46,7 @@ typedef struct tagHHInfo HINSTANCE hInstance; LPCWSTR szCmdLine; DWORD dwNumTBButtons; + HWND hwndTabCtrl; HFONT hFont; } HHInfo; @@ -251,12 +254,25 @@ static void NP_GetNavigationRect(HHInfo *pHHInfo, RECT *rc) rc->right = WINTYPE_DEFAULT_NAVWIDTH; } +static void NP_CreateTab(HINSTANCE hInstance, HWND hwndTabCtrl, DWORD dwStrID, DWORD dwIndex) +{ + TCITEMW tie; + LPWSTR tabText = HH_LoadString(dwStrID); + + tie.mask = TCIF_TEXT; + tie.pszText = tabText; + + TabCtrl_InsertItemW(hwndTabCtrl, dwIndex, &tie); + HeapFree(GetProcessHeap(), 0, tabText); +} + static BOOL HH_AddNavigationPane(HHInfo *pHHInfo) { - HWND hWnd; + HWND hWnd, hwndTabCtrl; HWND hwndParent = pHHInfo->pHHWinType->hwndHelp; DWORD dwStyles = WS_CHILDWINDOW | WS_VISIBLE; DWORD dwExStyles = WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR; + DWORD dwIndex = 0; RECT rc; NP_GetNavigationRect(pHHInfo, &rc); @@ -267,6 +283,21 @@ static BOOL HH_AddNavigationPane(HHInfo *pHHInfo) if (!hWnd) return FALSE; + hwndTabCtrl = CreateWindowExW(dwExStyles, WC_TABCONTROLW, szEmpty, dwStyles, + 0, 0, rc.right, rc.bottom, hWnd, + NULL, pHHInfo->hInstance, NULL); + if (!hwndTabCtrl) + return FALSE; + + /* FIXME: Check which tabs to include when we read the CHM file */ + NP_CreateTab(pHHInfo->hInstance, hwndTabCtrl, IDS_CONTENTS, dwIndex++); + NP_CreateTab(pHHInfo->hInstance, hwndTabCtrl, IDS_INDEX, dwIndex++); + NP_CreateTab(pHHInfo->hInstance, hwndTabCtrl, IDS_SEARCH, dwIndex++); + NP_CreateTab(pHHInfo->hInstance, hwndTabCtrl, IDS_FAVORITES, dwIndex++); + + SendMessageW(hwndTabCtrl, WM_SETFONT, (WPARAM)pHHInfo->hFont, TRUE); + + pHHInfo->hwndTabCtrl = hwndTabCtrl; pHHInfo->pHHWinType->hwndNavigation = hWnd; return TRUE; } diff --git a/dlls/hhctrl.ocx/hhctrl.rc b/dlls/hhctrl.ocx/hhctrl.rc index f319f4162ed..28ce89a9305 100644 --- a/dlls/hhctrl.ocx/hhctrl.rc +++ b/dlls/hhctrl.ocx/hhctrl.rc @@ -23,6 +23,7 @@ #include "wingdi.h" #include "winnls.h" #include "htmlhelp.h" +#include "resource.h" LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL diff --git a/dlls/hhctrl.ocx/resource.h b/dlls/hhctrl.ocx/resource.h new file mode 100644 index 00000000000..38c8501e9d7 --- /dev/null +++ b/dlls/hhctrl.ocx/resource.h @@ -0,0 +1,24 @@ +/* + * HTML Help resource definitions + * + * Copyright 2005 James Hawkins + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#define IDS_CONTENTS 1 +#define IDS_INDEX 2 +#define IDS_SEARCH 3 +#define IDS_FAVORITES 4