Skip to main content

bug in the new drop command menu?

3 replies [Last post]
Anonymous

Hi all,

I have a back command with the following code:

Command backCommand = new Command("Back") {

public void actionPerformed(ActionEvent arg0) {
parent.show();
}
};

and parent is form1.
This command + 4 others are added to the form2 causing a command menu
when the user presses the menu soft button. When choosing back the
previous form1 is shown, so far so good. But now pressing
up/down/left/right brings back the command menu from form2.

so at form1 we get the command menu of form2 when pressing
non-softkeys. (softkeys don't seem to work)

This was not the case using the previous code drop.

--
http://www.somatik.be
Microsoft gives you windows, Linux gives you the whole house.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
chen

Hi,
This simple use case works for me, can you share your forms code?

Regards,
Chen

Francis De Brabandere wrote:
> Hi all,
>
> I have a back command with the following code:
>
> Command backCommand = new Command("Back") {
>
> public void actionPerformed(ActionEvent arg0) {
> parent.show();
> }
> };
>
> and parent is form1.
> This command + 4 others are added to the form2 causing a command menu
> when the user presses the menu soft button. When choosing back the
> previous form1 is shown, so far so good. But now pressing
> up/down/left/right brings back the command menu from form2.
>
> so at form1 we get the command menu of form2 when pressing
> non-softkeys. (softkeys don't seem to work)
>
> This was not the case using the previous code drop.
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

Francis De Brabandere

Code below, how to reproduce:

Command "Form2"
Command "Menu"
Select "Back"
now up/down/left/right should give you the form2 menu
other commands are broken

It must have something to do with the

setTransitionInAnimator(in);
setTransitionOutAnimator(out);

and in the second form

setMenuTransitions(null, null);

CODE:

import com.sun.lwuit.Command;
import com.sun.lwuit.Form;
import com.sun.lwuit.animations.CommonTransitions;
import com.sun.lwuit.animations.Transition;
import com.sun.lwuit.events.ActionEvent;

/**
*
* @author francisdb
*/
public class TestForm extends Form{

public TestForm() {
super("Form1");
this.addCommand(new Command("Form2"){

public void actionPerformed(ActionEvent arg0) {
new Form2(TestForm.this).show();
}

});
this.addCommand(new Command("Exit"));

Transition out =
CommonTransitions.createSlide(CommonTransitions.SLIDE_HORIZONTAL,
false, 300);
Transition in =
CommonTransitions.createSlide(CommonTransitions.SLIDE_HORIZONTAL,
true, 300);
setTransitionInAnimator(in);
setTransitionOutAnimator(out);

}

private class Form2 extends Form {

private final Form parent;

public Form2(final Form parent) {
super("Form2");
this.parent = parent;
setMenuTransitions(null, null);
Command backCommand = new Command("back") {

public void actionPerformed(ActionEvent event) {
parent.show();
}
};

this.addCommand(new Command("nothing"));
this.addCommand(new Command("nothing2"));
this.addCommand(backCommand);
this.addCommand(new Command("nothing3"));
}
}

}

On Tue, Jul 15, 2008 at 3:22 PM, chen wrote:
> Hi,
> This simple use case works for me, can you share your forms code?
>
> Regards,
> Chen
>
> Francis De Brabandere wrote:
>>
>> Hi all,
>>
>> I have a back command with the following code:
>>
>> Command backCommand = new Command("Back") {
>>
>> public void actionPerformed(ActionEvent arg0) {
>> parent.show();
>> }
>> };
>>
>> and parent is form1.
>> This command + 4 others are added to the form2 causing a command menu
>> when the user presses the menu soft button. When choosing back the
>> previous form1 is shown, so far so good. But now pressing
>> up/down/left/right brings back the command menu from form2.
>>
>> so at form1 we get the command menu of form2 when pressing
>> non-softkeys. (softkeys don't seem to work)
>>
>> This was not the case using the previous code drop.
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>

--
http://www.somatik.be
Microsoft gives you windows, Linux gives you the whole house.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

chen

Hi,
Yes that's a bug related to the transitions.
Comment out the setMenuTransitions(null, null) line to workaround this.
We will fix it for next code drop.

Chen

Francis De Brabandere wrote:
> Code below, how to reproduce:
>
> Command "Form2"
> Command "Menu"
> Select "Back"
> now up/down/left/right should give you the form2 menu
> other commands are broken
>
> It must have something to do with the
>
> setTransitionInAnimator(in);
> setTransitionOutAnimator(out);
>
> and in the second form
>
> setMenuTransitions(null, null);
>
> CODE:
>
> import com.sun.lwuit.Command;
> import com.sun.lwuit.Form;
> import com.sun.lwuit.animations.CommonTransitions;
> import com.sun.lwuit.animations.Transition;
> import com.sun.lwuit.events.ActionEvent;
>
> /**
> *
> * @author francisdb
> */
> public class TestForm extends Form{
>
>
> public TestForm() {
> super("Form1");
> this.addCommand(new Command("Form2"){
>
> public void actionPerformed(ActionEvent arg0) {
> new Form2(TestForm.this).show();
> }
>
> });
> this.addCommand(new Command("Exit"));
>
> Transition out =
> CommonTransitions.createSlide(CommonTransitions.SLIDE_HORIZONTAL,
> false, 300);
> Transition in =
> CommonTransitions.createSlide(CommonTransitions.SLIDE_HORIZONTAL,
> true, 300);
> setTransitionInAnimator(in);
> setTransitionOutAnimator(out);
>
> }
>
>
>
> private class Form2 extends Form {
>
> private final Form parent;
>
> public Form2(final Form parent) {
> super("Form2");
> this.parent = parent;
> setMenuTransitions(null, null);
> Command backCommand = new Command("back") {
>
> public void actionPerformed(ActionEvent event) {
> parent.show();
> }
> };
>
> this.addCommand(new Command("nothing"));
> this.addCommand(new Command("nothing2"));
> this.addCommand(backCommand);
> this.addCommand(new Command("nothing3"));
> }
> }
>
>
> }
>
> On Tue, Jul 15, 2008 at 3:22 PM, chen wrote:
>
>> Hi,
>> This simple use case works for me, can you share your forms code?
>>
>> Regards,
>> Chen
>>
>> Francis De Brabandere wrote:
>>
>>> Hi all,
>>>
>>> I have a back command with the following code:
>>>
>>> Command backCommand = new Command("Back") {
>>>
>>> public void actionPerformed(ActionEvent arg0) {
>>> parent.show();
>>> }
>>> };
>>>
>>> and parent is form1.
>>> This command + 4 others are added to the form2 causing a command menu
>>> when the user presses the menu soft button. When choosing back the
>>> previous form1 is shown, so far so good. But now pressing
>>> up/down/left/right brings back the command menu from form2.
>>>
>>> so at form1 we get the command menu of form2 when pressing
>>> non-softkeys. (softkeys don't seem to work)
>>>
>>> This was not the case using the previous code drop.
>>>
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
>> For additional commands, e-mail: users-help@lwuit.dev.java.net
>>
>>
>>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net