Glimmr Canvas Editor

version 1/100805 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Change Highlight Image

    [Changing the image highlights is a bit fussy. There are two steps:

    1) Change the image files Highlight.png and Highlight_alternate.png as desired.
    2) Change the standard highlight color and alternate highlight color text variables here to reflect the highlights used.]

    Standard highlight color is text that varies. Standard highlight color is usually "blue".
    Alternate highlight color is text that varies. Alternate highlight color is usually "red".

    Toggling image highlight color is an action applying to nothing. Understand "toggle image highlight color" as toggling image highlight color.

    Carry out toggling image highlight color:
        if the current highlight image is Figure of Highlight:
            change the current highlight image to Figure of Alternate Highlight;
        otherwise:
            change the current highlight image to Figure of Highlight;
        say "The image highlight overlay was changed to [if current highlight image is Figure of Highlight][standard highlight color][otherwise][alternate highlight color][end if].";
        [follow the window-drawing rules for the control-window;]
        follow the window-drawing rules for the working window.
        
    An element display rule for the hilite_color_radio (this is the update highlight color radio button rule):
        let basic be 25 real times the scaling factor of the control-window real times the x-scaling factor of hilite_color_radio as an integer;
        let border be 4 real times the scaling factor of the control-window real times the x-scaling factor of hilite_color_radio as an integer;
        let x2 be win-x of the hilite_color_radio + basic + (border * 2);
        display the image Figure of Highlight in the control-window at (win-x of the hilite_color_radio) by (win-y of the hilite_color_radio) with dimensions (basic) by (basic);
        display the image Figure of Alternate Highlight in the control-window at (x2) by (win-y of the hilite_color_radio) with dimensions (basic) by (basic);
        if the current highlight image is Figure of Highlight:
            draw a box (color g-dark-grey) in the control-window from (win-x of the hilite_color_radio) by (win-y) to (win-x + basic) by (win-y + basic) with (border) line-weight;
            draw a box (color g-mylightgray) in the control-window from (x2) by (win-y of the hilite_color_radio) to (x2 + basic) by (win-y + basic) with (border) line-weight;
        otherwise:
            draw a box (color g-mylightgray) in the control-window from (win-x of the hilite_color_radio) by (win-y) to (win-x + basic) by (win-y + basic) with (border) line-weight;
            draw a box (color g-dark-grey) in the control-window from (x2) by (win-y of the hilite_color_radio) to (x2 + basic) by (win-y + basic) with (border) line-weight;
        set a graphlink in the control-window identified as hilite_color_radio from win-x of hilite_color_radio by win-y of hilite_color_radio to (x2 + basic) by (win-y + basic) as the linked replacement-command of hilite_color_radio;