Guidance
指路人
g.yi.org
Software / Reginald / Examples / odbcexam / ODBC_PickColumns.rex

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

  
/*
GUIBEGIN
WINDOW , 87, 151, 311, 153, POPUP|CAPTION|SYSMENU|MINBOX, , Pick Columns
	FONT 8, 400, MS Shell Dlg
	LIST 0, 0, 311, 133, NOTIFY|MULTI|BORDER|VSCROLL|HSCROLL|TABSTOP, INDEX, ODBC_Fields
	PUSH 105, 136, 40, 14, TABSTOP, , Ok, , Ok
	PUSH 174, 136, 40, 14, TABSTOP, , Cancel, , Cancel
DEND
GUIEND
*/

OPTIONS "NOSOURCE"

/************************ ODBC_PickColumns.rex *************************
 * This is a REXX GUI child (object) script that presents a (modal)
 * window containing a listbox that we fill with the column names of the
 * current table. The user can select as many columns as he desires.
 *
 * Author: Michael Simpson Copyright March 2005
 */


/* ========================== Create ==========================
 * Called when the main script creates an object that uses this
 * Window Layout script. (ie, The main script is doing a CreateObject
 * call where the first arg is the name of this Window Layout script).
 */
create: PROCEDURE EXPOSE sql_all_colname.
	guierr = "SYNTAX"
	guiheading = 1

	/* Create the window modal, but don't show it yet. We need to fill in
	 * the ODBC_Fields listbox first.
	 */
	guicreatewindow(, -1)

	/* Fill in the ODBC_Fields listbox with the column names. */
	DO i = 1 TO sql_all_colname.0
		guisendmsg("ODBC_Fields", "ADDSTRING",, sql_all_colname.i)
	END

	/* Now show the window. */
	guisetctlplacement(guiwindow,,,,,,'NORMAL')

	/* Return to our creator and let him do the (modal) message loop. */
	RETURN





destroy:
	guidestroywindow()
	RETURN





/* Called by our creator to fill in one of his own stems with our ODBC_Fields
 * variable (ie, what columns were selected, by INDEX).
 */
fillstem:
	USE ARG stem.

	stem.0 = odbc_fields.0
	DO i = 1 TO odbc_fields.0
		stem.i = odbc_fields.i
	END

	RETURN





/* Called by Reginald when our Cancel button is clicked. */
wm_click_cancel:
	/* Mimic the user clicking on the close box. */
	guisendmsg(, "POST CLOSE")

	RETURN





/* Called by Reginald when our Ok button is clicked. */
wm_click_ok:
	/* Grab the selections in the listbox. */
	guigetctlvalue("ODBC_Fields")

	/* Wake up our creator. When he gets this signal, he should call our FillStem(). */
	guiwake("OK")
	
	RETURN
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-3-29  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2010-07-16 20:49:09