I would like to see if it's possible to put in a function to do a CloseButton that accepts a regular expresion to specify the buttons to close. What I'm trying to do is create a generic function to create a set of buttons in a standard GUI format, and anohter function to close it. The creation code works fine, but the problem is that when I try to use a generic close function, I don't know what the names of the buttons that have been laid over the standard frame. If I can do something like 'ClosePrivButtonRegex("prefix_.*")' then that would enable me to close all of the buttons that use that prefix and make life a lot easier. Code below:
<?php
Sub kGUICreate ( $userName, $GUIprefix, $origL, $origT, $GUIwidth, $GUIHeight, $GUItitle, $showClose, $secondsDisplayed)
# Draw window titles with Prev, Next and Close buttons
openButton ( $userName, $GUIprefix . "_bg",$origL-1,$origT-10,$GUIwidth+2,$GUIHeight+18,1,-1,16,"");
openButton ( $userName, $GUIprefix . "_title",$origL,$origT-10,$GUIwidth,10,5,-1,0,"^0" . $GUItitle );
IF ($showClose == true)
THEN
openButton ( $userName, $GUIprefix . "_close",81,$origT+$GUIHeight+1,38,6,8,-1,16,"^0[ Close This Dialog ]",kGUIclose );
ENDIF
# Draw the main contents window on top of the titles
openButton ( $userName, $GUIprefix . "_contents_bg",$origL,$origT,$GUIwidth,$GUIHeight,1,-1,32,"");
EndSub
Sub kGUIclose ( $KeyFlags, $id )
$GUIprefix = split( $id,"_",0 );
closePrivButtonRegex ($GUIprefix);
EndSub
?>
PS: Also allow this for the new CloseButton function to do this for a nominated user