Login


    [timebar src]

The learning process never seems to end, especially with coding... .. .
Moderator: aloycasmir

Postby wook » 25 Mar 2009, 13:00


Code: Select all
import graphics as g, time, topwindow as tw,appswitch,appuifw, appuifw2,e32 #imported modules

appuifw.Text = lambda t=u'': appuifw2.Text(t, skinned=True) #defined 'skinned' term

wizlist=[u'Standby mode',u' ',u'Messenger',u'Music player',u'Ped',u'Start Menu',u'Messaging',u'Log',u'Contacts',u'X-plore',u'ActiveFile',u'Python'] #applications we want to show time bar

hpq=[u'VolumePopup',u'MPXInfoPopup'] #popup window apps (only in phone models with mpx music player eg. N95, N81, N82...)
akn=[u'akncapserver'] #akncapserver (some popups...), but useless in this case

sc=tw.TopWindow() #sc is TopWindow
sc.position=(78,298) #position of sc
sc.size=(84,22) #size of sc
sc.shadow=0 #shadow of sc
wz=g.Image.new((84,22)) #wz is new graphic

def reload(): #reload defined (useful for loading new screens (if skin is bit diferent for some apps)
  global wz,l,sc #global wariables defined, can be used anywhere in script
  try:sc.remove_image(wz) #try of 'easying' ram. it will clear useless image
  except:'' #if try fail, wount do anything
  try:l.clear() #clearing l image (screenshot)
  except:''
  l=g.screenshot() #l is screenshot
  try:wz.clear() #clear wz
  except:''
  wz=g.Image.new((84,22)) #wz is new graphic

while True: #while app is running (loop function)
  try:wz.clear() #try of clearing wz
  except:''
  try:sc.remove_image(wz) #easying ram
  except:''
  if appswitch.application_list(1)[0] in wizlist: #if we are in apps we want to see timer:
    s=appswitch.application_list(1)[0] #taking app current name
    l=g.screenshot() #taking screenshot
    while appswitch.application_list(1)[0] in wizlist or appswitch.application_list(1)[1] in wizlist and appswitch.application_list(1)[0] in hpq or appswitch.application_list(1)[1] in wizlist and appswitch.application_list(1)[0] in akn: #again loop (main loop) #this part is main function of whole script
      wz.blit(l,(78,298)) #adding l(screenshot) to main background(wz)
      wz.text((3,22),unicode(time.strftime('%H:%M:%S')),appuifw.Text().highlight_color,('title',32)) #adding text(time) to main background (in this case text is used as shadow)
      wz.text((2,21),unicode(time.strftime('%H:%M:%S')),appuifw.Text().color,('title',32)) #adding text to main bg
      sc.add_image(wz,(0,0)) #adding image to sc
      sc.visible=1 #showing sc
      if appswitch.application_list(1)[0]<>s: #comparing old appname and new. if diferent:
        s=appswitch.application_list(1)[0] #get new application name
        l.clear() #clear background
        sc.visible=0 #hide screen
        e32.ao_sleep(0.1) #wait 0.1 second
        reload() #reload screen (call reload func
      e32.ao_sleep(0.1) #wait a bit
      try:sc.remove_image(wz) #try of easying ram
      except:''
  else: #else part (when we dont want to show timerbar
    try:sc.remove_image(wz) #if timer was active, this will easy ram
    except:''
    sc.visible=0 #dont show timerbar
  e32.ao_sleep(0.1) #wait a bit
#ps
# in wz.text we have ('title',32), since i use 74% size of font, this might be too big. Try with ('title',22) if you use 100% font size

since i am tired of mksis etc, i will start with tutorials and examples:D
i wrote this last night:D
l0l
hope it will be usefull


N9 | N900 | E7 | N97 mini
my dArt
_________________
Image
wook!
.: [ VIP ]:.
.: [ VIP ]:.

Posts: 11893

Joined: 01 Apr 2008, 13:31

Location: rajvoSa.ba

Phone model: N9, E7 & C6-01, N97 mini, 6630

Firmware: 1.2,PR2.1,PR 1.1,v12.0.110,6.03.40



Postby aloycasmir » 25 Mar 2009, 13:41


