Register Login

push-buttons changing background colors

Updated May 18, 2018

have three buttons that I am painting using background .gif files.  What I would like to do is kick off an inputscript from each one with a different parameter value.  Once the inputscript is kicked off, I would like the color of the pressed button to change, indicating that it is the active button.  The default value is "1".  Here is what I tried coding:

(for the main screen)

set V[keypad_register] "1"

label check_color
Set V[check_reg_ color] "0"

if V[keypad_register= 1]
  image  (7,94) "numbutton_white. gif" "-plain"  "Input=U[register] :1;OK:process= zmob_meter_ register. txt" textstring="1" "-textcenter" textheight="40"

  image  (7,105) "numbutton_small. gif" "-plain"  "Input=U[register] :2;OK:process= zmob_meter_ register. txt" textstring="2" "-textcenter" textheight="40"

  image  (7,116) "numbutton_small. gif" "-plain"  "Input=U[register] :3;OK:process= zmob_meter_ register. txt" textstring="3" "-textcenter" textheight="40"

endif

if V[keypad_register= 2]
  image  (7,94) "numbutton_small. gif" "-plain"  "Input=U[register] :1;OK:process= zmob_meter_ register. txt" textstring="1" "-textcenter" textheight="40"

  image  (7,105) "numbutton_white. gif" "-plain"  "Input=U[register] :2;OK:process= zmob_meter_ register. txt" textstring="2" "-textcenter" textheight="40"

  image  (7,116) "numbutton_small. gif" "-plain"  "Input=U[register] :3;OK:process= zmob_meter_ register. txt" textstring="3" "-textcenter" textheight="40"

endif

if V[keypad_register= 3]
  image  (7,94) "numbutton_small. gif" "-plain"  "Input=U[register] :1;OK:process= zmob_meter_ register. txt" textstring="1" "-textcenter" textheight="40"

  image  (7,105) "numbutton_small. gif" "-plain"  "Input=U[register] :2;OK:process= zmob_meter_ register. txt" textstring="2" "-textcenter" textheight="40"

  image  (7,116) "numbutton_white. gif" "-plain"  "Input=U[register] :3;OK:process= zmob_meter_ register. txt" textstring="3" "-textcenter" textheight="40"

endif

If V[check_reg_ color=1]
  goto check_color
endif

(for the inputscript)

parameter register
set V[keypad_register] "&U[register]"
set V[check_reg_ color] "1"
return

I am trying to figure out how I can get the main screen's script to re-evaluate the "if" statements on returning from the inputscript, so that the background images change.  The two variables in the inputscript are being set correctly, so that isn't the problem.  I tried putting the image command in the inputscript and got an error that the command was not available there.  Is it possible to make the return go to a label in the guixt script?  Any suggestions are appreciated!


