| Reply | « Previous Thread | Next Thread » |
|
Join Date: Nov 2007
Posts: 318
Location: Sertaozinho/Brazil
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 |
|
Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Rafael T.
Offline
Forum Nokia Champion
|
|
|
Quote:
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.
|
|
Join Date: Nov 2007
Posts: 318
Location: Sertaozinho/Brazil
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),...]
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()
Marcelo Barros Nokia E71, N800, N95 and XM 5800 http://www.croozeus.com http://wordmobi.wordpress.com http://jedizone.wordpress.com |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| 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 |