Guidance
指路人
g.yi.org
Software / Reginald / Examples / help2 / HelpContents.rex

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
/*
GUIBEGIN
WINDOW , 27, 67, 115, 201, DOCK|EMBED|CAPTION|SYSMENU, , Help contents
	FONT 8, 400, MS Shell Dlg
	TREE 0, 0, 70, 70, LINES|ROOT|ALWAYS|REALHEIGHT, , Selection, , MyHeadings
DEND
GUIEND
*/

/* This child script simply displays a docking window that contains a
 * a TREE control (which fills the docking window) listing the pages in
 * our "help book".
 *
 * It is assumed that the creator passes one extra arg to CreateObject --
 * the parent window handle.
 */

create:
	guierr = "SYNTAX"
	guiheading = 1

	/* Initialize the TREE variables. We'll put the titles of the
	 * pages in MyHeadings. stem, and the respective URLs in MyUrls.
	 * stem.
	 */
	myheadings.1 = "File menu"
	myheadings.1.1 = "Open"
	myheadings.1.2 = "Save"
	myheadings.1.3 = "Exit"

	myurls.1 = ""	/* No page associated with this */
	myurls.1.1 = "FileOpen"
	myurls.1.2 = "FileSave"
	myurls.1.3 = "FileExit"

	/* Create a docked window, with the caller's window as owner. */
	guicreatewindow("NORMAL", ARG(1))

	RETURN

destroy:
	guidestroywindow()
	RETURN

/* Called by Reginald when the docking window is resized. */
wm_size:
	/* Resize the HTML control so that it fills our window. We do this
	 * by calling GuiSetCtlPlacement, with the same X, Y, Width and Height
	 * as our size event now. But don't do this until the HTML control
	 * is finally created (ie, SIZE events can happen for the window
	 * before its controls are created).
	 */
	IF guiinfo("HANDLE", "Selection", 2) \== "" THEN
		guisetctlplacement("Selection", ARG(1), ARG(2), ARG(3), ARG(4))
	RETURN ""

/* Called by Reginald when the Tree's selection changes. */
wm_selchanged_selection:
	/* Get the selection. */
	guigetctlvalue("Selection")

	/* Get the respective URL. */
	url = VALUE("MyUrls."||selection)

	/* Is it not blank? */
	IF url \== "" THEN

		/* Wake up the main script with that URL as the signal */
		guiwake("its:Help.chm::" || url || ".htm")

	ELSE
		/* You could blank the page, or just not wake the main script. Depends
		 * what you want the reference window to display when he clicks on
		 * some heading that doesn't have a web page.
		 */
		guiwake("about:blank")

	RETURN
掌柜推荐
 
 
¥860.00 ·
 
 
¥900.00 ·
 
 
¥810.00 ·
 
 
¥317.00 ·
 
 
¥1,370.00 ·
 
 
¥660.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2010-07-16 20:48:53