Tuesday, November 8, 2022

Enhancing the Arrow buttons in the Macintosh HyperCard 2.4.1 Home stack

HyperCard 2.4.1 Home stack changes for enhanced left/right arrow buttons

by Brendan Bellina 11/2022


Benefits of these changes

~~~~~~~~~~~~~~~~~~~~


Unenhanced the Home stack allows 5 Home Card cards to be displayed along the bottom. Additional cards can be created via the New Card menu option and accessed via the arrow buttons, but their names will not be displayed along the bottom of the Home card. When enhanced any added cards will scroll along the bottom when the arrow buttons are used to navigate. This encourages spreading QuickLinks across multiple cards rather than crowding them all onto the five standard Home cards.


Unenhanced the left/right arrow buttons in the Home stack cycle through all cards in the stack, not just the Home Card background. When enhanced the buttons advance only through the Home Cards. The User Preference cards remain accessible via the Home menu.


Holding down the option key while clicking on an enhanced left/right arrow button  will execute their original unenhanced logic.


Known issues

~~~~~~~~~~


The enhanced buttons require Home cards to be uniquely named.


When creating new Home Cards, if a name is not specified for the new card then standard behavior is that it is defaulted to "Untitled Card" which can lead to duplicate card names. For this reason if an "Untitled Card" button is scrolled off the screen and then back onto the screen its name will be changed to its unique card id.


When deleting the last Home card some Home menu options will be incorrectly disabled. To reenable them select Preferences from the Home menu and then return to the Home cards. This is a bug in the unmodified Home stack code that is more noticable since the enhanced left/right arrow buttons make adding more Home cards a more reasonable thing to do than crowding all QuickLinks on the five standard Home cards.


The Home Card title buttons are not defined in a button family, so it is possible for multiple of them to be hilited at the same time or none hilited. While this should not happen, if it does then use the arrow buttons to scroll through the cards and the hiliting will be corrected.


Applying these Enhancements

~~~~~~~~~~~~~~~~~~~~~~~


1. Add the following to the "Home Cards" background script":


---

Message Handlers added to this script by B Bellina 11/2022:

openCard, resetToFirstCard


on openCard -- added by B Bellina 11/2022

  -- required for enhanced "left arrow" "right arrow" buttons

  put ((number of bg btn id 169) - 1) into homeCardBtnCnt

  -- Determine which btn to hilite

  get the short name of this card

  put false into foundIt

  repeat with i = 1 to homeCardBtnCnt

    if short name of bg btn i is it then

      put true into foundIt

      exit repeat

    end if

  end repeat

  if foundIt then

    put i into foundCardNum

    repeat with i = 1 to homeCardBtnCnt

      set hilite of bg btn i to (i = foundCardNum)

    end repeat

  else

    -- failed to find so reset to first card (normally Welcome to...)

    resetToFirstCard

  end if

  pass openCard -- so others can use it

end openCard


on resetToFirstCard -- added by B Bellina 11/2022

  -- required for enhanced "left arrow" "right arrow" buttons

  if short name of this card is not short name of cd 1 then go cd 1

  put ((number of bg btn id 169) - 1) into homeCardBtnCnt

  repeat with i = 1 to homeCardBtnCnt

    set name of bg btn i to short name of cd i

    set hilite of bg btn i to false

  end repeat

  set hilite of bg btn 1 to true

end resetToFirstCard

---


2. Replace the mouseUp handler of the "left arrow" button with the following:


on mouseUp

  -- enhanced "left arrow" button logic

  -- by Brendan Bellina 11/2022

  -- also requires openCard and resetToFirstCard handlers in the

  -- background script

  if the optionKey is down then

    -- original logic for the button

    visual effect wipe right

    go prev card

  else -- enhanced logic

    lock screen

    set cursor to watch

    -- how many buttons along the bottom, typically 5

    put ((number of bg btn id 169) - 1) into homeCardBtnCnt

    -- how many home cards (they are cards 1...n)

    put number of cards of this bg into homeCardCnt

    if homeCardBtnCnt = homeCardCnt then

      go to prev card of this bg

      unlock screen with visual effect wipe right

    else -- more cards than buttons

      -- determine which button is hilited

      put 0 into fromCdBtnNum

      put short name of this cd into thisCd

      repeat with i = 1 to homeCardBtnCnt

        if hilite of bg btn i is true or ¬

        short name of bg btn i is thisCd then

          put i into fromCdBtnNum

          exit repeat

        end if

      end repeat

      if fromCdBtnNum = 0 then -- messed up so do default action

        go to prev card of this bg

        unlock screen with visual effect wipe right

        exit mouseUp

      end if

      if fromCdBtnNum is 1 then

        -- scroll all of the buttons except the rightmost to the right

        repeat with i = (homeCardBtnCnt - 1) down to 1

          set name of bg btn (i + 1) to short name of bg btn i

        end repeat

        put number of prev cd of this bg into prevCdNum

        get short name of cd prevCdNum

        if it is empty or it is "Untitled Card" then -- no dups allowed

          put id of cd prevCdNum into it

          set name of cd prevCdNum to it

        end if

        set name of bg btn 1 to short name of cd prevCdNum

        go to prev cd of this bg

        repeat with i = 1 to homeCardBtnCnt

          set hilite of bg btn i to (i = 1)

        end repeat

        unlock screen with visual effect wipe right

      else

        go to prev cd of this bg

        repeat with i = 1 to homeCardBtnCnt

          set hilite of bg btn i to (i = fromCdBtnNum - 1)

        end repeat

        unlock screen with visual effect wipe right

      end if

    end if

  end if

end mouseUp


3. Replace the mouseUp handler of the "right arrow" button with the following:


on mouseUp

  -- enhanced "right arrow" button logic

  -- by Brendan Bellina 11/2022

  -- also requires openCard and resetToFirstCard handlers in the

  -- background script

  if the optionKey is down then

    -- original logic for the button

    visual effect wipe left

    go next card

  else -- enhanced logic

    lock screen

    set cursor to watch

    -- how many buttons along the bottom, typically 5

    put ((number of bg btn id 169) - 1) into homeCardBtnCnt

    -- how many home cards (they are cards 1...n)

    put number of cards of this bg into homeCardCnt

    if homeCardBtnCnt = homeCardCnt then

      go to next card of this bg

      unlock screen with visual effect wipe left

    else -- more cards than buttons

      -- determine which button is hilited

      put 0 into fromCdBtnNum

      put short name of this cd into thisCd

      repeat with i = 1 to homeCardBtnCnt

        if hilite of bg btn i is true or ¬

        short name of bg btn i is thisCd then

          put i into fromCdBtnNum

          exit repeat

        end if

      end repeat

      if fromCdBtnNum = 0 then -- messed up so do default action

        go to next card of this bg

        unlock screen with visual effect wipe left

        exit mouseUp

      end if

      if fromCdBtnNum is homeCardBtnCnt then

        -- scroll all of the buttons except the leftmost to the left

        repeat with i = 2 to homeCardBtnCnt

          set name of bg btn (i - 1) to short name of bg btn i

        end repeat

        put number of next cd of this bg into nextCdNum

        get short name of cd nextCdNum

        if it is empty or it is "Untitled Card" then -- no dups allowed

          put id of cd nextCdNum into it

          set name of cd nextCdNum to it

        end if

        set name of bg btn homeCardBtnCnt to short name of cd nextCdNum

        go to next cd of this bg

        repeat with i = 1 to homeCardBtnCnt

          set hilite of bg btn i to (i = homeCardBtnCnt)

        end repeat

        unlock screen with visual effect wipe left

      else

        go to next cd of this bg

        repeat with i = 1 to homeCardBtnCnt

          set hilite of bg btn i to (i = fromCdBtnNum + 1)

        end repeat

        unlock screen with visual effect wipe left

      end if

    end if

  end if

end mouseUp



Thursday, November 3, 2022

Enabling Function Keys in HyperCard IIGS stacks



The Home Improvement stack by Brendan Bellina released on Script-Central v7n2 includes 20 ways to enhance the HyperCard IIGS Home stack.

One of these includes adding Function Key preference settings to the Home stack. This allows function keys F1-F4 to perform undo, cut, copy, paste, and F5-F15 to be user defined handlers or HyperTalk commands. These mappings can be defined regardless of whether a keyboard with function keys is attached to the IIGS or not.


Because the IIGS keyboard did not have function keys the ability of HyperCard IIGS to respond to function key presses is generally unused. If an Apple Extended Keyboard II is connected to the IIGS then its functions keys F1-F15 can be used and F1-F4 will perform undo, cut, copy, and paste, but without a stack or the Home stack having a functionkey handler the other function keys will serve no function.

When using a IIGS emulator it may not even be possible to send the function keys from the host computer keyboard through to the emulated IIGS, so the mappings preferences will also have no effect and even F1-F4 will not perform the built-in undo, cut, copy, and paste functions.

If you want to use the function key mappings preferences on a real IIGS that does not have an Apple Extended Keyboard II, or on an emulated IIGS with an emulator that eats the function key presses, then you have to have another way to indicate to HyperCard that a function key has been pressed.

Enter the Fn Key menu.

The Fn Key menu is a menu that can be added to HyperCard IIGS that can be used within any stack to send a function key signal to HyperCard as if a function key had been pressed.

Here are the steps to enable this menu.

1. Make a copy of your Home stack for safe keeping just in case you mess this up and need to revert.

2. You may want to follow the instructions in the Home Improvement stack to install the HC Extras menu. This menu adds significant functionality to HCGS and adds the addMenu and deleteMenu commands to the Home stack that are also required for the Fn Key menu.

3. If you choose not to use HC Extras then you will need to install the AddMenu XFCN and DeleteMenu XCMD from Apple's Scripter's Tools stack into your Home stack. Since you cannot install these into the active Home stack you will need to duplicate your Home stack, install them into the duplicate, and then rename or delete your original Home stack, and finally rename the duplicate to Home.

4. Make the following changes to your Home stack script:

4.1. In the startUp handler AND in the resume handler, after the line getHomeInfo add a new line
DrawHCFkeyMenu

If you have installed HCExtras then put the new line after the line
DrawHCExtrasMenu

4.2. In the quit handler AND in the suspend handler, after the line setHomeInfo add a new line

UnDrawHCFKeyMenu

4.3. Add the following two handlers: DrawHCFKeyMenu and UnDrawHCFKeyMenu

   on DrawHCFKeyMenu -- FKey Menu by BTB 10/31/2022

  global HCFKeyMenu

  if HCFKeyMenu is not empty then

    deleteMenu HCFKeyMenu

    put empty into HCFKeyMenu

  end if

  put return into r

  put empty into FKeyList

  repeat with i = 1 to 15

    put "F" & i after FKeyList

    if i < 5 then put space & item i of "Undo,Cut,Copy,Paste" after FKeyList

    put r after FKeyList

  end repeat

  put addMenu(" Fn Key  ", FKeyList & "-" &r ¬

  & "About the Fn Keys menu..." &r ¬

  & "Refresh the Fn Keys menu...") ¬

  into HCFKeyMenu

  show menubar

end DrawHCFKeyMenu


on UnDrawHCFKeyMenu

  global HCFKeyMenu

  deleteMenu HCFKeyMenu

  put empty into HCFKeyMenu

  show menubar

end UnDrawHCFKeyMenu

4.4. Add the following code to your doMenu handler. Note that these should come before the final "else pass doMenu" in the handler.  If there is no doMenu handler in your Home script then create one with "on doMenu whichItem" and "end doMenu"

  else if whichItem is "About the Fn Keys menu..." then
    answer "           *  *  *     FN KEYS  M E N U ™   *  *  *" & return &¬
    return & "Author:   B. Bellina                 Vsn: 1.0" &¬
    return & return &¬
    "Send function keys without an extended keyboard"
    
  else if whichItem is "Refresh the Fn Keys menu..." then
    UnDrawHCFKeyMenu
    DrawHCFKeyMenu
    
  else if "*" & word 1 of whichItem & "*" is in ¬
  "*F1*F2*F3*F4*F5*F6*F7*F8*F9*F10*F11*F12*F13*F14*F15*" then
    delete char 1 of whichItem
    functionKey (word 1 of whichItem)

5. After these changes then you restart HCGS you should see a new menu "Fn Keys" that you can use to send the F1-F15 keys to HyperCard IIGS.


Sunday, October 30, 2022

Script-Central SE v7n2, October 2022

Script-Central SE v7n2 has been released. This is the fourth issue of Script-Central Special Edition.


Script-Central is a HyperCard IIGS stack collection presented as a disk magazine. Originally published on floppy disks in the 1990's, v7n2 is the fourth issue published by Brendan Bellina released as 16 MB hard drive images. Stacks include hard-to-find content, stacks converted from Macintosh HyperCard, and original stacks. Along with the stacks themselves is a great deal of information as well as updated instructions on how to create your own issue of Script-Central, if so inclined.

In addition to its regular features: Tips & Trix, the Lounge, Q+A, Scripter's Workshop, the office, the mailroom, and the bathroom, there are a number of special features, some entirely new and some updated versions previously released on Script-Central or online.

An updated csv of all Script-Central content including all 22 issues of Script-Central and the 4 issues of the Special Edition is included, as well as Script-Central Database Complete - a HCGS stack that contains information on all content of all Script-Central and Script-Central Special Edition issues.

Featuring the HCGS stacks:

  • GraffitiMakerGS
  • MemoryMatchPlus
  • Word Waffle
  • Word Fu (a Wordle stack)
  • More Templates - more HCGS Templates to create your own stacks
  • Home Improvement - 20 improvements for the HCGS Home stack
  • Graph Machine - a HyperHack stack by Apple
  • Polar Plotter - a HyperHack stack by Apple
  • Home Desk
  • Groupies 3.2 GS
  • Visual FX v2.0
  • and more!

Visit https://sites.google.com/view/silverwandsoftware/apple-ii-forever to download all issues of Script-Central Special Edition and other Apple II software by the author.


Sunday, June 19, 2022

Script-Central SE v7n1, June 2022

Script-Central SE v7n1 has been released. This is the third issue of Script-Central Special Edition.

Script-Central SE v7n1 lobby

Script-Central is a HyperCard IIGS stack collection presented as a disk magazine. Originally published on floppy disks in the 1990's, v7n1 is the third issue published by Brendan Bellina released as 16 MB hard drive images. Stacks include hard-to-find content, stacks converted from Macintosh HyperCard, and original stacks. Along with the stacks themselves is a great deal of information as well as updated instructions on how to create your own issue of Script-Central, if so inclined.

