Guidance
指路人
g.yi.org
Upload / Forum Attachment / Reginald Rexx Programming Language Compiler User Forum Attachments and Pictures / 13236-guiaddmenu_problem.rex

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

  
/*

GUIBEGIN


WINDOW , 0, 0, 365, 315, POPUP|CAPTION|SYSMENU|MINBOX|MAXBOX|THICK, , Skeleton script
	FONT 8, 400, MS Shell Dlg
	MENU
	STATUS BOTTOM|GRIP, status_bar
DEND

MENU
	HEADING &Help
		ITEM Help option 1
		ITEM Help option 2
	<
DEND
GUIEND

*/

LIBRARY rexxgui
guierr = "SYNTAX"
guiheading = 1

DO
	MACRO utilities
	CATCH SYNTAX	
		NOP
END		
rc = pre_create_window()
IF rc = 1 THEN 
	RETURN
guicreatewindow()
rc = post_create_window()
guisetctlvalue()
guisetctlplacement(,,,,,,'NORMAL')
again:
DO FOREVER
	guigetmsg()
	IF EXISTS('GuiObject') == 0 THEN 
		DO
			IF EXISTS('GuiSignal') THEN
				DO
					SELECT guisignal
						WHEN 'CLOSE' THEN
							LEAVE
						WHEN 'OTHER_OPTION' THEN
							NOP
						OTHERWISE
							NOP
					END		
				END
		END
	ELSE
		DO
			rc = determine_child_request()
		END 
	CATCH SYNTAX
		err = CONDITION('E')
		IF err <> 109 THEN
			DO
				CONDITION('M')		
				SIGNAL again		
			END
	CATCH HALT
		/* If you have any special cleanup to do, then you put it in this FINALLY. */
		guidestroywindow()
END
RETURN
/*********************************************************************
 It seems easier to code the main window this way. 
*********************************************************************/ 
determine_child_request:
RETURN 0
/*******************************************************************
 General pre-show window procedure. Allows you to set a few global  
 variables used in the script as wel as possibly fetching registry  
 entries to be shown in specific fields                             
*******************************************************************/
pre_create_window:
RETURN 0
/*****************************************************************
 Allows you to manipulate the controls - something you CAN'T do 
 until the window has been created
*****************************************************************/
post_create_window:
/* Note that the problem with this script is the fact that if you add
   meanu items AND have a status bar, they don't both work */
statusbarwidths.1 = 150
statusbarwidths.2 = -1
guiaddctltext('status_bar', 2, 'statusbarwidths')
status_bar =  'Default database is unknown'
/* ... update the status bar so we know which DB we're using */
guisetctlvalue('status_bar', 1 )
rc = change_db2_source.rex("I") 
RETURN 0
odbc_source.1:
SAY "We chose DB2 source.1"
rc = db2_menu_changed(1)
RETURN
odbc_source.2:
SAY "We chose DB2 source.2"
rc = db2_menu_changed(2)
RETURN 
odbc_source.3:
SAY "We chose DB2 source.3"
rc = db2_menu_changed(3)
RETURN 
odbc_source.4:
SAY "We chose DB2 source.4"
rc = db2_menu_changed(4)
RETURN 
/************************************************************

************************************************************/
db2_menu_changed:
ARG menu_position
rc = change_db2_source.rex("C", menu_position)
RETURN 0
/**************************************************************
 Closing down the window - clean up as required              	 
**************************************************************/
wm_close:
RETURN
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Thu 2024-5-2  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2010-03-08 22:56:18