Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / Customize skeleton Window Layout

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

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Customize skeleton Window Layout
#6816
Posted by: misi01 2005-09-12 15:23:34
What do you all think about a feature whereby RPC would allow us to tailor the contents of a new Window Layout script? Right now, RPC's "New -> Window Layout" generates a script with specific contents. It would be nice if we could create our own skeleton code. Even nicer would be if we were able to "grab" control through another script and tailor the code that would be generated as the default.
Michael
Message2. Re: New window scripts
#6822
Posted by: Jeff Glatt 2005-09-12 17:14:35
Well, you could pretty much do this yourself.

Just write a macro that inserts the skeleton code you desire. Have it start off with a GUI comment that looks like:
/*
GUIBEGIN
WINDOW ,0,0,400,200, POPUP|CAPTION|SYSMENU|THICK|MINBOX|MAXBOX, , My Window
	FONT 8, 400, MS Shell Dlg
DEND
GUIEND
*/
Or, you could change the WINDOW line a little if you want different defaults. Or maybe add some other lines to define a MENU, string table, whatever.

Then follow it up with the skeleton code you want. Something like this:
/* Creates a custom Window Layout Script. */
OPTIONS "C_CALL NOSOURCE"

/* Here's my skeleton script */
skeleton = "/*" || "0D0A"X || "GUIBEGIN" || "0D0A"X ||,
/* Change the following line if you want a different WINDOW */,
"WINDOW ,0,0,400,200, POPUP|CAPTION|SYSMENU|THICK|MINBOX|MAXBOX, , My Window" || "0D0A"X ||,
"09"X || "FONT 8, 400, MS Shell Dlg" || "0D0A"X ||,
/* Add extra CONTROL lines here. Start each line with "09"X and end with || "0D0A"X ||, */,
"DEND"  || "0D0A"X || "GUIEND" || "0D0A"X || "*/" || "0d0a0d0a"X ||,
/* Change the following line if you want a different script description */,
"/* This is my skeleton script */" ||,
"0d0a0d0a"X || 'OPTIONS "c_call labelcheck nosource"' || "0d0a0d0a"X || "/* Load and register add-on functions. */" || "0d0a"X || "DO" || "0d0a09"X || "RXFUNCADD('rexxgui')" || "0d0a"X ||,
/* Insert lines here to RxFuncAdd() or FuncDef() any additional DLLs you use. Begin each line with "09"x and end with  || "0D0A"X ||, */ ,
"0D0A09"x || "CATCH FAILURE" || "0D0A0909"x || 'CONDITION("M")' || "0D0A0909"x || "RETURN" || "0D0A"x || "END" || "0D0A0D0A"x ||,
/* Change the following line to tailor error handling */,
'GuiErr = "SYNTAX"' || "0D0A"x || "GuiHeading = 1" ||,
"0D0A0D0A"x || "/* Create our window, and activate/show it */" || "0d0a"X || "guicreatewindow('NORMAL')" ||,
/* Insert lines here to initialize controls. End each line with  || "0D0A"X ||, */,
"Again:" || "0D0A"x || "DO FOREVER" || "0D0A0D0A09"x || "GuiGetMsg()"  || "0D0A09"x || "IF EXISTS('GuiObject') == 0 THEN DO" || "0D0A0909"x || "IF EXISTS('GuiSignal') THEN DO" ||,
"0D0A0909"x || "/* Insert handling for one of the main script's handlers calling GuiWake() */" ||,
"0d0a0909"X || "END" || "0d0a09"X || "END" || "0d0a09"X || "ELSE DO" || "0d0a0909"X || "IF EXISTS('GuiSignal') == 0 THEN DROP (guiobject)" || "0d0a0909"X || "ELSE SELECT guiobject"  || "0d0a0909"X ||,
"/* Here you add a WHEN clause for each child object variable name. You"  || "0D0A090909"X || "must uppercase the name. Then look at GuiSignal and do... whatever. */"  || "0d0a090909"X || "WHEN 0 THEN NOP" || "0d0a0d0a090909"X || "OTHERWISE" || "0d0a0909"X ||,
"END /* SELECT GuiObject */"  || "0d0a09"X || "END /* Some child script signaled us */" || "0d0a0d0a09"X ||, 
"CATCH SYNTAX" || "0d0a0909"X || "CONDITION('M')" || "0d0a0909"X || "SIGNAL again" || "0d0a0d0a09"X || "FINALLY" ||,
/* If you have any special cleanup to do, then you put it in this FINALLY. */,
"0D0A09"x || "GuiDestroyWindow()" || "0D0A"x || "END" || "0D0A"x ||  "RETURN"

rexxederr = "ERROR" /* Raise ERROR for any problems with RPC macro functions */
DO
	editopendoc() 			/* Open a new editor window */
	editselect(, , skeleton, 'TEXT')	/* Dump the contents of our skeleton Window Layout into it */
END
CATCH ERROR
	CONDITION("M")

Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-4-19  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0