You Are Here:

Community: Developer Discussion Boards

#1 Old appuifw.app.layout - 2009-01-26, 14:05

Join Date: Sep 2005
Posts: 314
Location: Finland, Helsinki
aaaaapo
Offline
Regular Contributor
I've been wondering what the heck is this EControlPane, ETitlePane etc. stuff in appuif module.

The Documentation (1.4.5 PDF, Chapter 5.1.4 Application Type) says following:

Quote:
layout(layout_id)
Note: Available from S60 2ndEd FP3 onwards (inclusive).
Returns as a tuple the size and the position of the requested layout id. The logical lay-
outs are outlined partly in Figure 5.2. The position is given from the top left corner. The
layout id can be one of the constants defined in module appuifw.

EScreen: Screen.
EApplicationWindow: Window that fills the entire screen.
EStatusPane: Indicates common components for most of the applications.
...
This doesn't help too much, so I wrote a simple script which shows a list of those Esomething entries. And after pressing select button it shows a TopWindow where appuifw.app.layout(appuifw.Esomething) says it should stay.

Here is the script:

Code:
# Aapo Rista 2009 (public domain)

import appuifw
import e32
import TopWindow
import graphics

def show_layout_window(text, size, position, color):
    """Show a TopWindow instance in 'position'."""
    topwin = TopWindow.TopWindow()
    topwin.size = size
    topwin.position = position
    topwin.corner_type = 'square'
    topwin.background_color = 0x0000ff
    topwin.shadow = 0
    img = graphics.Image.new(size)
    img.clear(fill=color) 
    img.text((0, 15), text, font=(u"Series 60 Sans", 15), fill=0x000000)
    topwin.add_image(img, (0,0))
    topwin.show()
    return topwin

def get_layout_ids():
    """Put all Esomething attributes found from appuifw to a list."""
    layout_ids = []
    for layout in dir(appuifw):
        if layout.startswith("E"):
            layout_ids.append(unicode(layout))
    return layout_ids

def show_layout():
    """Show requested appuifw.Esomething on the screen."""
    layout = layout_ids[layout_listbox.current()]
    text = layout
    try:
        (size, position) = appuifw.app.layout(eval("appuifw.%s" % (layout)))
        topwin = show_layout_window(text, size, position, 0xffff00)
    except:
        topwin = show_layout_window("FAILED: " + text, (150, 50), (20, 100), 0xff0000)
    e32.ao_sleep(0.5)
    topwin.hide()

def exit_key_handler():
    app_lock.signal()

layout_ids = get_layout_ids()
layout_listbox = appuifw.Listbox(layout_ids, show_layout)
appuifw.app.body = layout_listbox
app_lock = e32.Ao_lock()
appuifw.app.exit_key_handler = exit_key_handler
app_lock.wait()
Reply With Quote

#2 Old Re: appuifw.app.layout - 2009-01-27, 08:35

Join Date: May 2007
Posts: 2,738
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Hi Aaaapo,

Why not add it to the Wiki, with few comments?

Best Regards,
Croozeus
Reply With Quote

#3 Old Re: appuifw.app.layout - 2009-01-27, 12:22

Join Date: Sep 2005
Posts: 314
Location: Finland, Helsinki
aaaaapo
Offline
Regular Contributor
Quote:
Originally Posted by croozeus View Post
Why not add it to the Wiki, with few comments?
http://wiki.forum.nokia.com/index.ph...Layout_Example

Not much comments yet, though. But hey, it's a wiki, isn't it? :-)
Reply With Quote

#4 Old Re: appuifw.app.layout - 2009-01-27, 12:27

Join Date: May 2007
Posts: 2,738
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Quote:
Originally Posted by aaaaapo View Post
http://wiki.forum.nokia.com/index.ph...Layout_Example

Not much comments yet, though. But hey, it's a wiki, isn't it? :-)
Thanks, its good!
Reply With Quote

#5 Old Re: appuifw.app.layout - 2009-01-27, 12:51

Join Date: Nov 2007
Posts: 319
Location: Sertaozinho/Brazil
Send a message via MSN to marcelobarrosalmeida Send a message via Skype™ to marcelobarrosalmeida
marcelobarrosalmeida's Avatar
marcelobarrosalmeida
Offline
Forum Nokia Champion
I only could check your code today. Really interesting for displaying messages without conflict with user interface. Sometime ago I was trying to put a topwindow in my screen and all tested position seemed terrible.


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

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