Glimmr Canvas Editor

version 1/100805 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Adding UI elements to and activating pop-up dialogues

    The member-elements of Settings_popup are {List_colors_button, Image_bkgd_button, Grid_bkgd_button, Outline_bkgd_check}.
    The member-elements of Source_popup are {Generate_source_button, Preview_source_button, Tabular_source_radio}.
    The member-elements of Instances_popup are {Rename_sprite_button, Change_kind_button, Change_ID_button, Register_button, Load_button, Reveal_button, Tag_button, Tag_delete_button}.

    To open the/-- (P - a pop-up dialogue):
        mark P for display;
        repeat with current-element running through the member-elements of P:
            mark current-element for display;
            now the display-layer of current-element is the pop-up layer;
        mark control_occluder for display;
        now the display-layer of the current graphlink is the pop-up layer;
        
    To close the/-- (P - a pop-up dialogue):
        P is no longer marked for display;
        repeat with current-element running through the member-elements of P:
            current-element is no longer marked for display;
        control_occluder is no longer marked for display;
        now the display-layer of the current graphlink is the button-layer;
        
    A clicking graphlink rule when the current graphlink window is the control-window:
        if the click hit a hot link:
            if the current graphlink is a pop-up button:
                if the associated dialogue of the current graphlink is display-inactive:
                    open the associated dialogue of the current graphlink;
                    follow the window-drawing rules for the control-window;
                    now glulx replacement command is "";
                    rule succeeds;
                otherwise:
                    close the associated dialogue of the current graphlink;
                    follow the window-drawing rules for the control-window;
                    now glulx replacement command is "";
                    rule succeeds;
            if the current graphlink is the control_occluder:
                now glulx replacement command is "";
                reject the player's command; [a hack that ensures that a line event is requested even if we've clicked on the occluder, which is designed to stop graphlinks beneath it from being clicked.]
                rule succeeds;
        now glulx replacement command is "";