Viggo Fredriksen wrote:
> Dirk Meyer wrote:
>> Hi,
>> [EMAIL PROTECTED] wrote:
>>
>>>freevo-weather
>>>===============
>>> REQUIREMENTS: freevo 1.5 (or current cvs)
>>> A mythtv-style enhanced weather plugin. This plugin allows you to
>>> track the weather at multiple locations.
>> This plugin is a great and small plugin example. I don't want to
>> integrate in Freevo because this way, a plugin writer can easily see
>> what is needed to write a plugin.
>> If you want to draw something on the skin (mail reader plugin?), this
>> is the perfect example on how to do that.
>> Dischi
>>
>
> Hello!
> I tried the weather plugin and I think it's great. Although the
> plugin required me to update to python 2.3 because of the datetime
> module (it was about time I did though :).
>
> There is a bug when drawing the screens today and extended forecast
> when having set OSD_OVERSCAN values. See:
> - http://www.matrise.net/~viggo/freevo/weather/ext_forecast.jpg
> - http://www.matrise.net/~viggo/freevo/weather/today_forecast.jpg
# set the multiplier to be used in all screen drawing
self.xmult = float(osd.width) / 800
self.ymult = float(osd.height) / 600
That's not so good. You have the function
def update_content(self):
self.parent = self.menu
self.content = self.calc_geometry(self.layout.content, copy_object=True)
self.update_functions[self.menu.curSkin]()
so self.content.x is were you should start drawing, self.content.width
is the width. Same for 'y' and 'height'. Using that, you make sure it
fit's the content area even if someone makes a new fxd file for your
plugin.
> It would be interesting to do something like this for the mailreader.
> I did some work on the gui last week, and while it's not pretty yet,
> this is what it looks like atm.
> - http://www.matrise.net/~viggo/freevo/weather/newreader.jpg
>
> It doesn't use the <content> area, but it uses the <view> area, and gets
> the sizerects to draw a scrollable surface in.
<content> is only a name I choose in lack of a better one. Looking at
your screenshot, I guess you could have four areas: screen for the
background, header and body for the mail and plugin for the idlebar.
So you could do:
| skin.register ( 'mailreader', ('screen', Header(), Body(), 'plugin'))
and draw the stuff with
| skin.draw('mailreader', mail_object_to_be_shown)
Question is, what is Header() and Body():
| class Header(skin.Area):
| """
| the mail header
| """
| def __init__(self):
| skin.Area.__init__(self, 'header')
The 'header' here refers to the fxd file. This means this area expects
<header> inside the <mailreader>. Same for Body. The class has one
draw function:
| def update_content(self):
| self.mail = self.menu
ok, self.menu is a bad name. I have to look inside the skin, maybe we
could find a better way to give you the object to draw. Now self.mail
is the object you added to skin.draw()
| self.content = self.calc_geometry(self.layout.content, copy_object=True)
Now you have the values were to draw inside self.content. Draw
everything you like with the drawing functions inside area.py:
drawroundbox, drawstring and drawimage.
HTH
Dischi
--
printk("VFS: Busy inodes after unmount. "
"Self-destruct in 5 seconds. Have a nice day...\n");
2.3.99-pre8 /usr/src/linux/fs/super.c
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Freevo-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-users