Wow thanx wook :)
Hey , if you're tired with make sis , or py2sis , just let me know .
I'll do it for ya ;)
Best Regards,
Aloycasmir

http://tinyurl.com/congratss
Developer
Developer

Posts: 3730

Joined: 10 Jul 2008, 09:33

Location: india



Postby wook » 25 Mar 2009, 13:45


im n0t that tired:P:D ;)
N9 | N900 | E7 | N97 mini
my dArt
_________________
Image
wook!
.: [ VIP ]:.
.: [ VIP ]:.

Posts: 11893

Joined: 01 Apr 2008, 13:31

Location: rajvoSa.ba

Phone model: N9, E7 & C6-01, N97 mini, 6630

Firmware: 1.2,PR2.1,PR 1.1,v12.0.110,6.03.40



Postby billoo » 26 Mar 2009, 06:11


wook wrote:im n0t that tired:P:D ;)


you know when wook says he is tired it means he is much more working over that thing...this is the golden tip :hmm: :twisted:
SUCKER!!
SUCKER!!

Posts: 2677

Joined: 27 Aug 2008, 10:49

Location: multan , pakistan



Postby wook » 16 Apr 2009, 20:04


:beer: for new section ;)
N9 | N900 | E7 | N97 mini
my dArt
_________________
Image
wook!
.: [ VIP ]:.
.: [ VIP ]:.

Posts: 11893

Joined: 01 Apr 2008, 13:31

Location: rajvoSa.ba

Phone model: N9, E7 & C6-01, N97 mini, 6630

Firmware: 1.2,PR2.1,PR 1.1,v12.0.110,6.03.40



Postby thymox » 16 Apr 2009, 22:05


It's late, I can't find my Bluetooth dongle to send this to my phone, and I'm curious... what does this do?
Yesterday is history. Tomorrow is a mystery. Today is a gift - that's why it's called the present.
Microsoft gave me a Window to look through. Linux gives me a door to opportunities. I use Linux exclusively, and I'm proud to do so.
Symbian Freak
Symbian Freak

Posts: 1139

Joined: 23 Nov 2008, 18:52

Location: UK



Postby wook » 16 Apr 2009, 22:08


thymox wrote:It's late, I can't find my Bluetooth dongle to send this to my phone, and I'm curious... what does this do?

it prints time on bottom of screan:D...timebar...:D write code and exec it:D
N9 | N900 | E7 | N97 mini
my dArt
_________________
Image
wook!
.: [ VIP ]:.
.: [ VIP ]:.

Posts: 11893

Joined: 01 Apr 2008, 13:31

Location: rajvoSa.ba

Phone model: N9, E7 & C6-01, N97 mini, 6630

Firmware: 1.2,PR2.1,PR 1.1,v12.0.110,6.03.40



Postby LexosNokiaN95 » 17 Apr 2009, 21:42


thanks wook, great work bro

just copied and sent it to my phone as PY, opened it with python and it's great thing - shows time text with shadow :P

thanks bro :yeah: :beer:
ImageImage
Thanks to sis asterolykos for avatar and sig-bird
Symbian Freak
Symbian Freak

Posts: 1211

Joined: 14 Mar 2008, 15:50

Location: waiting for GPS signal



Postby wook » 17 Apr 2009, 21:54


it is usefull at least for me:D
and, you can change theme and it will change colours:D i like it a lot:D:D
N9 | N900 | E7 | N97 mini
my dArt
_________________
Image
wook!
.: [ VIP ]:.
.: [ VIP ]:.

Posts: 11893

Joined: 01 Apr 2008, 13:31

Location: rajvoSa.ba

Phone model: N9, E7 & C6-01, N97 mini, 6630

Firmware: 1.2,PR2.1,PR 1.1,v12.0.110,6.03.40



Postby LexosNokiaN95 » 17 Apr 2009, 22:04


yea wook, cool one, i like it - works great ;)


P.S. is any possibility to be written M3G viewer on Python???
ImageImage
Thanks to sis asterolykos for avatar and sig-bird
Symbian Freak
Symbian Freak

Posts: 1211

Joined: 14 Mar 2008, 15:50

Location: waiting for GPS signal



Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 2 guests

User Menu

Online Friends

Birthdays