Commit 90bb481c authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

Add a tab control to the navigation pane.

parent 07f86907
......@@ -23,6 +23,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"
IDTB_CONTRACT "Hide"
IDTB_STOP "Stop"
......
......@@ -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;
}
......
......@@ -23,6 +23,7 @@
#include "wingdi.h"
#include "winnls.h"
#include "htmlhelp.h"
#include "resource.h"
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
......
/*
* 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment