Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
d72cfb73
Commit
d72cfb73
authored
Dec 13, 2007
by
Kirill K. Smirnov
Committed by
Alexandre Julliard
Dec 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhelp: Display keywords index dialog box.
parent
6a2ad1b4
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
173 additions
and
1 deletion
+173
-1
En.rc
programs/winhelp/En.rc
+10
-0
Ru.rc
programs/winhelp/Ru.rc
+10
-0
macro.c
programs/winhelp/macro.c
+1
-1
rsrc.rc
programs/winhelp/rsrc.rc
+1
-0
winhelp.c
programs/winhelp/winhelp.c
+146
-0
winhelp.h
programs/winhelp/winhelp.h
+2
-0
winhelp_res.h
programs/winhelp/winhelp_res.h
+3
-0
No files found.
programs/winhelp/En.rc
View file @
d72cfb73
...
...
@@ -50,6 +50,16 @@ MAIN_MENU MENU LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
}
}
IDD_INDEX DIALOG DISCARDABLE 0, 0, 200, 190 LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg"
CAPTION "Index"
{
LISTBOX IDC_INDEXLIST, 10, 10, 180, 150, LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_BORDER
PUSHBUTTON "&OK", IDOK, 40, 170, 50, 12
PUSHBUTTON "&Cancel", IDCANCEL, 120, 170, 50, 12
}
/* Strings */
STRINGTABLE DISCARDABLE LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
{
...
...
programs/winhelp/Ru.rc
View file @
d72cfb73
...
...
@@ -49,6 +49,16 @@ MAIN_MENU MENU LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
}
}
IDD_INDEX DIALOG DISCARDABLE 0, 0, 200, 190 LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg"
CAPTION ""
{
LISTBOX IDC_INDEXLIST, 10, 10, 180, 150, LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_BORDER
PUSHBUTTON "&OK", IDOK, 40, 170, 50, 12
PUSHBUTTON "&", IDCANCEL, 120, 170, 50, 12
}
/* Strings */
STRINGTABLE DISCARDABLE LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
{
...
...
programs/winhelp/macro.c
View file @
d72cfb73
...
...
@@ -523,7 +523,7 @@ void CALLBACK MACRO_Find(void)
void
CALLBACK
MACRO_Finder
(
void
)
{
WIN
E_FIXME
(
"()
\n
"
);
WIN
HELP_CreateIndexWindow
(
);
}
void
CALLBACK
MACRO_FloatingMenu
(
void
)
...
...
programs/winhelp/rsrc.rc
View file @
d72cfb73
...
...
@@ -20,6 +20,7 @@
*/
#include <windef.h>
#include <winuser.h>
#include "winhelp.h"
#include "winhelp_res.h"
...
...
programs/winhelp/winhelp.c
View file @
d72cfb73
...
...
@@ -672,6 +672,20 @@ BOOL WINHELP_CreateHelpWindowByMap(HLPFILE* hlpfile, LONG lMap,
/***********************************************************************
*
* WINHELP_CreateHelpWindowByOffset
*/
BOOL
WINHELP_CreateHelpWindowByOffset
(
HLPFILE
*
hlpfile
,
LONG
lOffset
,
HLPFILE_WINDOWINFO
*
wi
,
int
nCmdShow
)
{
HLPFILE_PAGE
*
page
=
NULL
;
page
=
HLPFILE_PageByOffset
(
hlpfile
,
lOffset
);
if
(
page
)
page
->
file
->
wRefCount
++
;
return
WINHELP_CreateHelpWindow
(
page
,
wi
,
nCmdShow
);
}
/***********************************************************************
*
* WINHELP_MainWndProc
*/
static
LRESULT
CALLBACK
WINHELP_MainWndProc
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
...
...
@@ -1933,3 +1947,135 @@ WINHELP_LINE_PART* WINHELP_IsOverLink(WINHELP_WINDOW* win, WPARAM wParam, LPARAM
return
NULL
;
}
/**************************************************************************
* cb_KWBTree
*
* HLPFILE_BPTreeCallback enumeration function for '|KWBTREE' internal file.
*
*/
static
void
cb_KWBTree
(
void
*
p
,
void
**
next
,
void
*
cookie
)
{
HWND
hListWnd
=
(
HWND
)
cookie
;
WINE_TRACE
(
"Adding '%s' to search list
\n
"
,
(
char
*
)
p
);
SendMessage
(
hListWnd
,
LB_INSERTSTRING
,
-
1
,
(
LPARAM
)
p
);
*
next
=
(
char
*
)
p
+
strlen
((
char
*
)
p
)
+
7
;
}
/**************************************************************************
* comp_KWBTREE
*
* HLPFILE_BPTreeCompare function for '|KWBTREE' internal file.
*
*/
static
int
comp_KWBTree
(
void
*
p
,
const
void
*
key
,
int
leaf
,
void
**
next
)
{
WINE_TRACE
(
"comparing key '%s' with '%s'
\n
"
,
(
char
*
)
p
,
(
char
*
)
key
);
*
next
=
(
char
*
)
p
+
strlen
(
p
)
+
1
+
(
leaf
?
6
:
2
);
/* unlike directory, index is case insensitive */
return
lstrcmpi
(
p
,
key
);
}
/**************************************************************************
* WINHELP_IndexDlgProc
*
* Index dialog callback function.
*
*/
INT_PTR
CALLBACK
WINHELP_SearchDlgProc
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
static
HLPFILE
*
file
;
int
sel
;
ULONG
offset
=
1
;
switch
(
msg
)
{
case
WM_INITDIALOG
:
file
=
(
HLPFILE
*
)
lParam
;
HLPFILE_BPTreeEnum
(
file
->
kwbtree
,
cb_KWBTree
,
GetDlgItem
(
hWnd
,
IDC_INDEXLIST
));
return
TRUE
;
case
WM_COMMAND
:
switch
(
LOWORD
(
wParam
))
{
case
IDOK
:
sel
=
SendDlgItemMessage
(
hWnd
,
IDC_INDEXLIST
,
LB_GETCURSEL
,
0
,
0
);
if
(
sel
!=
LB_ERR
)
{
char
buf
[
500
];
/* enough */
BYTE
*
p
;
int
count
;
SendDlgItemMessage
(
hWnd
,
IDC_INDEXLIST
,
LB_GETTEXT
,
sel
,
(
LPARAM
)
buf
);
p
=
HLPFILE_BPTreeSearch
(
file
->
kwbtree
,
buf
,
comp_KWBTree
);
if
(
p
==
NULL
)
{
/*
* TODO:
* This may happen if help file uses other locale than
* system. We should honour charset provided in help file
* and use UNICODE, but for now current implementation is
* acceptable (almost all help files use ANSI).
*/
WINE_FIXME
(
"item '%s' not found, locale mismatch???
\n
"
,
buf
);
return
TRUE
;
}
count
=
*
(
short
*
)((
char
*
)
p
+
strlen
((
char
*
)
p
)
+
1
);
if
(
count
>
1
)
{
MessageBox
(
hWnd
,
"count > 1 not supported yet"
,
"Error"
,
MB_OK
|
MB_ICONSTOP
);
return
TRUE
;
}
offset
=
*
(
ULONG
*
)((
char
*
)
p
+
strlen
((
char
*
)
p
)
+
3
);
offset
=
*
(
long
*
)(
file
->
kwdata
+
offset
+
9
);
if
(
offset
==
0xFFFFFFFF
)
{
MessageBox
(
hWnd
,
"macro keywords not supported yet"
,
"Error"
,
MB_OK
|
MB_ICONSTOP
);
return
TRUE
;
}
}
/* Fall through */
case
IDCANCEL
:
EndDialog
(
hWnd
,
offset
);
return
TRUE
;
default:
break
;
}
default:
break
;
}
return
FALSE
;
}
/**************************************************************************
* WINHELP_CreateIndexWindow
*
* Displays a dialog with keywords of current help file.
*
*/
BOOL
WINHELP_CreateIndexWindow
(
void
)
{
int
ret
;
HLPFILE
*
hlpfile
;
if
(
Globals
.
active_win
&&
Globals
.
active_win
->
page
&&
Globals
.
active_win
->
page
->
file
)
hlpfile
=
Globals
.
active_win
->
page
->
file
;
else
return
FALSE
;
if
(
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
)
WINHELP_CreateHelpWindowByOffset
(
hlpfile
,
ret
,
Globals
.
active_win
->
info
,
SW_NORMAL
);
return
TRUE
;
}
programs/winhelp/winhelp.h
View file @
d72cfb73
...
...
@@ -172,8 +172,10 @@ extern FARPROC Callbacks[];
BOOL
WINHELP_CreateHelpWindowByHash
(
HLPFILE
*
,
LONG
,
HLPFILE_WINDOWINFO
*
,
int
);
BOOL
WINHELP_CreateHelpWindowByMap
(
HLPFILE
*
,
LONG
,
HLPFILE_WINDOWINFO
*
,
int
);
BOOL
WINHELP_CreateHelpWindowByOffset
(
HLPFILE
*
,
LONG
,
HLPFILE_WINDOWINFO
*
,
int
);
BOOL
WINHELP_CreateHelpWindow
(
HLPFILE_PAGE
*
,
HLPFILE_WINDOWINFO
*
,
int
);
BOOL
WINHELP_GetOpenFileName
(
LPSTR
,
int
);
BOOL
WINHELP_CreateIndexWindow
(
void
);
INT
WINHELP_MessageBoxIDS
(
UINT
,
UINT
,
WORD
);
INT
WINHELP_MessageBoxIDS_s
(
UINT
,
LPCSTR
,
UINT
,
WORD
);
HLPFILE
*
WINHELP_LookupHelpFile
(
LPCSTR
lpszFile
);
...
...
programs/winhelp/winhelp_res.h
View file @
d72cfb73
...
...
@@ -30,3 +30,6 @@
#define STID_HELP_FILES_HLP 0x12C
#define STID_DIALOG_TEST 0x12D
#define STID_FILE_NOT_FOUND_s 0x12E
#define IDD_INDEX 0x150
#define IDC_INDEXLIST 0x151
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment