hhctrl.ocx: Add icons for the table of contents TreeView control.

This commit is contained in:
Erich Hoover 2012-06-22 11:07:19 -06:00 committed by Alexandre Julliard
parent 924a4e1371
commit fc413c70a5
8 changed files with 76 additions and 7 deletions

View File

@ -16,6 +16,8 @@ IDL_TLB_SRCS = hhctrl_tlb.idl
RC_SRCS = hhctrl.rc
PO_SRCS = hhctrl.rc
SVG_SRCS = hhtoolbar.svg
SVG_SRCS = \
hhtoolbar.svg \
hhtreeview.svg
@MAKE_DLL_RULES@

View File

@ -22,6 +22,7 @@
#include "hhctrl.h"
#include "stream.h"
#include "resource.h"
#include "wine/debug.h"
@ -267,10 +268,12 @@ static void insert_content_item(HWND hwnd, ContentItem *parent, ContentItem *ite
TVINSERTSTRUCTW tvis;
memset(&tvis, 0, sizeof(tvis));
tvis.u.item.mask = TVIF_TEXT|TVIF_PARAM;
tvis.u.item.mask = TVIF_TEXT|TVIF_PARAM|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
tvis.u.item.cchTextMax = strlenW(item->name)+1;
tvis.u.item.pszText = item->name;
tvis.u.item.lParam = (LPARAM)item;
tvis.u.item.iImage = item->child ? HHTV_FOLDER : HHTV_DOCUMENT;
tvis.u.item.iSelectedImage = item->child ? HHTV_FOLDER : HHTV_DOCUMENT;
tvis.hParent = parent ? parent->id : 0;
tvis.hInsertAfter = TVI_LAST;

View File

@ -707,6 +707,24 @@ static LRESULT CALLBACK Child_WndProc(HWND hWnd, UINT message, WPARAM wParam, LP
return OnTabChange(hWnd);
case TVN_SELCHANGEDW:
return OnTopicChange(info, (void*)((NMTREEVIEWW *)lParam)->itemNew.lParam);
case TVN_ITEMEXPANDINGW: {
TVITEMW *item = &((NMTREEVIEWW *)lParam)->itemNew;
HWND hwndTreeView = info->tabs[TAB_CONTENTS].hwnd;
item->mask = TVIF_IMAGE|TVIF_SELECTEDIMAGE;
if (item->state & TVIS_EXPANDED)
{
item->iImage = HHTV_FOLDER;
item->iSelectedImage = HHTV_FOLDER;
}
else
{
item->iImage = HHTV_OPENFOLDER;
item->iSelectedImage = HHTV_OPENFOLDER;
}
SendMessageW(hwndTreeView, TVM_SETITEMW, 0, (LPARAM)item);
return 0;
}
case NM_DBLCLK:
if(!info)
return 0;
@ -1163,18 +1181,29 @@ static BOOL HH_AddHTMLPane(HHInfo *pHHInfo)
static BOOL AddContentTab(HHInfo *info)
{
HIMAGELIST hImageList;
HBITMAP hBitmap;
HWND hWnd;
if(info->tabs[TAB_CONTENTS].id == -1)
return TRUE; /* No "Contents" tab */
info->tabs[TAB_CONTENTS].hwnd = CreateWindowExW(WS_EX_CLIENTEDGE, WC_TREEVIEWW,
szEmpty, WS_CHILD | WS_BORDER | 0x25, 50, 50, 100, 100,
info->WinType.hwndNavigation, NULL, hhctrl_hinstance, NULL);
if(!info->tabs[TAB_CONTENTS].hwnd) {
hWnd = CreateWindowExW(WS_EX_CLIENTEDGE, WC_TREEVIEWW, szEmpty, WS_CHILD | WS_BORDER | TVS_LINESATROOT
| TVS_SHOWSELALWAYS | TVS_HASBUTTONS, 50, 50, 100, 100,
info->WinType.hwndNavigation, NULL, hhctrl_hinstance, NULL);
if(!hWnd) {
ERR("Could not create treeview control\n");
return FALSE;
}
hImageList = ImageList_Create(16, 16, ILC_COLOR32, 0, HHTV_NUMBITMAPS);
hBitmap = LoadBitmapW(hhctrl_hinstance, MAKEINTRESOURCEW(IDB_HHTREEVIEW));
ImageList_Add(hImageList, hBitmap, NULL);
SendMessageW(hWnd, TVM_SETIMAGELIST, TVSIL_NORMAL, (LPARAM)hImageList);
info->contents.hImageList = hImageList;
info->tabs[TAB_CONTENTS].hwnd = hWnd;
ResizeTabChild(info, TAB_CONTENTS);
ShowWindow(info->tabs[TAB_CONTENTS].hwnd, SW_SHOW);
ShowWindow(hWnd, SW_SHOW);
return TRUE;
}
@ -1729,6 +1758,8 @@ void ReleaseHelpViewer(HHInfo *info)
ReleaseIndex(info);
ReleaseSearch(info);
if(info->contents.hImageList)
ImageList_Destroy(info->contents.hImageList);
if(info->WinType.hwndHelp)
DestroyWindow(info->WinType.hwndHelp);

View File

@ -134,6 +134,10 @@ typedef struct {
HWND hwndContainer;
} SearchTab;
typedef struct {
HIMAGELIST hImageList;
} ContentsTab;
typedef struct {
IOleClientSite *client_site;
IWebBrowser2 *web_browser;
@ -158,6 +162,7 @@ typedef struct {
IndexItem *index;
IndexPopup popup;
SearchTab search;
ContentsTab contents;
HWND hwndTabCtrl;
HWND hwndSizeBar;
HFONT hFont;

View File

@ -76,3 +76,6 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
/* @makedep: hhtoolbar.bmp */
IDB_HHTOOLBAR BITMAP hhtoolbar.bmp
/* @makedep: hhtreeview.bmp */
IDB_HHTREEVIEW BITMAP hhtreeview.bmp

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg id="bitmap:48-32" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="16" width="48" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata id="metadata3206">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<g id="layer1" transform="translate(0 -1036.4)">
<image id="icon:16-32" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz AAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAHCSURB VDiNpZAxa5NRFIafc+9XLCni4BC6FBycMnbrLpkcgtDVX6C70D/g4lZX/4coxLlgxFkpiiSSUGm/ JiXfveee45AmNlhawXc53HvPee55X+l2u/yPqt3d3Tfu/viatwt3fzIYDI5uBJhZr9fr3TMzzAx3 B+D09PR+v98/7HQ6z5fNOWdCCGU4HH6s67oAVDlnV1UmkwmllBUkhMD29nYHeLuEAkyn06qU8qqu 64MrgIyqYmZrkHa73drc3KTVahFjJITAaDRiPB4/XFlQVVMtHH5IzJo/P4EA4MyB+erWPQB7++zs 7ccYvlU5Z08pMW2cl88eIXLZeDUpXzsBkNQ5eP1+p0opmaoCTgzw6fjs6gLLsp58FB60t0DcK1Ul 54yIEIMQ43Uj68pquDmCeJVztpwzuBNE2LgBoMVpslHMCUEAFgDVxQbzVAiA+aK5uGPmmDtZF3Vp oUm2ArhqQaRiUjcMf81p1G60UEVhcjZfAFTVUkrgkS+jc06mDX9nvq4YhJ9nlxZExMwMEaHJRutO dWuIIsJFUoBSuTvHJ4YIfP46unV4qdlsjsBRZRtb/XfHd5+C8+P7+J8BIoxFwovfRxYhnhxjpzEA AAAASUVORK5CYII= " height="16" width="16" y="1036.4" x="16"/>
<image id="icon:16-32-5" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB70lEQVQ4jaWRPU9UURCGn3Pu3V3D JdkQPxIbLbUwITZa2xmjBYX/wFhSE2Jniw2thTT4L9QYCqOFCdGYWIkRSQR2AQP7cWbOjMWyuAsE Cyc51Zn3mZn3hf+sMD8//8LdH5zy1xGRhwsLC+/PBMzNze3OzMw0zQwzw90BaLfbrKysvKqq6v6w eW1tDYClpaU+4ACliLiqsrW1Rc55DFKr1W63Wq19d8fdqaoKd2d2dvbT4uLizRGAoKqY2Rhkenp6 cmpqiqqqKIqCGCOdTofl5eUbw61KVTXVTM5/3xAgInQ6HUIIhBCIMQKQUvIjgIh4SmkMkHNmuLa7 nwCo6pGJZUrJVJWcMy8/Rna7EaidGZ1Vd2u3Ht/rhhi/laqKiJBzZqcbefLoDkUMhxkB7qdCktq5 p8/fXi9FxEQEMyPgTDQKPv/4jftATziWOxBj4Mr5CULAShEx1QGgiIEiBmIIJ4Qjk+n1MvEiAH4Y 48C0sigoYqBRxhPCvhjdlMnmNIo4PNNKVbWUEvt9aE7W2dzr00sZ98G0vmaS2pgVZRHY3O0NTggh mJnxdbvO5UtNdg6EnhjdpEei4yfFEFjfPiCGuFm6w+oGrP6qc61Z583qT7Kd7vxotVt7ZLfXZW5c ePdho7oKzucv3/8pHKl1zJ79AVcbTQP9EwlzAAAAAElFTkSuQmCC " height="16" width="16" y="1036.4" x="32"/>
<image id="icon:16-32-9" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA3ElEQVQ4jZ2SsQ2DMBBF/4GlhAoJ eQYMs6RMkXGQ2YIREqXNMJgFaOipTIrIyITDhPzqLPv+f3cyNU3z7Pv+imO6VVX1AABoraej0lpP zkm4YhgGWGsBAEQ0R7maiBDHMdI0XaDMBtZaGGMWDb6ICGVZrmYR/kEpFSTgJPyHPsG3fiLI85xJ HDFNJ0RRFCYAgK7rFpdFUQBIAIwAzvsjcAREBKKEbV4RGGPmmlvehyhgoJTaIOAXuxqhbVs22W2f M2IJOJPdf5Bl2SZmSEJK+arr+nKkSUp5/yuN0xtUUV+5ugGgGgAAAABJRU5ErkJggg== " height="16" width="16" y="1036.4" x="0"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -41,3 +41,10 @@
#define HHTB_CONTRACT 4
#define HHTB_EXPAND 5
#define HHTB_NUMBITMAPS HHTB_EXPAND
#define IDB_HHTREEVIEW 1001
/* IDB_HHTREEVIEW bitmaps: */
#define HHTV_DOCUMENT 0
#define HHTV_FOLDER 1
#define HHTV_OPENFOLDER 2
#define HHTV_NUMBITMAPS HHTV_OPENFOLDER