winhelp: Enable/Disable prev/next buttons if there's a prev/next page.

This commit is contained in:
Eric Pouech 2008-04-22 22:00:38 +02:00 committed by Alexandre Julliard
parent 7ae1bb28fe
commit 3ae5ad8ede
2 changed files with 18 additions and 11 deletions

View File

@ -245,10 +245,17 @@ void CALLBACK MACRO_BookmarkMore(void)
void CALLBACK MACRO_BrowseButtons(void)
{
HLPFILE_PAGE* page = Globals.active_win->page;
WINE_TRACE("()\n");
MACRO_CreateButton("BTN_PREV", "&<<", "Prev()");
MACRO_CreateButton("BTN_NEXT", "&>>", "Next()");
if (!HLPFILE_PageByOffset(page->file, page->browse_bwd))
MACRO_DisableButton("BTN_PREV");
if (!HLPFILE_PageByOffset(page->file, page->browse_fwd))
MACRO_DisableButton("BTN_NEXT");
}
void CALLBACK MACRO_ChangeButtonBinding(LPCSTR id, LPCSTR macro)

View File

@ -614,17 +614,6 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe
MACRO_CreateButton("BTN_TOPICS", buffer, "Finder()");
}
/* Initialize file specific pushbuttons */
if (!(wpage->wininfo->win_style & WS_POPUP) && wpage->page)
{
HLPFILE_MACRO *macro;
for (macro = wpage->page->file->first_macro; macro; macro = macro->next)
MACRO_ExecuteMacro(macro->lpszMacro);
for (macro = wpage->page->first_macro; macro; macro = macro->next)
MACRO_ExecuteMacro(macro->lpszMacro);
}
if (!bReUsed)
{
win->hMainWnd = CreateWindowEx((bPopup) ? WS_EX_TOOLWINDOW : 0, MAIN_WIN_CLASS_NAME,
@ -644,6 +633,17 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe
0, 0, 0, 0, win->hMainWnd, (HMENU)CTL_ID_TEXT, Globals.hInstance, win);
}
/* Initialize file specific pushbuttons */
if (!(wpage->wininfo->win_style & WS_POPUP) && wpage->page)
{
HLPFILE_MACRO *macro;
for (macro = wpage->page->file->first_macro; macro; macro = macro->next)
MACRO_ExecuteMacro(macro->lpszMacro);
for (macro = wpage->page->first_macro; macro; macro = macro->next)
MACRO_ExecuteMacro(macro->lpszMacro);
}
WINHELP_LayoutMainWindow(win);
if (bPopup) Globals.hPopupWnd = win->hMainWnd;