Commit cec4ee86 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

winhelp: Start implementing a prop sheet for all lookup needs.

parent 9c030d46
......@@ -82,4 +82,5 @@ STID_ALL_FILES, " (*.*)"
STID_HELP_FILES_HLP, " (*.hlp)"
STID_FILE_NOT_FOUND_s "Cannot find '%s'. Do you want to find this file yourself?"
STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting"
STID_PSH_INDEX, "Help topics: "
}
......@@ -87,4 +87,5 @@ STID_ALL_FILES, "Vechny soubory (*.*)"
STID_HELP_FILES_HLP, "Soubory npovdy (*.hlp)"
STID_FILE_NOT_FOUND_s "Cannot find '%s'. Do you want to find this file yourself?"
STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting"
STID_PSH_INDEX, "Help topics: "
}
......@@ -94,4 +94,5 @@ STID_ALL_FILES, "Alle filer (*.*)"
STID_HELP_FILES_HLP, "Hjlpe filer (*.hlp)"
STID_FILE_NOT_FOUND_s "Kan ikke finde '%s'. Vil du selv finde filen?"
STID_NO_RICHEDIT "Kan ikke finde en 'richedit' implementering... Afbryder"
STID_PSH_INDEX, "Help topics: "
}
......@@ -94,6 +94,7 @@ STID_ALL_FILES, "Alle Dateien (*.*)"
STID_HELP_FILES_HLP, "Hilfe-Dateien (*.hlp)"
STID_FILE_NOT_FOUND_s "'%s' konnte nicht gefunden werden. Wollen Sie selber nach dieser Datei suchen?"
STID_NO_RICHEDIT "Die Richedit Implementation konnte nicht gefunden werden... Breche ab."
STID_PSH_INDEX, "Help topics: "
}
CONTEXT_MENU MENU LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
......
......@@ -93,6 +93,7 @@ STID_ALL_FILES, "All files (*.*)"
STID_HELP_FILES_HLP, "Help files (*.hlp)"
STID_FILE_NOT_FOUND_s "Cannot find '%s'. Do you want to find this file yourself?"
STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting"
STID_PSH_INDEX, "Help topics: "
}
CONTEXT_MENU MENU LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
......
......@@ -85,4 +85,5 @@ STID_ALL_FILES, "Tutaj dosieroj (*.*)"
STID_HELP_FILES_HLP, "Helpaj dosieroj (*.hlp)"
STID_FILE_NOT_FOUND_s "Cannot find '%s'. Do you want to find this file yourself?"
STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting"
STID_PSH_INDEX, "Help topics: "
}
......@@ -84,4 +84,5 @@ STID_ALL_FILES, "Todos los archivos (*.*)"
STID_HELP_FILES_HLP, "Archivos de ayuda (*.hlp)"
STID_FILE_NOT_FOUND_s "Cannot find '%s'. Do you want to find this file yourself?"
STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting"
STID_PSH_INDEX, "Help topics: "
}
......@@ -85,4 +85,5 @@ STID_ALL_FILES, "Kaikki tiedostot (*.*)"
STID_HELP_FILES_HLP, "Ohjetiedostot (*.hlp)"
STID_FILE_NOT_FOUND_s "Cannot find '%s'. Do you want to find this file yourself?"
STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting"
STID_PSH_INDEX, "Help topics: "
}
......@@ -96,6 +96,7 @@ STID_ALL_FILES, "Tous fichiers (*.*)"
STID_HELP_FILES_HLP, "Fichiers d'aide (*.hlp)"
STID_FILE_NOT_FOUND_s "Impossible de trouver %s. Souhaitez-vous rechercher ce fichier vous-mme?"
STID_NO_RICHEDIT "La bibliothque RichEdit n'a pu tre localise... Abandon"
STID_PSH_INDEX, "Rubriques d'aide : "
}
CONTEXT_MENU MENU
......
......@@ -85,4 +85,5 @@ STID_ALL_FILES, "Minden fjl (*.*)"
STID_HELP_FILES_HLP, "Sg fjlok (*.hlp)"
STID_FILE_NOT_FOUND_s "Cannot find '%s'. Do you want to find this file yourself?"
STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting"
STID_PSH_INDEX, "Help topics: "
}
......@@ -84,4 +84,5 @@ STID_ALL_FILES, "Tutti i file (*.*)"
STID_HELP_FILES_HLP, "File della Guida (*.hlp)"
STID_FILE_NOT_FOUND_s "Cannot find '%s'. Do you want to find this file yourself?"
STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting"
STID_PSH_INDEX, "Help topics: "
}
......@@ -96,6 +96,7 @@ STID_ALL_FILES, "모든 파일 (*.*)"
STID_HELP_FILES_HLP, "도움말 파일 (*.hlp)"
STID_FILE_NOT_FOUND_s "%s을 찾을 수 없습니다'. 이 파일을 직접 찾겠습니까?"
STID_NO_RICHEDIT "richedit 구현을 찾을수 업습니다.. 취소중"
STID_PSH_INDEX, "Help topics: "
}
CONTEXT_MENU MENU LANGUAGE LANG_KOREAN, SUBLANG_NEUTRAL
......
......@@ -4,7 +4,8 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = winhlp32.exe
APPMODE = -mwindows
IMPORTS = comdlg32 shell32 user32 gdi32 kernel32
IMPORTS = user32 gdi32 kernel32
DELAYIMPORTS = shell32 comctl32 comdlg32
C_SRCS = \
callback.c \
......
......@@ -93,6 +93,7 @@ STID_ALL_FILES, "Alle bestanden (*.*)"
STID_HELP_FILES_HLP, "Helpbestanden (*.hlp)"
STID_FILE_NOT_FOUND_s "Kan '%s' niet openen. Wilt u zelf dit bestand zoeken?"
STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting"
STID_PSH_INDEX, "Help topics: "
}
CONTEXT_MENU MENU LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
......
......@@ -92,4 +92,5 @@ STID_ALL_FILES, "Alle filer (*.*)"
STID_HELP_FILES_HLP, "Hjelp-filer (*.hlp)"
STID_FILE_NOT_FOUND_s "Cannot find '%s'. Do you want to find this file yourself?"
STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting"
STID_PSH_INDEX, "Help topics: "
}
......@@ -94,6 +94,7 @@ STID_ALL_FILES, "Wszystkie pliki (*.*)"
STID_HELP_FILES_HLP, "Pliki pomocy (*.hlp)"
STID_FILE_NOT_FOUND_s "Nie znaleziono pliku '%s'. Czy chcesz poszuka tego pliku samodzielnie?"
STID_NO_RICHEDIT "Nie udao si znale moduu richedit... Wywietlenie pomocy nie jest moliwe"
STID_PSH_INDEX, "Help topics: "
}
......
......@@ -139,6 +139,7 @@ STID_ALL_FILES, "Todos os arquivos (*.*)"
STID_HELP_FILES_HLP, "Arquivos de ajuda (*.hlp)"
STID_FILE_NOT_FOUND_s "Cannot find '%s'. Do you want to find this file yourself?"
STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting"
STID_PSH_INDEX, "Help topics: "
}
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE
......@@ -159,4 +160,5 @@ STID_ALL_FILES, "Todos os ficheiros (*.*)"
STID_HELP_FILES_HLP, "Ficheiros de ajuda (*.hlp)"
STID_FILE_NOT_FOUND_s "No possvel encontrar '%s'. Deseja procurar este ficheiro voc mesmo?"
STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting"
STID_PSH_INDEX, "Help topics: "
}
......@@ -87,4 +87,5 @@ STID_ALL_FILES, "Tuot las datotecas (*.*)"
STID_HELP_FILES_HLP, "Datotecas d'ag�d (*.hlp)"
STID_FILE_NOT_FOUND_s "Cannot find '%s'. Do you want to find this file yourself?"
STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting"
STID_PSH_INDEX, "Help topics: "
}
......@@ -92,6 +92,7 @@ STID_ALL_FILES, " (*.*)"
STID_HELP_FILES_HLP, " (*.hlp)"
STID_FILE_NOT_FOUND_s " '%s'. ?"
STID_NO_RICHEDIT " richedit"
STID_PSH_INDEX, "Help topics: "
}
CONTEXT_MENU MENU LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
......
......@@ -94,6 +94,7 @@ STID_ALL_FILES, "Vse datoteke (*.*)"
STID_HELP_FILES_HLP, "Datoteke s pomočjo (*.hlp)"
STID_FILE_NOT_FOUND_s "Ne najdem datoteke '%s'. Ali jo želite poiskati sami?"
STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting"
STID_PSH_INDEX, "Help topics: "
}
#pragma code_page(default)
......@@ -80,4 +80,5 @@ STID_ALL_FILES, "Vetky sbory (*.*)"
STID_HELP_FILES_HLP, "Sbory pomoci (*.hlp)"
STID_FILE_NOT_FOUND_s "Cannot find '%s'. Do you want to find this file yourself?"
STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting"
STID_PSH_INDEX, "Help topics: "
}
......@@ -85,4 +85,5 @@ STID_ALL_FILES, "Alla filer (*.*)"
STID_HELP_FILES_HLP, "Hjälpfiler (*.hlp)"
STID_FILE_NOT_FOUND_s "Kan inte hitta '%s'. Vill du söka efter denna fil?"
STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting"
STID_PSH_INDEX, "Help topics: "
}
......@@ -82,4 +82,5 @@ STID_ALL_FILES, "Tm dosyalar (*.*)"
STID_HELP_FILES_HLP, "Yardm dosyalar (*.hlp)"
STID_FILE_NOT_FOUND_s "Cannot find '%s'. Do you want to find this file yourself?"
STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting"
STID_PSH_INDEX, "Help topics: "
}
......@@ -87,6 +87,7 @@ STID_ALL_FILES, "Tos les fitchs (*.*)"
STID_HELP_FILES_HLP, "Fitchs d' aide (*.hlp)"
STID_FILE_NOT_FOUND_s "Cannot find '%s'. Do you want to find this file yourself?"
STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting"
STID_PSH_INDEX, "Help topics: "
}
#endif /* LANG_WALON */
......@@ -83,4 +83,5 @@ STID_ALL_FILES, "ļ (*.*)"
STID_HELP_FILES_HLP, "帮助文件 (*.hlp)"
STID_FILE_NOT_FOUND_s "Cannot find '%s'. Do you want to find this file yourself?"
STID_NO_RICHEDIT "Cannot find a richedit implementation... Aborting"
STID_PSH_INDEX, "Help topics: "
}
......@@ -27,6 +27,9 @@
#include <stdarg.h>
#include <stdlib.h>
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
......@@ -36,6 +39,7 @@
#include "winhelp_res.h"
#include "shellapi.h"
#include "richedit.h"
#include "commctrl.h"
#include "wine/debug.h"
......@@ -1536,6 +1540,13 @@ static void cb_KWBTree(void *p, void **next, void *cookie)
*next = (char*)p + strlen((char*)p) + 7;
}
struct index_data
{
HLPFILE* hlpfile;
BOOL jump;
ULONG offset;
};
/**************************************************************************
* WINHELP_IndexDlgProc
*
......@@ -1546,23 +1557,24 @@ static void cb_KWBTree(void *p, void **next, void *cookie)
* >1: valid offset value +2.
* EndDialog itself can return 0 (error).
*/
INT_PTR CALLBACK WINHELP_SearchDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
INT_PTR CALLBACK WINHELP_IndexDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static HLPFILE *file;
static struct index_data* id;
int sel;
ULONG offset = 1;
switch (msg)
{
case WM_INITDIALOG:
file = (HLPFILE *)lParam;
HLPFILE_BPTreeEnum(file->kwbtree, cb_KWBTree,
id = (struct index_data*)((PROPSHEETPAGE*)lParam)->lParam;
HLPFILE_BPTreeEnum(id->hlpfile->kwbtree, cb_KWBTree,
GetDlgItem(hWnd, IDC_INDEXLIST));
id->jump = FALSE;
id->offset = 1;
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDOK:
case WM_NOTIFY:
switch (((NMHDR*)lParam)->code)
{
case PSN_APPLY:
sel = SendDlgItemMessage(hWnd, IDC_INDEXLIST, LB_GETCURSEL, 0, 0);
if (sel != LB_ERR)
{
......@@ -1575,24 +1587,25 @@ INT_PTR CALLBACK WINHELP_SearchDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARA
if (count > 1)
{
MessageBox(hWnd, "count > 1 not supported yet", "Error", MB_OK | MB_ICONSTOP);
SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_INVALID);
return TRUE;
}
offset = *(ULONG*)((char *)p + strlen((char *)p) + 3);
offset = *(long*)(file->kwdata + offset + 9);
if (offset == 0xFFFFFFFF)
id->offset = *(ULONG*)((char *)p + strlen((char *)p) + 3);
id->offset = *(long*)(id->hlpfile->kwdata + id->offset + 9);
if (id->offset == 0xFFFFFFFF)
{
MessageBox(hWnd, "macro keywords not supported yet", "Error", MB_OK | MB_ICONSTOP);
SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_INVALID);
return TRUE;
}
offset += 2;
id->jump = TRUE;
SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR);
}
/* Fall through */
case IDCANCEL:
EndDialog(hWnd, offset);
return TRUE;
default:
break;
return FALSE;
}
break;
default:
break;
}
......@@ -1607,28 +1620,53 @@ INT_PTR CALLBACK WINHELP_SearchDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARA
*/
BOOL WINHELP_CreateIndexWindow(void)
{
int ret;
HLPFILE *hlpfile;
HPROPSHEETPAGE psPage[3];
PROPSHEETPAGE psp;
PROPSHEETHEADER psHead;
struct index_data id;
char buf[256];
if (Globals.active_win && Globals.active_win->page && Globals.active_win->page->file)
hlpfile = Globals.active_win->page->file;
id.hlpfile = Globals.active_win->page->file;
else
return FALSE;
if (hlpfile->kwbtree == NULL)
if (id.hlpfile->kwbtree == NULL)
{
WINE_TRACE("No index provided\n");
return FALSE;
}
ret = DialogBoxParam(Globals.hInstance, MAKEINTRESOURCE(IDD_INDEX),
Globals.active_win->hMainWnd, WINHELP_SearchDlgProc,
(LPARAM)hlpfile);
if (ret > 1)
InitCommonControls();
id.jump = FALSE;
memset(&psp, 0, sizeof(psp));
psp.dwSize = sizeof(psp);
psp.dwFlags = 0;
psp.hInstance = Globals.hInstance;
psp.u.pszTemplate = MAKEINTRESOURCE(IDD_INDEX);
psp.lParam = (LPARAM)&id;
psp.pfnDlgProc = WINHELP_IndexDlgProc;
psPage[0] = CreatePropertySheetPage(&psp);
memset(&psHead, 0, sizeof(psHead));
psHead.dwSize = sizeof(psHead);
LoadString(Globals.hInstance, STID_PSH_INDEX, buf, sizeof(buf));
strcat(buf, Globals.active_win->info->caption);
psHead.pszCaption = buf;
psHead.nPages = 1;
psHead.hwndParent = Globals.active_win->hMainWnd;
psHead.u3.phpage = psPage;
psHead.dwFlags = PSH_NOAPPLYNOW;
PropertySheet(&psHead);
if (id.jump)
{
ret -= 2;
WINE_TRACE("got %d as an offset\n", ret);
WINHELP_OpenHelpWindow(HLPFILE_PageByOffset, hlpfile, ret,
WINE_TRACE("got %d as an offset\n", id.offset);
WINHELP_OpenHelpWindow(HLPFILE_PageByOffset, id.hlpfile, id.offset,
Globals.active_win->info, SW_NORMAL);
}
return TRUE;
......
......@@ -51,6 +51,7 @@
#define STID_DIALOG_TEST 0x12D
#define STID_FILE_NOT_FOUND_s 0x12E
#define STID_NO_RICHEDIT 0x12F
#define STID_PSH_INDEX 0x130
#define IDD_INDEX 0x150
#define IDC_INDEXLIST 0x151
......
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