Set Form as Sidemenu

241 views
Skip to first unread message

mhv...@gmail.com

unread,
Jul 10, 2013, 9:22:28 AM7/10/13
to codenameone...@googlegroups.com
Hi,

I want to set a Form designed in the Theme as my sidemenu, how can i do this?

Martijn

bles...@mfactory.mobi

unread,
Jul 10, 2013, 12:38:49 PM7/10/13
to codenameone...@googlegroups.com, mhv...@gmail.com
Hi did you check out the:

Codename One Hamburger Sidemenu Tutorial


From http://www.youtube.com/watch?v=Ipr1eXsu9L4

mhv...@gmail.com

unread,
Jul 10, 2013, 12:49:12 PM7/10/13
to codenameone...@googlegroups.com, mhv...@gmail.com, bles...@mfactory.mobi
Yes, i checked it before i started development. 

What i am trying is to create a form in the designer and add the sidemenu by code. Then i want to set another form as child of the actual sidemenu, so the form handles the logic.

The only thing i can add seems to be a command.

Blessing Mahlalela

unread,
Jul 10, 2013, 12:53:36 PM7/10/13
to mhv...@gmail.com, codenameone...@googlegroups.com
Hi it sounds like you want to create two forms and make one of them have a Side menu? I am not sure which one that is.

Can you please send a screen shot / paint drawing of what your are trying to achieve?

Thanks.
--
Kind Regards,
Blessing Mahlalela
MFactory co-founder, Chief Technology Officer

Website: www.mfactory.mobi
Tel: +27 76 359 8094

mhv...@gmail.com

unread,
Jul 10, 2013, 12:59:41 PM7/10/13
to codenameone...@googlegroups.com, mhv...@gmail.com, bles...@mfactory.mobi
That is indeed what i want to do. Se my screen image attached. I already made this screen including logic in the Designer and code. I don't want to rebuild the whole thing again with commands.
030_Navigation.png

bles...@mfactory.mobi

unread,
Jul 10, 2013, 1:25:01 PM7/10/13
to codenameone...@googlegroups.com, mhv...@gmail.com, bles...@mfactory.mobi
Hi even hand coded versions seem to use commands to achieve the Side menu. See handcoded Facebook app:

http://code.google.com/p/codenameone/source/browse/#svn%2Ftrunk%2FDemos%2FFacebookDemo

You can use it to achieve your objectives.

Unless some one else has another way?

mhv...@gmail.com

unread,
Jul 10, 2013, 1:29:30 PM7/10/13
to codenameone...@googlegroups.com, mhv...@gmail.com, bles...@mfactory.mobi
I checked the example too, and saw no other way. I hope Shai can answer on this, because it seems pretty normal to do such a thing to me.

Maybe this is a change request?

Shai Almog

unread,
Jul 10, 2013, 1:56:25 PM7/10/13
to codenameone...@googlegroups.com, mhv...@gmail.com, bles...@mfactory.mobi
You can't use another form as a side menu however you can customize the side menu in any way you want. Check out the Facebook demo:
        Command c = new Command("FAVORITES");
       
Label l = new Label("FAVORITES") {

           
public void paint(Graphics g) {
               
super.paint(g);
                g
.drawLine(getX(), getY() + getHeight() - 1, getX() + getWidth(), getY() + getHeight() - 1);
           
}
       
};
        l
.setUIID("Separator");
        c
.putClientProperty("SideComponent", l);

Notice that while we ad a command for the favorites we also add the component that allows you to customize the behavior through arbitrary UI. You can pretty much do anything you want in the side menu.
Reply all
Reply to author
Forward
0 new messages