Comments

  • 02 Feb 2010 2:39 am Shalesh Singh Visen
    I would set the variable V[keypad_register] in a different screen. My suggestion would look like this:

    //set V[keypad_register] "1"

    //label check_color
    Set V[check_reg_ color] "0"

    if V[keypad_register= ]
    image (7,94) "numbutton_small. gif" "-plain" "Input=U[register] :1;OK:process= zmob_meter_ register. txt" textstring=" 1"
    "-textcenter" textheight=" 40"
    image (7,105) "numbutton_small. gif" "-plain" "Input=U[register] :2;OK:process= zmob_meter_ register. txt" textstring=" 2"
    "-textcenter" textheight=" 40"
    image (7,116) "numbutton_small. gif" "-plain" "Input=U[register] :3;OK:process= zmob_meter_ register. txt" textstring=" 3"
    "-textcenter" textheight=" 40"
    endif

    if V[keypad_register= 1]
    image (7,94) "numbutton_white. gif" "-plain" "Input=U[register] :1;OK:process= zmob_meter_ register. txt" textstring=" 1"
    "-textcenter" textheight=" 40"
    image (7,105) "numbutton_small. gif" "-plain" "Input=U[register] :2;OK:process= zmob_meter_ register. txt" textstring=" 2"
    "-textcenter" textheight=" 40"
    image (7,116) "numbutton_small. gif" "-plain" "Input=U[register] :3;OK:process= zmob_meter_ register. txt" textstring=" 3"
    "-textcenter" textheight=" 40"
    endif

    if V[keypad_register= 2]
    image (7,94) "numbutton_small. gif" "-plain" "Input=U[register] :1;OK:process= zmob_meter_ register. txt" textstring=" 1"
    "-textcenter" textheight=" 40"
    image (7,105) "numbutton_white. gif" "-plain" "Input=U[register] :2;OK:process= zmob_meter_ register. txt" textstring=" 2"
    "-textcenter" textheight=" 40"
    image (7,116) "numbutton_small. gif" "-plain" "Input=U[register] :3;OK:process= zmob_meter_ register. txt" textstring=" 3"
    "-textcenter" textheight=" 40"
    endif

    if V[keypad_register= 3]
    image (7,94) "numbutton_small. gif" "-plain" "Input=U[register] :1;OK:process= zmob_meter_ register. txt" textstring=" 1"
    "-textcenter" textheight=" 40"
    image (7,105) "numbutton_small. gif" "-plain" "Input=U[register] :2;OK:process= zmob_meter_ register. txt" textstring=" 2"
    "-textcenter" textheight=" 40"
    image (7,116) "numbutton_white. gif" "-plain" "Input=U[register] :3;OK:process= zmob_meter_ register. txt" textstring=" 3"
    "-textcenter" textheight=" 40"
    endif

    //If V[check_reg_ color=1]
    // goto check_color
    // endif

    (for the inputscript)

    parameter register
    set V[keypad_register] "&U[register] "
    set V[check_reg_ color] "1"
    return
  • 02 Feb 2010 2:39 am Shalesh Singh Visen
    I would set the variable V[keypad_register] in one other Screen. My solution would look like this:

    (for the main screen)

    //set V[keypad_register] "1"

    //label check_color
    Set V[check_reg_ color] "0"

    if V[keypad_register= ]
    image (7,94) "numbutton_small. gif" "-plain"
    "Input=U[register] :1;OK:process= zmob_meter_ register. txt" textstring=" 1"
    "-textcenter" textheight=" 40"
    image (7,105) "numbutton_small. gif" "-plain"
    "Input=U[register] :2;OK:process= zmob_meter_ register. txt" textstring=" 2"
    "-textcenter" textheight=" 40"
    image (7,116) "numbutton_small. gif" "-plain"
    "Input=U[register] :3;OK:process= zmob_meter_ register. txt" textstring=" 3"
    "-textcenter" textheight=" 40"
    endif


    if V[keypad_register= 1]
    image (7,94) "numbutton_white. gif" "-plain"
    "Input=U[register] :1;OK:process= zmob_meter_ register. txt" textstring=" 1"
    "-textcenter" textheight=" 40"
    image (7,105) "numbutton_small. gif" "-plain"
    "Input=U[register] :2;OK:process= zmob_meter_ register. txt" textstring=" 2"
    "-textcenter" textheight=" 40"
    image (7,116) "numbutton_small. gif" "-plain"
    "Input=U[register] :3;OK:process= zmob_meter_ register. txt" textstring=" 3"
    "-textcenter" textheight=" 40"
    endif

    if V[keypad_register= 2]
    image (7,94) "numbutton_small. gif" "-plain"
    "Input=U[register] :1;OK:process= zmob_meter_ register. txt" textstring=" 1"
    "-textcenter" textheight=" 40"
    image (7,105) "numbutton_white. gif" "-plain"
    "Input=U[register] :2;OK:process= zmob_meter_ register. txt" textstring=" 2"
    "-textcenter" textheight=" 40"
    image (7,116) "numbutton_small. gif" "-plain"
    "Input=U[register] :3;OK:process= zmob_meter_ register. txt" textstring=" 3"
    "-textcenter" textheight=" 40"
    endif

    if V[keypad_register= 3]
    image (7,94) "numbutton_small. gif" "-plain"
    "Input=U[register] :1;OK:process= zmob_meter_ register. txt" textstring=" 1"
    "-textcenter" textheight=" 40"
    image (7,105) "numbutton_small. gif" "-plain"
    "Input=U[register] :2;OK:process= zmob_meter_ register. txt" textstring=" 2"
    "-textcenter" textheight=" 40"
    image (7,116) "numbutton_white. gif" "-plain"
    "Input=U[register] :3;OK:process= zmob_meter_ register. txt" textstring=" 3"
    "-textcenter" textheight=" 40"
    endif

    //If V[check_reg_ color=1]
    // goto check_color
    // endif

    (for the inputscript)

    parameter register
    set V[keypad_register] "&U[register] "
    set V[check_reg_ color] "1"
    return

×