Eric Pouech : winhelp: Enable/Disable prev/next buttons if there's a prev/ next page.
Alexandre Julliard
julliard at winehq.org
Wed Apr 23 07:59:31 CDT 2008
Module: wine
Branch: master
Commit: 3ae5ad8ede5e71b19df8d86e0555cf800019334c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3ae5ad8ede5e71b19df8d86e0555cf800019334c
Author: Eric Pouech <eric.pouech at orange.fr>
Date: Tue Apr 22 22:00:38 2008 +0200
winhelp: Enable/Disable prev/next buttons if there's a prev/next page.
---
programs/winhelp/macro.c | 7 +++++++
programs/winhelp/winhelp.c | 22 +++++++++++-----------
2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/programs/winhelp/macro.c b/programs/winhelp/macro.c
index 2ff1ad2..2c38b01 100644
--- a/programs/winhelp/macro.c
+++ b/programs/winhelp/macro.c
@@ -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)
diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c
index 13507d9..0801cd6 100644
--- a/programs/winhelp/winhelp.c
+++ b/programs/winhelp/winhelp.c
@@ -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;
More information about the wine-cvs
mailing list