Why not use a tween? You'd end up having something like this,
part {button
{state: off }
{state: animon
tween}
state: on }
{state: animoff
tween}
}
But of course, a bit more correct. And you can imagine the proram{} parts.
Sorry if this is wrong or incorrect, I just woke up.
-Toma.
2009/11/9 Carlo Ascani <[email protected]>:
> Hi all,
> i'm overriding the style for some elementary widgets. I want to change the
> style for toggles, i want a toggle like this:
> http://www.honeyrunapiaries.com/store/images/toggle_switch.jpg
> So i've made easly tha state changing at every mouse click thanks to Embryo,
> but noe i want to animate the change between on and off state.
> Here's a my button0 part with states for animation:
>
> part { name: "button0";
> mouse_events: 1;
> description{ state: "default" 0.0;
> align:0.0 0.5;
> min:40 70;
> max:40 70;
> fixed:1 1;
> rel1.to:"bg";
> rel2.to:"bg";
> image.normal: "toggle_0.png";
> }
> description{ state: "step1" 0.0;
> inherit: "default" 0.0;
> image.normal: "toggle_1.png";
> }
> description{ state: "step2" 0.0;
> inherit: "default" 0.0;
> image.normal: "toggle_2.png";
> }
> description{ state: "step3" 0.0;
> inherit: "default" 0.0;
> image.normal: "toggle_3.png";
> }
> description{ state: "step4" 0.0;
> inherit: "default" 0.0;
> image.normal: "toggle_4.png";
> }
> }
>
> And these are the scripts to manages the click and the animations of the
> button:
>
> program { name: "switch";
> signal: "mouse,down,1";
> source: "button0";
> script{
> new st[31];
> new Float:vl;
> get_state(PART:"button0", st, 30, vl);
> if(!strcmp(st, "default"))
> run_program(PROGRAM:"_anim_down_1");
> else
> run_program(PROGRAM:"_anim_up_1");
> }
> }
> program { name: "_anim_down_1";
> source: "button0";
> action: STATE_SET "step1" 0.0;
> target: "button0";
> transition: LINEAR 0.02;
> after: "_anim_down_2";
> }
> program{ name: "_anim_down_2";
> action:STATE_SET "step2" 0.0;
> target: "button0";
> transition: LINEAR 0.02;
> after: "_anim_down_3";
> }
> program{ name: "_anim_down_3";
> action:STATE_SET "step3" 0.0;
> target: "button0";
> transition: LINEAR 0.02;
> after: "_anim_down_4";
> }
> program{ name: "_anim_down_4";
> action:STATE_SET "step4" 0.0;
> target: "button0";
> transition: LINEAR 0.02;
> }
>
> program { name: "_anim_up_1";
> source: "button0";
> action: STATE_SET "step3" 0.0;
> target: "button0";
> transition: LINEAR 0.02;
> after: "_anim_up_2";
> }
> program{ name: "_anim_up_2";
> action:STATE_SET "step2" 0.0;
> target: "button0";
> transition: LINEAR 0.02;
> after: "_anim_up_3";
> }
> program{ name: "_anim_up_3";
> action:STATE_SET "step1" 0.0;
> target: "button0";
> transition: LINEAR 0.02;
> after: "_anim_up_4";
> }
> program{ name: "_anim_up_4";
> action:STATE_SET "default" 0.0;
> target: "button0";
> transition: LINEAR 0.02;
> }
>
> I'm expecting that every click anims the button once down and once up, but
> it anims button down at EVERY click.
> What's wrong with my theme.
>
> Thank you, also for helping me on irc, you're great guys!
>
>
>
> --
> Carlo Ascani
> La politica pratica consiste nell'ignorare i fatti. (Henry Adams)
> C programmers never die. They are just cast into void.
> -------------------------------------
> msn: [email protected]
> cell: 320 2915799
> Visita www.ptondo.it
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> enlightenment-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel