You Are Here:

Community: Developer Discussion Boards

#1 Old Cool Basic framework for creating user interface - 2009-01-27, 17:46

Join Date: Nov 2007
Posts: 318
Location: Sertaozinho/Brazil
Send a message via MSN to marcelobarrosalmeida Send a message via Skype™ to marcelobarrosalmeida
marcelobarrosalmeida's Avatar
marcelobarrosalmeida
Online
Forum Nokia Champion
Hi Folks !

Another piece of code from my personal projects ! Now, it is a Basic framework for creating user interface.

It helped me a lot when creating programs with several dialogs. The text is long, I known. Better keep your eyes in the examples ...

Comments and improvements are welcome!

Thanks !


Marcelo Barros
Nokia E71, N800, N95 and XM 5800
http://www.croozeus.com
http://wordmobi.wordpress.com
http://jedizone.wordpress.com
Reply With Quote

#2 Old Re: Basic framework for creating user interface - 2009-01-27, 21:24

Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Send a message via Skype™ to Rafael T.
Rafael T.'s Avatar
Rafael T.
Offline
Forum Nokia Champion
Quote:
Originally Posted by marcelobarrosalmeida View Post
Hi Folks !

Another piece of code from my personal projects ! Now, it is a Basic framework for creating user interface.

It helped me a lot when creating programs with several dialogs. The text is long, I known. Better keep your eyes in the examples ...

Comments and improvements are welcome!

Thanks !
Hi Marcelo,


Once again thanks for a good example!

The code seems really nice

I guess some parts will fit perfectly in my Genius game



Thank you,

Rafael.
Last edited by Rafael T. : 2009-01-27 at 21:43.
Reply With Quote

#3 Old Re: Basic framework for creating user interface - 2009-05-31, 21:15

Join Date: Nov 2007
Posts: 318
Location: Sertaozinho/Brazil
Send a message via MSN to marcelobarrosalmeida Send a message via Skype™ to marcelobarrosalmeida
marcelobarrosalmeida's Avatar
marcelobarrosalmeida
Online
Forum Nokia Champion
Hi People,

I implemented now support for tabs. Really simple to create an application with several tabs. Just replace the body by a list of bodies with the following format:

Code:
[(tab_text, body, menu),(tab_text, body, menu),...]
where:
  • tab_text: unicode string used in tab
  • body: a valid body (Listbox, Text or Canvas)
  • menu: menu for that body

Each entry in this list will be displayed in a tab. You can specify a global menu to be added to the bottom of each tab menu. This way, it is simple to share common function (like exit) among all tabs. Just specify this menu when calling Dialog() or Application().

Take a look in the following example, with four tabs:

Code:
# -*- coding: utf-8 -*-
#
# Marcelo Barros de Almeida
# marcelobarrosalmeida (at) gmail.com
# License: GPL3
 
from window import Application
from appuifw import *
 
class MyApp(Application):
    def __init__(self):
        # defining menus for each tab/body
        ma=[(u"menu a",lambda:self.msg(u"menu a"))]
        mb=[(u"menu b",lambda:self.msg(u"menu b"))]
        mc=[(u"menu c",lambda:self.msg(u"menu c"))]
        md=[(u"menu d",lambda:self.msg(u"menu d"))]
        # common menu for all tabs
        common_menu=[(u"common menu",lambda:self.msg(u"common menu"))]
        # bodies
        ba=Listbox([u"a",u"b",u"c"])
        bb=Canvas()
        bc=Text(u"Text")
        bd=Listbox([u"1",u"2",u"3"])
        
        Application.__init__(self,
                             u"MyApp title",
                             [(u"Tab a",ba,ma),(u"Tab b",bb,mb),
                              (u"Tab c",bc,mc),(u"Tab d",bd,md)],
                             common_menu)
 
    def msg(self,m):
        note(m,"info")
        
if __name__ == "__main__":
    app = MyApp()
    app.run()
Screenshot and full article at wiki.


Marcelo Barros
Nokia E71, N800, N95 and XM 5800
http://www.croozeus.com
http://wordmobi.wordpress.com
http://jedizone.wordpress.com
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
software java plug-in graphical user interface for nokia e71 yozua General Discussion 4 2008-10-09 10:18
J2ME User Interface Developer - Montreal mobileapps.hr News, Announcements and Job Listings 0 2008-10-03 13:53
LWUIT - Lightweight User Interface Toolkit thiagobrunoms Mobile Java Media (Graphics & Sounds) 1 2008-09-17 18:38
What is the user interface of the Nokia D211 like? Nokia_FAQ Multimodecards 1 2002-05-14 17:35
What is the Gateway user interface like? Nokia_FAQ Nokia M2M 1 2002-05-13 22:57

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia