Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Change Active Window Frame Color

226 views
Skip to first unread message

Rob Zenuk

unread,
Jan 18, 2002, 11:50:12 AM1/18/02
to
Several years ago (about 10), I figured out a hack to change the Active Popup
window frame color. I think this was prior to the CUAATTR command which now
allows the user to change this at will.

I haven't used (or needed) it in years and lost the code. If I remember
right this involved setting an ISPF Profile variable (ZCOLOR, I think) on an
old screen (probably an obsolete, predecessor to CUAATTR). I'm pretty sure
this also executed a program and I did this with stuffing a ZCMD with a
CONTROL NONDISPL ENTER (prior to the newer and cleaner DISPLAY COMMAND(...)
service).

I used this in a "monitor" application that would change the popup border
color to red for critical events and activities, yellow for action windows,
green for help windows and turquoise for "in progress" events. As luck would
have it, I need to do something similar again.

I did find a reference to ZCOLOR in the source for the ISPOPT11 panel used by
CUAATTR, but I tried setting ZCOLOR and it had no effect. I can't find any
real documentation for CUAATTR that suggests that it may have any command
line arguments.

So finally, my question...

Does anyone know how to set the Active Window Frame color under program
control (REXX)?


Thanks,
Robert Zenuk
robz...@aol.com

Mosley, George

unread,
Jan 18, 2002, 12:17:20 PM1/18/02
to
This gives me a chance to retry a question I asked some time ago - does
anyone know how to change the color of the title text within the popup
frame?

George Mosley

Rob Zenuk

unread,
Jan 18, 2002, 12:24:11 PM1/18/02
to
I haven't seen a separate CUA attribute for the title text of the window,
just the active window frame itself. My guess is the title text is
considered part of the frame...

Thanks,
Robert Zenuk
robz...@aol.com

John Kalinich

unread,
Jan 18, 2002, 1:50:00 PM1/18/02
to
You can change the "Active Window Frame" color via CUAATTR. This changes the title text as well.

Regards,
John Kalinich

Marvin Knight

unread,
Jan 21, 2002, 7:46:32 AM1/21/02
to
There is no " SUPPORTED " way to update these variables through a dialog.
Now that the disclaimer is out of the way.....

These variables are system profile variables which require special
processing by ISPF to be updated. You must go thru the pgm/panel
interfaces
to update them correctly. This can be done thru use of CONTROL NONDISPL
END
and LIBDEF

/* REXX */
address ispexec
"LIBDEF ISPPLIB DATASET ID('MARV.PANELS')"
"CONTROL NONDISPL END"
"SELECT PGM(ISPOPT) PARM(ISPOPT11)"
exit


In the above if you have your own copy of panel ISPOPT11
with the variables set as you desired, then you can change the
variables thru the dialog. Other system variables can be set in a similar
manner
by modifying the appropriate panels.

I believe that setting &ZCOLOR and &COLOR20 as the last statement in the
)INIT
will change active window frame and panel title respectively.

Hope this helps...

Marv Knight

Mosley, George

unread,
Jan 21, 2002, 5:02:30 PM1/21/02
to
Neat trick, Marvin. I'll definitely be able to use that technique to control
pop-up frame color. However, I'm guessing that control of the color of the
text within the frame (the zwinttl variable) is just not possible. Ah,
well...
Thanks for the other, though.

George Mosley

Rob Zenuk

unread,
Jan 21, 2002, 9:49:53 PM1/21/02
to
Great.

Unless I'm still missing something, I think a generic implementation to set
the border to any color would require 7 clone panels (one for each color).
Then I enhanced your sample logic to get some bare bones working code. My 7
clones panels are named AFRED, AFGREEN, AFBLUE.....

/* rexx */
arg color
ispplib = 'MY.PANEL.DSN'
mem = 'AF' || color
"rename '"ispplib"("mem")' '"ispplib"(ISPOPT11)'"
address ISPEXEC
"LIBDEF ISPPLIB DATASET ID('"ispplib"')"
"CONTROL NONDISPL ENTER"


"CONTROL NONDISPL END"
"SELECT PGM(ISPOPT) PARM(ISPOPT11)"

"LIBDEF ISPPLIB"
address TSO
"rename '"ispplib"(ISPOPT11)' '"ispplib"("mem")'"
exit

I did need the CONTROL NONDISPL ENTER as well. Did I go overboard or is this
the way to do this?

I realize this is subject to review with maintenance activities and a USERMOD
is probably in order to keep track of potential future regression.

Thanks again,

