winhelp: Added the notion of WINHELP_WNDPAGE and use it to move the history to the global variables.
This commit is contained in:
parent
7a608ea627
commit
6d40dbe3da
|
@ -220,9 +220,8 @@ void CALLBACK MACRO_Back(void)
|
||||||
|
|
||||||
WINE_TRACE("()\n");
|
WINE_TRACE("()\n");
|
||||||
|
|
||||||
if (win && win->backIndex >= 2)
|
if (win && win->back.index >= 2)
|
||||||
WINHELP_CreateHelpWindow(win->back[--win->backIndex - 1],
|
WINHELP_CreateHelpWindow(&win->back.set[--win->back.index - 1], SW_SHOW);
|
||||||
win->info, SW_SHOW);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CALLBACK MACRO_BackFlush(void)
|
void CALLBACK MACRO_BackFlush(void)
|
||||||
|
@ -235,12 +234,12 @@ void CALLBACK MACRO_BackFlush(void)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < win->backIndex; i++)
|
for (i = 0; i < win->back.index; i++)
|
||||||
{
|
{
|
||||||
HLPFILE_FreeHlpFile(win->back[i]->file);
|
HLPFILE_FreeHlpFile(win->back.set[i].page->file);
|
||||||
win->back[i] = NULL;
|
win->back.set[i].page = NULL;
|
||||||
}
|
}
|
||||||
win->backIndex = 0;
|
win->back.index = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -701,15 +700,16 @@ void CALLBACK MACRO_MPrintID(LPCSTR str)
|
||||||
|
|
||||||
void CALLBACK MACRO_Next(void)
|
void CALLBACK MACRO_Next(void)
|
||||||
{
|
{
|
||||||
HLPFILE_PAGE* page;
|
WINHELP_WNDPAGE wp;
|
||||||
|
|
||||||
WINE_TRACE("()\n");
|
WINE_TRACE("()\n");
|
||||||
page = Globals.active_win->page;
|
wp.page = Globals.active_win->page;
|
||||||
page = HLPFILE_PageByOffset(page->file, page->browse_fwd);
|
wp.page = HLPFILE_PageByOffset(wp.page->file, wp.page->browse_fwd);
|
||||||
if (page)
|
if (wp.page)
|
||||||
{
|
{
|
||||||
page->file->wRefCount++;
|
wp.page->file->wRefCount++;
|
||||||
WINHELP_CreateHelpWindow(page, Globals.active_win->info, SW_NORMAL);
|
wp.wininfo = Globals.active_win->info;
|
||||||
|
WINHELP_CreateHelpWindow(&wp, SW_NORMAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -740,15 +740,16 @@ void CALLBACK MACRO_PositionWindow(LONG i1, LONG i2, LONG u1, LONG u2, LONG u3,
|
||||||
|
|
||||||
void CALLBACK MACRO_Prev(void)
|
void CALLBACK MACRO_Prev(void)
|
||||||
{
|
{
|
||||||
HLPFILE_PAGE* page;
|
WINHELP_WNDPAGE wp;
|
||||||
|
|
||||||
WINE_TRACE("()\n");
|
WINE_TRACE("()\n");
|
||||||
page = Globals.active_win->page;
|
wp.page = Globals.active_win->page;
|
||||||
page = HLPFILE_PageByOffset(page->file, page->browse_bwd);
|
wp.page = HLPFILE_PageByOffset(wp.page->file, wp.page->browse_bwd);
|
||||||
if (page)
|
if (wp.page)
|
||||||
{
|
{
|
||||||
page->file->wRefCount++;
|
wp.page->file->wRefCount++;
|
||||||
WINHELP_CreateHelpWindow(page, Globals.active_win->info, SW_NORMAL);
|
wp.wininfo = Globals.active_win->info;
|
||||||
|
WINHELP_CreateHelpWindow(&wp, SW_NORMAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ static void WINHELP_DeleteButtons(WINHELP_WINDOW*);
|
||||||
static void WINHELP_SetupText(HWND hWnd);
|
static void WINHELP_SetupText(HWND hWnd);
|
||||||
static WINHELP_LINE_PART* WINHELP_IsOverLink(WINHELP_WINDOW*, WPARAM, LPARAM);
|
static WINHELP_LINE_PART* WINHELP_IsOverLink(WINHELP_WINDOW*, WPARAM, LPARAM);
|
||||||
|
|
||||||
WINHELP_GLOBALS Globals = {3, NULL, NULL, TRUE, NULL, NULL, NULL, NULL};
|
WINHELP_GLOBALS Globals = {3, NULL, NULL, TRUE, NULL, NULL, NULL, NULL, {{{NULL,NULL}},0}};
|
||||||
|
|
||||||
#define CTL_ID_BUTTON 0x700
|
#define CTL_ID_BUTTON 0x700
|
||||||
#define CTL_ID_TEXT 0x701
|
#define CTL_ID_TEXT 0x701
|
||||||
|
@ -484,35 +484,38 @@ static void WINHELP_AddHistory(WINHELP_WINDOW* win, HLPFILE_PAGE* page)
|
||||||
unsigned i, num;
|
unsigned i, num;
|
||||||
|
|
||||||
/* FIXME: when using back, we shouldn't update the history... */
|
/* FIXME: when using back, we shouldn't update the history... */
|
||||||
for (i = 0; i < win->histIndex; i++)
|
for (i = 0; i < Globals.history.index; i++)
|
||||||
if (win->history[i] == page) break;
|
if (Globals.history.set[i].page == page) break;
|
||||||
|
|
||||||
/* if the new page is already in the history, do nothing */
|
/* if the new page is already in the history, do nothing */
|
||||||
if (i == win->histIndex)
|
if (i == Globals.history.index)
|
||||||
{
|
{
|
||||||
num = sizeof(win->history) / sizeof(win->history[0]);
|
num = sizeof(Globals.history.set) / sizeof(Globals.history.set[0]);
|
||||||
if (win->histIndex == num)
|
if (Globals.history.index == num)
|
||||||
{
|
{
|
||||||
/* we're full, remove latest entry */
|
/* we're full, remove latest entry */
|
||||||
HLPFILE_FreeHlpFile(win->history[0]->file);
|
HLPFILE_FreeHlpFile(Globals.history.set[0].page->file);
|
||||||
memmove(&win->history[0], &win->history[1],
|
memmove(&Globals.history.set[0], &Globals.history.set[1],
|
||||||
(num - 1) * sizeof(win->history[0]));
|
(num - 1) * sizeof(Globals.history.set[0]));
|
||||||
win->histIndex--;
|
Globals.history.index--;
|
||||||
}
|
}
|
||||||
win->history[win->histIndex++] = page;
|
Globals.history.set[Globals.history.index].page = page;
|
||||||
|
Globals.history.set[Globals.history.index++].wininfo = win->info;
|
||||||
page->file->wRefCount++;
|
page->file->wRefCount++;
|
||||||
if (win->hHistoryWnd) InvalidateRect(win->hHistoryWnd, NULL, TRUE);
|
if (win->hHistoryWnd) InvalidateRect(win->hHistoryWnd, NULL, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
num = sizeof(win->back) / sizeof(win->back[0]);
|
num = sizeof(win->back.set) / sizeof(win->back.set[0]);
|
||||||
if (win->backIndex == num)
|
if (win->back.index == num)
|
||||||
{
|
{
|
||||||
/* we're full, remove latest entry */
|
/* we're full, remove latest entry */
|
||||||
HLPFILE_FreeHlpFile(win->back[0]->file);
|
HLPFILE_FreeHlpFile(win->back.set[0].page->file);
|
||||||
memmove(&win->back[0], &win->back[1], (num - 1) * sizeof(win->back[0]));
|
memmove(&win->back.set[0], &win->back.set[1],
|
||||||
win->backIndex--;
|
(num - 1) * sizeof(win->back.set[0]));
|
||||||
|
win->back.index--;
|
||||||
}
|
}
|
||||||
win->back[win->backIndex++] = page;
|
win->back.set[win->back.index].page = page;
|
||||||
|
win->back.set[win->back.index++].wininfo = win->info;
|
||||||
page->file->wRefCount++;
|
page->file->wRefCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -520,39 +523,38 @@ static void WINHELP_AddHistory(WINHELP_WINDOW* win, HLPFILE_PAGE* page)
|
||||||
*
|
*
|
||||||
* WINHELP_CreateHelpWindow
|
* WINHELP_CreateHelpWindow
|
||||||
*/
|
*/
|
||||||
BOOL WINHELP_CreateHelpWindow(HLPFILE_PAGE* page, HLPFILE_WINDOWINFO* wi,
|
BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow)
|
||||||
int nCmdShow)
|
|
||||||
{
|
{
|
||||||
WINHELP_WINDOW* win = NULL;
|
WINHELP_WINDOW* win = NULL;
|
||||||
BOOL bPrimary, bPopup, bReUsed = FALSE;
|
BOOL bPrimary, bPopup, bReUsed = FALSE;
|
||||||
LPSTR name;
|
LPSTR name;
|
||||||
|
|
||||||
bPrimary = !lstrcmpi(wi->name, "main");
|
bPrimary = !lstrcmpi(wpage->wininfo->name, "main");
|
||||||
bPopup = !bPrimary && (wi->win_style & WS_POPUP);
|
bPopup = !bPrimary && (wpage->wininfo->win_style & WS_POPUP);
|
||||||
|
|
||||||
if (page && !page->first_paragraph) HLPFILE_BrowsePage(page);
|
if (wpage->page && !wpage->page->first_paragraph) HLPFILE_BrowsePage(wpage->page);
|
||||||
|
|
||||||
if (!bPopup)
|
if (!bPopup)
|
||||||
{
|
{
|
||||||
for (win = Globals.win_list; win; win = win->next)
|
for (win = Globals.win_list; win; win = win->next)
|
||||||
{
|
{
|
||||||
if (!lstrcmpi(win->lpszName, wi->name))
|
if (!lstrcmpi(win->lpszName, wpage->wininfo->name))
|
||||||
{
|
{
|
||||||
WINHELP_DeleteButtons(win);
|
WINHELP_DeleteButtons(win);
|
||||||
bReUsed = TRUE;
|
bReUsed = TRUE;
|
||||||
SetWindowText(win->hMainWnd, wi->caption);
|
SetWindowText(win->hMainWnd, wpage->wininfo->caption);
|
||||||
if (wi->origin.x != CW_USEDEFAULT &&
|
if (wpage->wininfo->origin.x != CW_USEDEFAULT &&
|
||||||
wi->origin.y != CW_USEDEFAULT)
|
wpage->wininfo->origin.y != CW_USEDEFAULT)
|
||||||
SetWindowPos(win->hMainWnd, HWND_TOP,
|
SetWindowPos(win->hMainWnd, HWND_TOP,
|
||||||
wi->origin.x, wi->origin.y, 0, 0, SWP_NOSIZE);
|
wpage->wininfo->origin.x, wpage->wininfo->origin.y, 0, 0, SWP_NOSIZE);
|
||||||
if (wi->size.cx != CW_USEDEFAULT &&
|
if (wpage->wininfo->size.cx != CW_USEDEFAULT &&
|
||||||
wi->size.cy != CW_USEDEFAULT)
|
wpage->wininfo->size.cy != CW_USEDEFAULT)
|
||||||
SetWindowPos(win->hMainWnd, HWND_TOP,
|
SetWindowPos(win->hMainWnd, HWND_TOP,
|
||||||
0, 0, wi->size.cx, wi->size.cy, SWP_NOMOVE);
|
0, 0, wpage->wininfo->size.cx, wpage->wininfo->size.cy, SWP_NOMOVE);
|
||||||
WINHELP_InitFonts(win->hMainWnd);
|
WINHELP_InitFonts(win->hMainWnd);
|
||||||
|
|
||||||
win->page = page;
|
win->page = wpage->page;
|
||||||
win->info = wi;
|
win->info = wpage->wininfo;
|
||||||
WINHELP_SetupText(GetDlgItem(win->hMainWnd, CTL_ID_TEXT));
|
WINHELP_SetupText(GetDlgItem(win->hMainWnd, CTL_ID_TEXT));
|
||||||
InvalidateRect(win->hMainWnd, NULL, TRUE);
|
InvalidateRect(win->hMainWnd, NULL, TRUE);
|
||||||
if (win->hHistoryWnd) InvalidateRect(win->hHistoryWnd, NULL, TRUE);
|
if (win->hHistoryWnd) InvalidateRect(win->hHistoryWnd, NULL, TRUE);
|
||||||
|
@ -565,33 +567,33 @@ BOOL WINHELP_CreateHelpWindow(HLPFILE_PAGE* page, HLPFILE_WINDOWINFO* wi,
|
||||||
{
|
{
|
||||||
/* Initialize WINHELP_WINDOW struct */
|
/* Initialize WINHELP_WINDOW struct */
|
||||||
win = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
|
win = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
|
||||||
sizeof(WINHELP_WINDOW) + strlen(wi->name) + 1);
|
sizeof(WINHELP_WINDOW) + strlen(wpage->wininfo->name) + 1);
|
||||||
if (!win) return FALSE;
|
if (!win) return FALSE;
|
||||||
win->next = Globals.win_list;
|
win->next = Globals.win_list;
|
||||||
Globals.win_list = win;
|
Globals.win_list = win;
|
||||||
|
|
||||||
name = (char*)win + sizeof(WINHELP_WINDOW);
|
name = (char*)win + sizeof(WINHELP_WINDOW);
|
||||||
lstrcpy(name, wi->name);
|
lstrcpy(name, wpage->wininfo->name);
|
||||||
win->lpszName = name;
|
win->lpszName = name;
|
||||||
win->hHandCur = LoadCursorW(0, (LPWSTR)IDC_HAND);
|
win->hHandCur = LoadCursorW(0, (LPWSTR)IDC_HAND);
|
||||||
win->histIndex = win->backIndex = 0;
|
win->back.index = 0;
|
||||||
}
|
}
|
||||||
win->page = page;
|
win->page = wpage->page;
|
||||||
win->info = wi;
|
win->info = wpage->wininfo;
|
||||||
|
|
||||||
win->hArrowCur = LoadCursorA(0, (LPSTR)IDC_ARROW);
|
win->hArrowCur = LoadCursorA(0, (LPSTR)IDC_ARROW);
|
||||||
win->hHandCur = LoadCursorA(0, (LPSTR)IDC_HAND);
|
win->hHandCur = LoadCursorA(0, (LPSTR)IDC_HAND);
|
||||||
|
|
||||||
if (!bPopup && page)
|
if (!bPopup && wpage->page)
|
||||||
{
|
{
|
||||||
WINHELP_AddHistory(win, page);
|
WINHELP_AddHistory(win, wpage->page);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bPopup)
|
if (!bPopup)
|
||||||
Globals.active_win = win;
|
Globals.active_win = win;
|
||||||
|
|
||||||
/* Initialize default pushbuttons */
|
/* Initialize default pushbuttons */
|
||||||
if (bPrimary && page)
|
if (bPrimary && wpage->page)
|
||||||
{
|
{
|
||||||
CHAR buffer[MAX_STRING_LEN];
|
CHAR buffer[MAX_STRING_LEN];
|
||||||
|
|
||||||
|
@ -608,22 +610,23 @@ BOOL WINHELP_CreateHelpWindow(HLPFILE_PAGE* page, HLPFILE_WINDOWINFO* wi,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize file specific pushbuttons */
|
/* Initialize file specific pushbuttons */
|
||||||
if (!(wi->win_style & WS_POPUP) && page)
|
if (!(wpage->wininfo->win_style & WS_POPUP) && wpage->page)
|
||||||
{
|
{
|
||||||
HLPFILE_MACRO *macro;
|
HLPFILE_MACRO *macro;
|
||||||
for (macro = page->file->first_macro; macro; macro = macro->next)
|
for (macro = wpage->page->file->first_macro; macro; macro = macro->next)
|
||||||
MACRO_ExecuteMacro(macro->lpszMacro);
|
MACRO_ExecuteMacro(macro->lpszMacro);
|
||||||
|
|
||||||
for (macro = page->first_macro; macro; macro = macro->next)
|
for (macro = wpage->page->first_macro; macro; macro = macro->next)
|
||||||
MACRO_ExecuteMacro(macro->lpszMacro);
|
MACRO_ExecuteMacro(macro->lpszMacro);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bReUsed)
|
if (!bReUsed)
|
||||||
{
|
{
|
||||||
win->hMainWnd = CreateWindowEx((bPopup) ? WS_EX_TOOLWINDOW : 0, MAIN_WIN_CLASS_NAME,
|
win->hMainWnd = CreateWindowEx((bPopup) ? WS_EX_TOOLWINDOW : 0, MAIN_WIN_CLASS_NAME,
|
||||||
wi->caption,
|
wpage->wininfo->caption,
|
||||||
bPrimary ? WS_OVERLAPPEDWINDOW : wi->win_style,
|
bPrimary ? WS_OVERLAPPEDWINDOW : wpage->wininfo->win_style,
|
||||||
wi->origin.x, wi->origin.y, wi->size.cx, wi->size.cy,
|
wpage->wininfo->origin.x, wpage->wininfo->origin.y,
|
||||||
|
wpage->wininfo->size.cx, wpage->wininfo->size.cy,
|
||||||
bPopup ? Globals.active_win->hMainWnd : NULL,
|
bPopup ? Globals.active_win->hMainWnd : NULL,
|
||||||
bPrimary ? LoadMenu(Globals.hInstance, MAKEINTRESOURCE(MAIN_MENU)) : 0,
|
bPrimary ? LoadMenu(Globals.hInstance, MAKEINTRESOURCE(MAIN_MENU)) : 0,
|
||||||
Globals.hInstance, win);
|
Globals.hInstance, win);
|
||||||
|
@ -652,13 +655,15 @@ BOOL WINHELP_CreateHelpWindow(HLPFILE_PAGE* page, HLPFILE_WINDOWINFO* wi,
|
||||||
BOOL WINHELP_CreateHelpWindowByHash(HLPFILE* hlpfile, LONG lHash,
|
BOOL WINHELP_CreateHelpWindowByHash(HLPFILE* hlpfile, LONG lHash,
|
||||||
HLPFILE_WINDOWINFO* wi, int nCmdShow)
|
HLPFILE_WINDOWINFO* wi, int nCmdShow)
|
||||||
{
|
{
|
||||||
HLPFILE_PAGE* page = NULL;
|
WINHELP_WNDPAGE wpage;
|
||||||
|
|
||||||
|
wpage.page = NULL;
|
||||||
if (hlpfile)
|
if (hlpfile)
|
||||||
page = lHash ? HLPFILE_PageByHash(hlpfile, lHash) :
|
wpage.page = lHash ? HLPFILE_PageByHash(hlpfile, lHash) :
|
||||||
HLPFILE_Contents(hlpfile);
|
HLPFILE_Contents(hlpfile);
|
||||||
if (page) page->file->wRefCount++;
|
if (wpage.page) wpage.page->file->wRefCount++;
|
||||||
return WINHELP_CreateHelpWindow(page, wi, nCmdShow);
|
wpage.wininfo = wi;
|
||||||
|
return WINHELP_CreateHelpWindow(&wpage, nCmdShow);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -668,11 +673,12 @@ BOOL WINHELP_CreateHelpWindowByHash(HLPFILE* hlpfile, LONG lHash,
|
||||||
BOOL WINHELP_CreateHelpWindowByMap(HLPFILE* hlpfile, LONG lMap,
|
BOOL WINHELP_CreateHelpWindowByMap(HLPFILE* hlpfile, LONG lMap,
|
||||||
HLPFILE_WINDOWINFO* wi, int nCmdShow)
|
HLPFILE_WINDOWINFO* wi, int nCmdShow)
|
||||||
{
|
{
|
||||||
HLPFILE_PAGE* page = NULL;
|
WINHELP_WNDPAGE wpage;
|
||||||
|
|
||||||
page = HLPFILE_PageByMap(hlpfile, lMap);
|
wpage.page = HLPFILE_PageByMap(hlpfile, lMap);
|
||||||
if (page) page->file->wRefCount++;
|
if (wpage.page) wpage.page->file->wRefCount++;
|
||||||
return WINHELP_CreateHelpWindow(page, wi, nCmdShow);
|
wpage.wininfo = wi;
|
||||||
|
return WINHELP_CreateHelpWindow(&wpage, nCmdShow);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -682,11 +688,12 @@ BOOL WINHELP_CreateHelpWindowByMap(HLPFILE* hlpfile, LONG lMap,
|
||||||
BOOL WINHELP_CreateHelpWindowByOffset(HLPFILE* hlpfile, LONG lOffset,
|
BOOL WINHELP_CreateHelpWindowByOffset(HLPFILE* hlpfile, LONG lOffset,
|
||||||
HLPFILE_WINDOWINFO* wi, int nCmdShow)
|
HLPFILE_WINDOWINFO* wi, int nCmdShow)
|
||||||
{
|
{
|
||||||
HLPFILE_PAGE* page = NULL;
|
WINHELP_WNDPAGE wpage;
|
||||||
|
|
||||||
page = HLPFILE_PageByOffset(hlpfile, lOffset);
|
wpage.page = HLPFILE_PageByOffset(hlpfile, lOffset);
|
||||||
if (page) page->file->wRefCount++;
|
if (wpage.page) wpage.page->file->wRefCount++;
|
||||||
return WINHELP_CreateHelpWindow(page, wi, nCmdShow);
|
wpage.wininfo = wi;
|
||||||
|
return WINHELP_CreateHelpWindow(&wpage, nCmdShow);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -1266,7 +1273,7 @@ static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND hWnd, UINT msg, WPARAM wPara
|
||||||
GetWindowRect(hWnd, &r);
|
GetWindowRect(hWnd, &r);
|
||||||
|
|
||||||
r.right = r.left + 30 * tm.tmAveCharWidth;
|
r.right = r.left + 30 * tm.tmAveCharWidth;
|
||||||
r.bottom = r.top + (sizeof(win->history) / sizeof(win->history[0])) * tm.tmHeight;
|
r.bottom = r.top + (sizeof(Globals.history.set) / sizeof(Globals.history.set[0])) * tm.tmHeight;
|
||||||
AdjustWindowRect(&r, GetWindowLong(hWnd, GWL_STYLE), FALSE);
|
AdjustWindowRect(&r, GetWindowLong(hWnd, GWL_STYLE), FALSE);
|
||||||
if (r.left < 0) {r.right -= r.left; r.left = 0;}
|
if (r.left < 0) {r.right -= r.left; r.left = 0;}
|
||||||
if (r.top < 0) {r.bottom -= r.top; r.top = 0;}
|
if (r.top < 0) {r.bottom -= r.top; r.top = 0;}
|
||||||
|
@ -1279,8 +1286,8 @@ static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND hWnd, UINT msg, WPARAM wPara
|
||||||
hDc = GetDC(hWnd);
|
hDc = GetDC(hWnd);
|
||||||
GetTextMetrics(hDc, &tm);
|
GetTextMetrics(hDc, &tm);
|
||||||
i = HIWORD(lParam) / tm.tmHeight;
|
i = HIWORD(lParam) / tm.tmHeight;
|
||||||
if (i < win->histIndex)
|
if (i < Globals.history.index)
|
||||||
WINHELP_CreateHelpWindow(win->history[i], win->info, SW_SHOW);
|
WINHELP_CreateHelpWindow(&Globals.history.set[i], SW_SHOW);
|
||||||
ReleaseDC(hWnd, hDc);
|
ReleaseDC(hWnd, hDc);
|
||||||
break;
|
break;
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
|
@ -1288,10 +1295,10 @@ static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND hWnd, UINT msg, WPARAM wPara
|
||||||
win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0);
|
win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0);
|
||||||
GetTextMetrics(hDc, &tm);
|
GetTextMetrics(hDc, &tm);
|
||||||
|
|
||||||
for (i = 0; i < win->histIndex; i++)
|
for (i = 0; i < Globals.history.index; i++)
|
||||||
{
|
{
|
||||||
TextOut(hDc, 0, i * tm.tmHeight, win->history[i]->lpszTitle,
|
TextOut(hDc, 0, i * tm.tmHeight, Globals.history.set[i].page->lpszTitle,
|
||||||
strlen(win->history[i]->lpszTitle));
|
strlen(Globals.history.set[i].page->lpszTitle));
|
||||||
}
|
}
|
||||||
EndPaint(hWnd, &ps);
|
EndPaint(hWnd, &ps);
|
||||||
break;
|
break;
|
||||||
|
@ -1818,13 +1825,8 @@ static void WINHELP_DeleteWindow(WINHELP_WINDOW* win)
|
||||||
|
|
||||||
DeleteObject(win->hBrush);
|
DeleteObject(win->hBrush);
|
||||||
|
|
||||||
for (i = 0; i < win->histIndex; i++)
|
for (i = 0; i < win->back.index; i++)
|
||||||
{
|
HLPFILE_FreeHlpFile(win->back.set[i].page->file);
|
||||||
HLPFILE_FreeHlpFile(win->history[i]->file);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < win->backIndex; i++)
|
|
||||||
HLPFILE_FreeHlpFile(win->back[i]->file);
|
|
||||||
|
|
||||||
if (win->page) HLPFILE_FreeHlpFile(win->page->file);
|
if (win->page) HLPFILE_FreeHlpFile(win->page->file);
|
||||||
WINHELP_DeleteLines(win);
|
WINHELP_DeleteLines(win);
|
||||||
|
|
|
@ -91,6 +91,19 @@ typedef struct tagHelpButton
|
||||||
struct tagHelpButton*next;
|
struct tagHelpButton*next;
|
||||||
} WINHELP_BUTTON;
|
} WINHELP_BUTTON;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
HLPFILE_PAGE* page;
|
||||||
|
HLPFILE_WINDOWINFO* wininfo;
|
||||||
|
} WINHELP_WNDPAGE;
|
||||||
|
|
||||||
|
typedef struct tagPageSet
|
||||||
|
{
|
||||||
|
/* FIXME: for now it's a fixed size */
|
||||||
|
WINHELP_WNDPAGE set[40];
|
||||||
|
unsigned index;
|
||||||
|
} WINHELP_PAGESET;
|
||||||
|
|
||||||
typedef struct tagWinHelp
|
typedef struct tagWinHelp
|
||||||
{
|
{
|
||||||
LPCSTR lpszName;
|
LPCSTR lpszName;
|
||||||
|
@ -113,11 +126,7 @@ typedef struct tagWinHelp
|
||||||
|
|
||||||
HLPFILE_WINDOWINFO* info;
|
HLPFILE_WINDOWINFO* info;
|
||||||
|
|
||||||
/* FIXME: for now it's a fixed size */
|
WINHELP_PAGESET back;
|
||||||
HLPFILE_PAGE* history[40];
|
|
||||||
unsigned histIndex;
|
|
||||||
HLPFILE_PAGE* back[40];
|
|
||||||
unsigned backIndex;
|
|
||||||
|
|
||||||
struct tagWinHelp* next;
|
struct tagWinHelp* next;
|
||||||
} WINHELP_WINDOW;
|
} WINHELP_WINDOW;
|
||||||
|
@ -162,6 +171,7 @@ typedef struct
|
||||||
WINHELP_WINDOW* win_list;
|
WINHELP_WINDOW* win_list;
|
||||||
WNDPROC button_proc;
|
WNDPROC button_proc;
|
||||||
WINHELP_DLL* dlls;
|
WINHELP_DLL* dlls;
|
||||||
|
WINHELP_PAGESET history;
|
||||||
} WINHELP_GLOBALS;
|
} WINHELP_GLOBALS;
|
||||||
|
|
||||||
extern WINHELP_GLOBALS Globals;
|
extern WINHELP_GLOBALS Globals;
|
||||||
|
@ -170,7 +180,7 @@ extern FARPROC Callbacks[];
|
||||||
BOOL WINHELP_CreateHelpWindowByHash(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int);
|
BOOL WINHELP_CreateHelpWindowByHash(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int);
|
||||||
BOOL WINHELP_CreateHelpWindowByMap(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int);
|
BOOL WINHELP_CreateHelpWindowByMap(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int);
|
||||||
BOOL WINHELP_CreateHelpWindowByOffset(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int);
|
BOOL WINHELP_CreateHelpWindowByOffset(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int);
|
||||||
BOOL WINHELP_CreateHelpWindow(HLPFILE_PAGE*, HLPFILE_WINDOWINFO*, int);
|
BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE*, int);
|
||||||
BOOL WINHELP_GetOpenFileName(LPSTR, int);
|
BOOL WINHELP_GetOpenFileName(LPSTR, int);
|
||||||
BOOL WINHELP_CreateIndexWindow(void);
|
BOOL WINHELP_CreateIndexWindow(void);
|
||||||
INT WINHELP_MessageBoxIDS(UINT, UINT, WORD);
|
INT WINHELP_MessageBoxIDS(UINT, UINT, WORD);
|
||||||
|
|
Loading…
Reference in New Issue