Iev-nitris / touchpal

Automatically exported from code.google.com/p/touchpal
0 stars 1 forks source link

editing your profile HOW TO ... Button programmation #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This modification is not working

I want to display a On and a Off image for ABRIS button Cursor or
Brigthness, and for other buttons

I added in comment clickabledata.lua extract for that button

How to do this ? 

what is the good syntax ?

below is code extract :

        <Button Name="ABRISCursorUp">
            <NetworkID>523</NetworkID>
            <Width>46</Width>
            <Height>43</Height>
            <DefaultValue>0</DefaultValue>
            <PushedAction>KD:7</PushedAction>
            <ReleaseAction>KU:7</ReleaseAction>
            <State>
                <StateValue>0</StateValue>
                <StateValue>1</StateValue>
<!-- 
elements["ABRIS_SHUNT_PTR"]     = {class = {class_type.LEV, 
action = {device_commands.Button_6},
stop_action = {0} ,
arg_value{0.04},
arg_lim = {{0,1} -->
                <Image>Hellfrog\ABRIS_Cursor_RightUp_out.png</Image>
                <PushedImage>Hellfrog\ABRIS_Cursor_RightUp_in.png</PushedImage>
            </State>
        </Button>

thank you for support

Original issue reported on code.google.com by member.1...@neuf.fr on 21 Oct 2009 at 9:10

GoogleCodeExporter commented 8 years ago
forgotten to post this other one : 

        <Button Name="ABRISBrightnessUp">
            <NetworkID>517</NetworkID>
            <Width>46</Width>
            <Height>43</Height>
            <PushedAction>KD:0</PushedAction>
            <ReleaseAction>KU:0</ReleaseAction>
            <Image>Hellfrog\Abris_Bright_Inc.png</Image>
        </Button>

Original comment by member.1...@neuf.fr on 21 Oct 2009 at 9:18

GoogleCodeExporter commented 8 years ago
and how to choose between these 3 versions : could you explain which one is 
good or
how to if none ?

        <Button Name="ABRISPower">
            <NetworkID>130</NetworkID>
            <Width>46</Width>
            <Height>43</Height>
            <DefaultValue>0.0</DefaultValue>
            <State>
                <StateValue>0.0</StateValue>
                <PushedAction>NS:C,9,3009,1.0</PushedAction>
                <PushedImage>Abris_Off.png</PushedImage>
            </State>
            <State>
                <StateValue>1.0</StateValue>
                <PushedAction>NS:C,9,3009,0.0</PushedAction>
                <PushedImage>Abris_On.png</PushedImage>
            </State>
        </Button>     
        <Button Name="ABRISBlankScreen">

        <Button Name="ABRISPower">
            <NetworkID>130</NetworkID>
            <Width>46</Width>
            <Height>43</Height>
            <DefaultValue>0.0</DefaultValue>
            <PushedAction>NS:C,9,3009,1.0</PushedAction>
            <ReleaseAction>NS:C,9,3009,0.0</ReleaseAction>
            <State>
                <StateValue>0.0</StateValue>
                <StateValue>1.0</StateValue>
                <Image>Abris_Off.png</Image>
                <PushedImage>Abris_On.png</PushedImage>
            </State>
        </Button>           

        <Button Name="ABRISPower">
            <NetworkID>130</NetworkID>
            <Width>46</Width>
            <Height>43</Height>
            <DefaultValue>0.0</DefaultValue>        
            <State>
                <StateValue>0</StateValue>
                <Image>Hellfrog\Abris_Off.png</Image>
                <PushedImage>Hellfrog\Abris_On.png</PushedImage>
                <PushedAction>NS:C,9,3009,1.0</PushedAction>
            </State>
            <State>
                <StateValue>1</StateValue>
                <Image>Hellfrog\Abris_On.png</Image>
                <PushedImage>Hellfrog\Abris_Off.png</PushedImage>
                <ReleaseAction>NS:C,9,3009,0.0</ReleaseAction>
            </State>        

Original comment by member.1...@neuf.fr on 22 Oct 2009 at 10:26

GoogleCodeExporter commented 8 years ago
To extract the value for the cursor button state you want argument 523.  So add 
[523]
= "" to the gIndicators array.  For the brightness button same thing except 
[517]="".

Here is the explanation of the three different versions of ABRISPower you have

Example 1 -
This will not show any image of the button until you touch it, then it will 
display
the image you have in the <PushedImage> tags.  So in this case the background 
image
for the ABRIS has the buttons in normal state and not depressed.  Only at the 
time
you where actually pushing the buttons would your new images show.

The other thing to note is that it is only sending one click to the Black 
Shark. 
This is appropriate for switches (like the ABRIS power is).  Momentary buttons 
need a
click and a release command as well.

Example 2 -
In this case you have specified both a image and pushed image so the button 
defines
the graphics instead of the background at all times.  You only have one state 
for
this button so it will always use these same images.  The actions in this 
sequence
are appropriate for momentary push buttons (like those on the PVI or Autopilot
panels.)  It sends a 1.0 to push the button down and then a 0.0 to release it.  
This
is refereed to as the stop action in the clickabledata.lua file.

Example 3 -
This example is essentially the same as example 1 but you have defined specific
graphics instead of letting the background image show through.  In both example 
1 and
3 notice that the states change the action sent.  This mimics behavior of a 
toggle
switch.  When it's off you send the on click, when it's on you send the off 
click.

Hope that helps.

Original comment by ccourtn...@gmail.com on 31 Oct 2009 at 1:41