TechTalk: Color My World With Windows

General
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

We write all of our maintenance programs as DDS windows. While in an application, the user has the ability to call up a maintenance program window or several windows. The new DDS keyword allows you to dynamically control the position of the window on your screen, but the color is hardwired. A way around this is to code seven WDWBORDER keywords in your DDS, each conditioned by a different indicator and each with a separate color.

To give each window displayed a different border color, when the window program is called, pass it a one-byte decimal field initialized to zero. The window program receives this window color parameter, adds one to it, then sets the indicator for that particular color. On subsequent program calls, it passes the same parameter and adds one to get a different color. If the color exceeds seven (the limit), the program resets it to one. This gives each window a different color (you would not be able to hardwire the different colors in, since the programs could be called in any order).

Not only that, but you can dynamically position a window displayed by program X by passing a one-byte code to X instead of the actual coordinates. This simplifies coding and eliminates having to change the programs that call X should you change the size of the window. For example, you could use the table shown in 3. The numbers have been selected that way to match the positions of the keys in the numeric keypad of your display station.

Not only that, but you can dynamically position a window displayed by program X by passing a one-byte code to X instead of the actual coordinates. This simplifies coding and eliminates having to change the programs that call X should you change the size of the window. For example, you could use the table shown in Figure 3. The numbers have been selected that way to match the positions of the keys in the numeric keypad of your display station.

Using this approach, program X could position the window by setting values for the variables coded in the WINDOW DDS keyword for the display file. For instance, if WINDOW(&LIN &COL 6 20) is coded, program X could set LIN to 1 and COL to 2 when it receives 'UL', thereby positioning the window at line 1, column 2 (upper-left corner).


TechTalk: Color My World With Windows

Figure 3 Window positioning codes

 Figure 3: Window Positioning Codes 7 = Upper-left corner 8 = Upper edge, centered 9 = Upper-right corner 4 = Left edge, centered 5 = Center of screen 6 = Right edge, centered 1 = Lower-left corner 2 = Lower edge, centered 3 = Lower-right corner 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: