| Reply | « Previous Thread | Next Thread » |
|
Buddies,
am trying to use tabs and forms together. but it seems when form gets activated, tabs disappears from the screen. my requirement is simple 2 tabs having one form each. can anyone send me a quick sample code? cheers, m |
|
Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Rafael T.
Offline
Forum Nokia Champion
|
|
Hi trymukesh,
Wouldn't be better if you put your current code here and we try to correct it? Don't forget to use the code tags by clicking on the # symbol at the post editor ![]() Waiting your code, Rafael. |
|
Quote:
Thanks for the quick response, here is the code Million thanks in anticipation. warm regards, M Code:
import e32, appuifw, math
# create an Active Object
app_lock = e32.Ao_lock()
## Simple MyFormView class to demonstrate the use of forms.
class MyFormView( object ):
## The constructor.
def __init__( self ):
## Bool
self._iIsSaved = False
## Country list.
self._iCountries = [u'India', u'USA', u'UK', u'Finland', u'Canada']
## Form fields.
self._iFields = [(u'Weight (kgs)','float', 10.10),
(u'Country','combo', (self._iCountries,0))]
## Displays the form.
def setActive( self ):
self._iIsSaved = False
self._iForm = appuifw.Form(self._iFields, appuifw.FFormEditModeOnly)
self._iForm.menu = [(u"Nano",self.tata),(u"Ikon",self.ford)]
self._iForm.save_hook = self._markSaved
self._iForm.flags = appuifw.FFormEditModeOnly
self._iForm.execute( )
## save_hook send True if the form has been saved.
def _markSaved( self, aBool ):
self._iIsSaved = aBool
## save_hook send True if the form has been saved.
def tata( self ):
appuifw.note( unicode(self._iForm[0][2]) , 'info' )
## save_hook send True if the form has been saved.
def ford( self ):
appuifw.note( unicode(self._iForm[0][2]) , 'info' )
## _iIsSaved getter.
def isSaved( self ):
return self._iIsSaved
# here you can put for example all the getters you need:
#---------------------------------------------------------
## Return mobile field value.
def getWeight( self ):
return self._iForm[0][2]
def getCountry( self ):
return self._iCountries[self._iForm[1][2][1]].encode( "utf-8" )
#Create a tab handler that switches between tabs
def handle_tab(index):
#Switch to the tab according to index
if(index==0):
appuifw.app.body = tab1
if(index==1):
appuifw.app.body = tab2
def exit_key_handler():
app_lock.signal()
if __name__ == "__main__":
tab1 = appuifw.Text(u"My Tab 1")
tab2 = appuifw.Text(u"My Tab 2")
##Set the tabs
appuifw.app.set_tabs([u"One", u"Two"], handle_tab)
#Set the default tab to the first tab, for example
appuifw.app.body = tab1
#appuifw.app.title = u'Trying out forms'
myForm = MyFormView( )
myForm.setActive( )
if myForm.isSaved( ):
print myForm.getWeight( )
print myForm.getCountry( )
appuifw.app.exit_key_handler = exit_key_handler
app_lock.wait()
|
|
Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Rafael T.
Offline
Forum Nokia Champion
|
|
Hi trymukesh,
Well, I tested you code here. If I were you, I wouldn't use forms in this case, because the default behavior of the tabs if pressing the right and left arrows to switch them, but in your case, it's a form, so it will be in edit mode and if you press right/left the keys, it won't change the tabs. Sorry if this was confusing, hope you can understand ![]() Instead, you can use a listbox ![]() Hope it helps, Rafael. |
|
Quote:
Thank you for your guidance. Just to avoid last minute jitters, i stuck to form and curb some functionality of my application. Thanks pal, Mukesh |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| appuifw Tabs and forms | stobbsc | Python | 3 | 2008-10-08 11:54 |
| Forms NOT working | XDnl | Symbian User Interface | 14 | 2008-07-10 17:51 |
| tabs & text editor | sumit.rathi | General Symbian C++ | 4 | 2008-07-04 18:13 |
| Working in the emulator, not working on the mobile?? | sabb0ur | General Browsing | 2 | 2003-08-06 21:27 |
| 7650 / BlueUSB Bluetooth USB dongle / PC-suite not working! | mahaikol | Bluetooth Technology | 7 | 2002-12-28 07:47 |