| Reader's Clinic - Screen Width |
| Screen Grabber |
| Reader's Clinic - Slow Multivalued Screen Display |
| Utility Diskette # 4 |
| QTIPS - Using @Upper.Case and @Lower.Case with Foreign Languages |
| @ATTACK - @Lower.Case |
| @ATTACK - @Upper.Case |
| Sorting out Collation Sequences by Mike Pope |
| Playing with Scan Codes |
| QTIPS - Compiling Protection Code |
| QTIPS - Invalid Code and Command |
| QTIPS - Code/Command Help |
| Compiling 64K on a Shoestring by Blaise Wrenn (LexStat Systems Ltd) |
| QTIPS - Command Line Options |
| QTIPS - Invalid Code and Command |
| QTIPS - Code/Command Help |
| Utility Diskette # 4 |
| Viewer |
| VERBatim - V65 |
| QTIPS - Using INIT.VIEW with Printers |
| REVMEDIA Revisited |
| QTIPS - Sub-Headings in RLIST (Revisited) |
| Reader's Clinic - Template Name at Pre-Init |
| Video Control |
| Creating Your Own Background Processes |
| @ATTACK - @Last.Select.Process |
| Reader's Forum |
| QTIPS - Menu Item Pre-Processing |
| QTIPS - Positioning Cursors in AMV fields |
| Uncommon Knowledge - WC_WI_NEXT% |
| Uncommon Knowledge - WC_WI_NEXT% (Continued) |
| @ATTACK - @Prog.Char |
| Version 3 Technical Highlights - @Prog.Char |
| Version 3 Technical Highlights - Add_Buttons |
| Gas Bar |
| VERBatim - V9 |
| @ATTACK - @Rec.Count |
| QTIPS - Replacing GAS.BAR routine during PERFORM "SELECT" |
| A RevTI Techie Replies - Mike Pope - Revelation Technologies (UK) Ltd |
| Version 3 Technical Highlights - INRECT |
| Version 3 Technical Highlights - Input.Char |
| QTIPS - Calling an Action Bar from a Pulldown Menu |
| Reader's Clinic - Line Length > 256 Characters |
| QTIPS - String Space |
| QTIPS - String Space Format Errors |
| Reader's Forum - Numeric Precision in R/Basic - Hal Wyman |
| Reader's Clinic - Functions and Subroutines |
| Argument passing - Subroutines and Functions - Mike Pope |
RevMedia FKB
| Document | V4I5A8 |
| Title | Version 3 Technical Highlights - Add_Buttons |
| Keywords | ADD_BUTTONS @PROG.CHAR |
| Text | The program on the following pages uses this extended functionality to put buttons on the screen in an AREV window as in the illustration below When the buttons are pointed at and clicked WITH the mouse the buttons give the illusion of being pressed into the screen and provide an audible click Setting up the buttons is simple a case of putting five parameters per button into Register(5) of the window (see below) the parameters being Label X Y Code Command as shown below Then add a call to ADD_BNS passing PRE_INIT on the pre init hook The program works by adding "pseudo" prompts for each button into the window at pre init It then checks on a perpetual process to see if these prompts are in WC_Wi_Next% If they are they can be there by either arrowing to the prompt or clicking on the prompt Arrowing (or returning) to the prompt should ignore the prompts and continue on in the DIRECTION of travel Clicking on the prompt WITH a mouse should action the code and command ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍTESTÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º º º Customer Id 1 º º Company Name FIRST BANK OF NEW YORK º º Contact Name Rick Garber º º Jim Lovell º º ÚÄÄÄÄ· ÚÄÄÄÄÄÄÄÄÄÄ· ÚÄÄÄ· º º ³Saveº ³Table Modeº ³TCLº º º ÔÍÍÍͼ ÔÍÍÍÍÍÍÍÍÍͼ ÔÍÍͼ º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ EXAMPLE Parameters in Register(5) For Above Screen Save|2|5|K|{F9} Table Mode|10|5|K|{CTRL F5} Print|24|5|K|{ALT P} To determine whether the prompt was clicked on @PROG CHAR is checked If it is four characters long a mouse click was used (See above) Note that WC_Wi_Next% is not reliable when exiting an ASSOCIATED MVed prompt Essentially when an AMV group is exited by pressing return WC_Wi_Next% is not set Rather WC_Mv_Next% is set to two more than the count of MVs in the group! This behaviour is not new but large thanks to Alan Humphrey/Bob Madden of Revelation Technologies for helping to pinpoint it The only remaining point of interest is that the window processor obviously uses the length of the prompt label and entry to work out whether a prompt has been clicked on USING InRect Originally the program following made the prompt label equal to the complete button string but this led to false alarms when clicking ANYWHERE on the prompt line Hence the use of a pre key process to actually draw the button Subroutine Add_BNS(Branch) /* Author AMcA Date Sept 1992 Notes Note for BP@ read ButtonPrompts@ for Bn read Button */ GoTo Main Declare Subroutine CATALYST VSPACE DELAY Msg $INSERT SysInclude Window_Common% $Insert SysInclude LcPositions $Insert SysInclude VIRTUAL Params $Insert SysInclude Logical $Insert SysInclude Window Constants Equ RegisterToUse$ To 49 ; * Window Register 5 Equ BnLabel$ To 1 Equ BnX$ To 2 Equ BnY$ To 3 Equ BnCode$ To 4 Equ BnCommand$ To 5 Equ Dm$ To Char(247) Main: COMMON /WindowBns/ BP@ BnLabelPrePress@ BnLabelPress@ Begin Case Case Branch = "PRE_KEY" ; GoSub SetUpBns Case Branch = "PRE_INIT" ;GoSub PreInit Case Branch = "PERP" ; GoSub Perpetual End Case Return Perpetual: CAG = WC_Curr_Amv_Group% If CAG Then If WC_Mv_Next%>(WC_Amv_Vars% * Moving out of an AMV group downwards so the NEXT prompt will be * equal to the start pos + count of prompts + 1 WC_Wi_Next%=WC_Amv% End End LOCATE WC_Wi_Next% In BP@ USING @Fm SETTING Pos Then If Len(@Prog Char) = 4 Then * Asked to mouse to Bn prompt so get OPTIONS code and command and * EXECUTE it Old_Wi_Next% = WC_Wi_Next% GoSub BnPress Catalyst(WC_W%(BP@ If WC_Wi_Next% # Old_Wi_Next% Then * Do nothing USER must have changed it in catalyst End Else * Return whence one came WC_Wi_Next% = WC_Wi% End @Prog Char = "" End Else * Normal attempt to MOVE into the Bn prompt so just increment Wi_Next% EXIT = False$ Begin Case Case WC_WI% = 1 And WC_Wi_Next% = WC_W_Cnt% Loop Locate WC_Wi_Next% In BP@ USING @Fm SETTING Pos Else Exit = True$ End Until Exit Wi_Next% = 1 Repeat Case WC_Wi_Next% > WC_Wi% Loop WC_Wi_Next% += 1 Locate WC_Wi_Next% In BP@ USING @Fm SETTING Pos Else Exit = True$ End If WC_Wi_Next% > WC_W_CNT% Then WC_Wi_Next% = 1 End Until Exit Repeat Case WC_Wi_Next% < WC_Wi% Loop WC_Wi_Next% = 1 Locate WC_Wi_Next% In BP@ USING @Fm SETTING Pos Else Exit = True$ End If WC_Wi_Next% < 1 Then WC_Wi_Next% = WC_W_Cnt% End Until Exit Repeat End Case End End Return PreInit: BnDetails = Field(@Record Dm$ RegisterToUse$) If BnDetails Then * For each Bn DEFINED add into prompt ARRAY and into LABELLED common CONVERT "|" : @Vm To @Vm : @Fm In BnDetails BnCtr = Count(BnDetails @Fm) + 1 PromptArray = @Record[1 Char(247)] PromptCount = PromptArray<1> For X = 1 To BnCtr PromptCount += 1 Bn = BnDetails Prompt = "" Prompt<0 Type> = "F" GoSub ConstructBnLabel Prompt<0 D> = BnText Prompt<0 DA> = "^PL^" Prompt<0 DX> = BnX + 1 Prompt<0 DY> = BnY Prompt<0 VX> = BnX + 1 ; Prompt<0 VY> = BnY Prompt<0 VLen> = 0 ; Prompt<0 VA> = "^PE^" Prompt<0 Options Code> = Bn<0 BnCode$> Prompt<0 Options Command> = Bn<0 BnCommand$> PromptArray = Insert(PromptArray PromptCount+1 0 0 Prompt) Next PromptArray<1> = PromptCount @RECORD = FieldStore(@Record Dm$ 1 1 PromptArray) @Record = FieldStore(@Record Dm$ 9 1 "") BP@ = "" Top = PromptCount Bottom = Top BnCtr + 1 For X = Bottom To Top BP@< 1> = X Next End * Finally add Perpetual and Pre Key call in if not there PerpetualCall = Field(@Record Dm$ 45) Begin Case Case PerpetualCall<1> = "" PerpetualCall = "S" : @Vm : "ADD_BNS PERP" Case Index(PerpetualCall<1> "ADD_BNS PERP" 1) Null Case 1 PerpetualCall<1 1> = PerpetualCall<1 1> : ";S" PerpetualCall<1 2> = PerpetualCall<1 2> : ";ADD_BNS PERP" End Case @Record = FieldStore(@Record Dm$ 45 1 PerpetualCall) PreCode = @Record<2 Pre Code> PostCode = @Record<2 Post Command> Begin Case Case Index(@Record<2 Pre Command> "ADD_BNS PRE_KEY" 1) Null Case 1 @Record<2 Pre Code> = "S;" : @Record<2 Pre Code> @Record<2 Pre Command>="ADD_BNS PRE_KEY":";":@Record<2 Pre Command> End Case Delay(0) Return ConstructBnLabel: BnText = Bn<0 BnLabel$> BnX = Bn<0 BnX$> BnY = Bn<0 BnY$> BnLabelLength = Len(BnText) BnLabelTemp = @(BnX BnY 1):"Ú":Str("Ä" BnLabelLength):"·" BnLabelTemp := @(BnX BnY):"³":BnText:"º" BnLabelTemp := @(BnX BnY+1):"Ô":Str("Í" BnLabelLength):"¼" BnLabelPrePress@ BnLabelTemp = @(BnX BnY 1):"Ú":Str("Ä" BnLabelLength):"¿" BnLabelTemp := @(BnX BnY) : "³" : BnText : "³" BnLabelTemp := @(BnX BnY+1):"À":Str("Ä" BnLabelLength):"Ù" BnLabelPress@ Return BnPress: X = WC_W%(WC_Wi_Next%) Y = WC_W%(WC_Wi_Next%) ReleaseColour = WC_W%(WC_Wi_Next%) ReleaseBn = ReleaseColour : BnLabelPrePress@ If Branch = "PERP" Then PressColour = WC_W%(WC_Wi_Next%) PressBn = PressColour : BnLabelPress@ Vspace(VPrnt Flag VWindow% X Y PressBn) Out 67 182 ; Out 66 21 ; Out 66 0 OldValue = Inp(97) ; NewValue = BitOr(OldValue 03) Out 97 NewValue Delay( 2) NewValue = BitAnd(OldValue 252) Out 97 NewValue End Vspace(VPrnt Flag WC_VWINDOW% X Y ReleaseBn) Return SetUpBns: BnCtr = Count(BP@ @Fm) + 1 For Ctr = 1 To BnCtr X = WC_W%(BP@ Y = WC_W%(BP@ ReleaseColour = WC_W%(BP@ ReleaseBn = ReleaseColour : BnLabelPrePress@ Vspace(VPrnt Flag WC_VWindow% X Y ReleaseBn) Next Return (Volume 4 Issue 5 Pages 12 15) |
Page last modified: 08/02/03