Robert Zenuk
robz...@aol.com

Doug Nadel

unread,
Jan 21, 2002, 11:21:27 PM1/21/02
to
Rather than using 7 panels, you could use one and VPUT/VGET/VERASE a temp variable to the
SHARED pool, using panel logic to set the right variables in your panel.

If this is a small program, say a Rexx exec, you could just imbed the panel there (see
ISRSETLN for an example) and avoid having a real panel library altogether. A quick
example is shown below.

On 21 Jan 2002 18:49:53 -0800, in bit.listserv.ispf-l you wrote:

>Great.
>
>Unless I'm still missing something, I think a generic implementation to set
>the border to any color would require 7 clone panels (one for each color).
>Then I enhanced your sample logic to get some bare bones working code. My 7
>clones panels are named AFRED, AFGREEN, AFBLUE.....

/* REXX - example to show frame color changing on the fly */
Address 'ISPEXEC'
ddname = '$'right(time(s),7,'0') /* create unique ddname */
Address tso 'ALLOC NEW DEL F('ddname') DIR(1) SP(1) TR RECF(F B)
BLKS(0) LRECL(80) REU' /* Allocate data set */
'LMINIT DATAID(DID) DDNAME('ddname') ENQ(EXCLU)'
'LMOPEN DATAID(&DID) OPTION(OUTPUT)'
pan.1=")BODY "
pan.2="%Command ===>_ZCMD + "
pan.3=")INIT "
pan.4="&ZCMD = ' ' "
pan.5="VGET (BCOLOR) SHARED "
pan.6="&ZCOLOR = &BCOLOR "
pan.7=".RESP = END "
pan.8=")END "
Do a=1 to 8
line = pan.a
'LMPUT DATAID(&DID) MODE(INVAR) DATALOC(LINE) DATALEN(80)'
End
'LMMADD DATAID(&DID) MEMBER(ISPOPT11)'
'LMFREE DATAID(&DID)'
'LIBDEF ISPPLIB LIBRARY ID('ddname') STACK' /* LIBDEF panels */
colors = 'RED GREEN TURQ YELLOW'
do a=1 to 4
BCOLOR = word(colors,a)
'VPUT BCOLOR SHARED'
'SELECT PGM(ISPOPT) PARM(ISPOPT11)' /* Prompt user for length */
'ADDPOP'
'DISPLAY PANEL(ISPKLUP)' /* show a sample panel - any popup will do */
'REMPOP'
end
'VERASE BCOLOR SHARED'
'LIBDEF ISPPLIB ' /* Remove Panels libdef */
Address tso 'FREE F('ddname')' /* Free and delete temp file */

Doug Nadel
----------------------------------------
ISPF and OS/390 Tools & Toys page:
http://somebody.home.mindspring.com/

Mail containing HTML or any attachments, including vcf files, is
automatically discarded. If you need to send me an attachment,
please let me know so that I can change my email filters.

Marvin Knight

unread,
Jan 22, 2002, 7:58:10 AM1/22/02
to
As Doug mentioned you can use VPUT/VGET to get around having 7 panels.
The main point is that to modify an ISPF system profile variable requires
going through the appropriate interface. In the case of Active Window
Frame
that is the CUAATTR command. Looking in the ISPF command table
shows that this is SELECT PGM(ISPOPT) PARM(ISPOPT11).
Hence the need for a modified panel and LIBEDEF to point to it. Many of
the other
system profile values can be modified in the same or similar way.
And if I recall correctly, there are still ISPOPTxx panels in the product
that are no longer referenced (replaced by ISPISMMN). We intentionally
left them because we knew there were dialogs still using them for just the
above
reasons. Just remember that this technique is not "officially supported".

Marv

Rob Zenuk

unread,
Jan 23, 2002, 12:03:40 PM1/23/02
to
Thanks for the sample code and technique. I have already reworked my code.
I'm sure the technique will come in handy in the future.

For others, here was how I incorporated this into a callable routine:

/*********************************************************************/
/* REXX */
/*********************************************************************/
/* Purpose: Change the Active Frame Border color */
/*-------------------------------------------------------------------*/
/* Syntax: AFBSET color */
/*-------------------------------------------------------------------*/
/* Parms: color - New color for the border */
/* */
/*********************************************************************/
/* Change Log */
/* */
/* Author Date Reason */
/* -------- --------- ----------------------------------------- */
/* R. Zenuk Jan 2002 Initial Creation */
/* */
/*********************************************************************/
/* Standard entry */
/*********************************************************************/
parse upper source . . execname . execdsn . . execenv .
signal on syntax name trap
signal on failure name trap
signal on novalue name trap
EXITRC = 0
x = time('r')
/*********************************************************************/
/* Startup message */
/*********************************************************************/
startmsg = execname 'started' date() time()
if sysvar('SYSENV') = 'BACK' then
do
say center(' 'startmsg' ',78,'-')
say
end
/*********************************************************************/
/* Accept parms */
/*********************************************************************/
arg parms
/*********************************************************************/
/* Parse and validate parms */
/*********************************************************************/
parse var parms @tfcolor
if @tfcolor = '' then call rcexit 12 'Required COLOR is missing'
/*********************************************************************/
/* Allocate a temporary PDS */
/*********************************************************************/
dsn = userid()||'.'||execname||'.T'||right(time('s'),7,0)||'(ISPOPT11)'
"ALLOC F("execname") DA('"dsn"') NEW CATALOG LRECL(80) BLKS(0) DIR(1)",
"SPACE(1) UNIT(SYSDA) RECFM(F B)"
call rcexit RC 'Allocate of' dsn 'failed'
/*********************************************************************/
/* Build a temporary panel */
/*********************************************************************/
pan.0 = 8


pan.1=")BODY "
pan.2="%Command ===>_ZCMD + "
pan.3=")INIT "
pan.4="&ZCMD = ' ' "

pan.5="VGET (@TFCOLOR) SHARED "
pan.6="&ZCOLOR = &@TFCOLOR "


pan.7=".RESP = END "
pan.8=")END "

/*********************************************************************/
/* Write the records into the ISPOPT11 panel */
/*********************************************************************/
"EXECIO * DISKW" execname "(STEM PAN. FINIS"
call rcexit RC 'EXECIO DISKW to' execname 'failed'
/*********************************************************************/
/* LIBDEF the DSN, VPUT @TFCOLOR and run CUAATTR */
/*********************************************************************/
address ISPEXEC "LIBDEF ISPPLIB LIBRARY ID("execname") STACK"
call rcexit RC 'LIBDEF error'
address ISPEXEC "VPUT (@TFCOLOR) SHARED"
call rcexit RC 'VPUT error' @tfcolor
address ISPEXEC "SELECT PGM(ISPOPT) PARM(ISPOPT11)"
call rcexit RC 'SELECT error on ISPOPT'
address ISPEXEC "LIBDEF ISPPLIB"
call rcexit RC 'LIBDEF error'
/*********************************************************************/
/* Shutdown */
/*********************************************************************/
shutdown: nop
"FREE F("execname") DELETE"
endmsg = execname 'ended' date() time() time('e') 'RC='EXITRC
if sysvar('SYSENV') = 'BACK' then
do
say center(' 'endmsg' ',78,'-')
end
exit(EXITRC)
/*********************************************************************/
/* RCEXIT - Exit on non-zero return codes */
/*********************************************************************/
rcexit: parse arg EXITRC zedlmsg
if EXITRC <> 0 then
do
/*********************************************************************/
/* If execution environment is ISPF then VPUT ZISPFRC */
/*********************************************************************/
if execenv <> 'OMVS' then
do
"ISPQRY"
if RC = 0 then
do
zispfrc = EXITRC
address ISPEXEC "VPUT (ZISPFRC)"
end
end
/*********************************************************************/
/* If a message is provided, wrap it in date, time and EXITRC */
/*********************************************************************/
if zedlmsg <> '' then
do
zedlmsg = date() time() execname zedlmsg 'RC='EXITRC
/*********************************************************************/
/* If execution environment is ISPF SETMSG. If not, say the message */
/*********************************************************************/
if sysvar('SYSENV') = 'BACK' | execenv = 'OMVS' then
say zedlmsg
else
do
"ISPQRY"
if RC = 0 then
address ISPEXEC "SETMSG MSG(ISRZ000)"
else
say zedlmsg
end
end
/*********************************************************************/
/* Signal SHUTDOWN. SHUTDOWN label MUST exist in the program */
/*********************************************************************/
signal shutdown
end
else
return
/*********************************************************************/
/* Issue a common trap error message using rcexit */
/*********************************************************************/
trap: traptype = condition('C')
if traptype = 'SYNTAX' then
msg = errortext(RC)
else
msg = condition('D')
trapline = strip(sourceline(sigl))
msg = traptype 'TRAP:' msg', Line:' sigl '"'trapline'"'
call rcexit 666 msg

0 new messages