×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    5

    UI control hierarchy

    Dear All,

    We are new to python, as observed in series 60 we can create hierarchy of controls using container controls. How do i create container control and add child controls to it in Python for Series 60? If that is not possible is there another option. Appreciate your support.


    Regards,
    Dexter.

  2. #2
    Regular Contributor
    Join Date
    Dec 2007
    Location
    India
    Posts
    133

    Re: UI control hierarchy

    I had already answered you before.

    Do you know we can have sublists too. Selection lists!
    Kandyfloss

    V 7.0642.0
    18-10-06
    RH-51
    Nokia 7610

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    14

    Lightbulb Re: UI control hierarchy

    hi dexterpost
    i am not getting your exact problem. but i am attaching one code. hope you will find your answer. this is application for GUI learning.

    Code:
    import appuifw, e32, key_codes, graphics
    
    RED = (255,0,0) #tuple
    BLUE = (0,0,255) #tuple
    GRAY = (150, 150, 150)
    RectCord = [50,100,80,140]
    RountPoint = [125,125]
    Direction = u"None"
    shap = u"None"
    def DrawRound():
    	shap = u"Round"
    	img.clear(GRAY)
    	img.point((125,125), outline = BLUE, width = 30)
    	handle_redraw(None)
    
    def DrewRect():
    	shap = u"Rect"
    	img.clear(GRAY)
    	img.rectangle((50,100,80,140), fill = RED)
    	handle_redraw(None)
    
    def MoveRect(Direction):	
    	# put negetive check later
    	img.clear(GRAY)
    	if Direction == u"Left":
    		img.rectangle((50-10,100,80-10,140),fill = RED)
    	elif Direction == u"Right":
    		img.rectangle((50+10,100,80+10,140),fill = RED)
    	elif Direction == u"Up":
    		img.rectangle((50,100-10,80,140-10),fill = RED)
    	elif Direction == u"Down":
    		img.rectangle((50,100+10,80,140+10),fill = RED)
    
    
    def MoveRound (Direction):
    	# put negetive check later	
    	img.clear(GRAY)
    	if Direction == u"Left":
    		img.point((125-10,125),outline = BLUE, width = 30)
    	elif Direction == u"Right":
    		img.point((125+10,125),outline = BLUE, width = 30)
    	elif Direction == u"Up":
    		img.point((125,125-10),outline = BLUE, width = 30)
    	elif Direction == u"Down":
    		img.point((125,125+10),outline = BLUE, width = 30)
    
    
    
    def handle_redraw(rect):	
    	if img:
    		canvas.blit(img)
    
    def handle_event(event):
    	if event['keycode'] == key_codes.EKeyLeftArrow:
    		Direction = u"Left"
    		if shap.find(u"Round") == 1:
    			MoveRound(Direction)
    		else:
    			MoveRect(Direction)
    	elif event['keycode'] == key_codes.EKeyRightArrow:
    		Direction = u"Right"
    		if shap.find(u"Round") == 1:
    			MoveRound(Direction)
    		else:
    			MoveRect(Direction)
    	elif event['keycode'] == key_codes.EKeyUpArrow:
    		Direction = u"Up"
    		if shap.find(u"Round") == 1:
    			MoveRound(Direction)
    		else:
    			MoveRect(Direction)
    
    	elif event['keycode'] == key_codes.EKeyDownArrow:
    		Direction = u"Down"
    		if shap.find(u"Round") == 1:
    			MoveRound(Direction)
    		else:
    			MoveRect(Direction)	
    		
    	handle_redraw(None)		
    
    def quit():
    	app_lock.signal()
    
    appuifw.app.title = u"shapMoving"
    appuifw.app.menu = [(u"Round",DrawRound),(u"Rectangle",DrewRect)]
    
    img = None
    canvas = appuifw.Canvas(redraw_callback = handle_redraw, event_callback = handle_event)
    appuifw.app.body = canvas
    appuifw.app.screen = "normal"
    appuifw.app.exit_key_handler = quit
    
    # Intialise screen with gray
    w,h = canvas.size
    img = graphics.Image.new((w,h))
    img.clear(GRAY)
    
    app_lock = e32.Ao_lock()
    app_lock.wait()
    here everything is done by appuifw module.

Similar Threads

  1. Replies: 3
    Last Post: 2009-02-28, 13:57
  2. Replies: 0
    Last Post: 2008-02-16, 11:36
  3. AppUi - Control communication.
    By Subotai4Winds in forum Symbian
    Replies: 1
    Last Post: 2005-01-20, 08:53
  4. Replies: 1
    Last Post: 2004-11-22, 04:41
  5. D211
    By arleth in forum Multimodecards
    Replies: 7
    Last Post: 1970-01-01, 02:00

Posting Permissions

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