In addition to its regular features: Tips & Trix, the Lounge, Q+A, Scripter's Workshop, the office, the mailroom, and the bathroom, there are a number of special features, some entirely new and some updated versions previously released on Script-Central or online.

  • Stack.Templates
  • Readymade.Btns
  • Readymade.Flds
  • Phone.Dialer
  • TuneBuilder (an updated version of Apple's stack)
  • SoundMan 07 by HangTime
  • Slide.Puzzler
  • RecipeV1.2
  • Juke.Box.US
  • Background Music 1.1
  • Color.Master by Apple's Tim Swihart
  • Stack.Checker by Apple
  • Instant Script Writer
  • HCGS.Palettes
  • and more!
Tools and applications that were used by the author to create Script-Central SE are included.

Visit https://sites.google.com/view/silverwandsoftware/apple-ii-forever to download all issues of Script-Central Special Edition.

Friday, April 15, 2022

HyperCard IIGS Extras released

HyperCard IIGS Extras

Update 11/2/2022

An update to the HCGS Extras disk has been released to correct a bug in the Stack.Templates To Do List template, and to add the Apple utility stack Stack.Checker.

Apple included many stacks for the Macintosh version of HyperCard that were never released for HyperCard IIGS. Many of the stacks from HyperCard 1.2.5 and earlier were packaged into a single stack named "Stack Templates" that was released with later versions of HyperCard. Among other stacks provided by Apple with Macintosh HyperCard there was "Phone Dialer" - a utility stack that allowed intelligent phone dialing from within any stack, and two stacks specifically for developers named "Readymade Buttons" and "Readymade Fields" which included buttons and fields that could be copied into stacks to add functionality.

Now, after 30 years, these stacks have been converted to HyperCard IIGS and where possible enhanced to take advantage of HyperCard IIGS specific capabilities. The four converted stacks have been bundled together onto a single 800K disk image, just as they might have been when HCGS was released in the 90's.

While the HyperMover tool was used to facilitate conversion, these stacks have to a large degree been rewritten in order to address not only the differences between the Macintosh and IIGS versions of HyperCard, but also to implement in HyperTalk features of HyperCard that were added to Macintosh HyperCard in versions later than version 1.2.5 that HyperCard IIGS was based upon. Changes have also been made to address Y2K issues, and enhancements made to take advantage of what the IIGS and HCGS has to offer.

Stack.Templates 


Stack.Templates includes 15 templates that can be used to create stand alone HyperCard IIGS stacks. All of the original 15 Macintosh templates are included. Several of the stack templates are integrated with one another and the Phone.Dialer stack, including Addresses, To.Do.List, Calls.Received, Appointments, and Invoice. The Macintosh "Day Appointments" template has been significantly enhanced so that the new HCGS Appointments template has a feature set similar to the stand-alone Macintosh Appointments stack and is integrated with the stand-alone Addresses HCGS stack.


Phone.Dialer

Phone.Dialer is  a conversion of the Macintosh "Phone Dialer" stack.  Phone.Dialer allows telephone prefixes and other related information to be stored separately from the Addresses stack but utilized when placing calls. This would have been important functionality to have in an office setting. The converted stack provides this same functionality and is integrated with both Stack.Templates and the dial button included with the Readymade.Btns stack.  The stack is designed to look like a HyperCard IIGS home stack page, since it would have been considered core functionality of HCGS had it been released.



Readymade.Flds

Readymade.Flds is a conversion of the "Readymade Fields" stack. The Macintosh version included 17 fields that could be pasted into a stack in order to add significant functionality.


All but two of the original Macintosh fields were converted. The "Peek at grouped text" and "Search and replace styles" fields depended on Macintosh only functionality and so were replaced with the more useful "Pop-up menu" and "Quick unlock and relock" fields.



Readymade.Btns

Readymade.Btns is a conversion of the "Readymade Buttons" stack. The Macintosh version included a variety of buttons organized into 16 categories. All 16 categories are included in Readymade.Btns.




Not all buttons in the stack were relevant to HCGS and in some cases additional buttons have been added. In many cases icons have been redrawn or replaced with HCGS specific versions.



Throughout the stack any Macintosh specific functionality has been replaced with Apple II specific functionality.


And in many places modifications have been made to the scripts to utilize the color capabilities of HCGS.




Download HyperCard IIGS Extras from the Apple II Forever section of the Silverwand Software page at https://sites.google.com/view/silverwandsoftware.


Thursday, February 24, 2022

Script-Central SE 2021

Script-Central Special Edition 2021 has been released.


Script-Central SE 2021

Script-Central is a HyperCard IIGS stack collection presented as a disk magazine. Originally published on floppy disks in the 1990's, Special Edition 2020 and 2021 are published by Brendan Bellina on 16 MB hard drive images. Stacks include hard-to-find content, stacks converted from Macintosh HyperCard, and original stacks. Along with the stacks themselves is a great deal of information as well as updated instructions on how to create your own issue of Script-Central, if so inclined.

In addition to its regular features: Tips & Trix, the Lounge, Q+A, Scripter's Workshop, the office, the mailroom, and the bathroom, there are a number of special features, some entirely new and some updated versions previously released on Script-Central or online:

  • HyperTuneMaker
  • Haiku Stack
  • Xmas.Display.21
  • Itsy Bitsy Spider
  • TuneBuilder (an updated version of Apple's stack)
  • Birthday
  • Warp Speed IIGS
  • File Cabinet GS
  • PinDrop
  • Apple 1987 HyperCard Supplement
  • MenuMaster
  • Stack Report
There are also a number of tools and applications that were used by the author to create Script-Central 2020 SE included.  In total over 14 MB of material distributed on a 16 MB hard drive image.

Visit https://sites.google.com/view/silverwandsoftware/ to download Script-Central 2021 SE.