<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.newlc.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>NewLC - passing TInt type variable from one form to another form - Comments</title>
 <link>http://www.newlc.com/en/forum/passing-tint-type-variable-one-form-another-form</link>
 <description>Comments for &quot;passing TInt type variable from one form to another form&quot;</description>
 <language>en</language>
<item>
 <title>Re: passing TInt type variable from one form to another form</title>
 <link>http://www.newlc.com/en/forum/passing-tint-type-variable-one-form-another-form#comment-42948</link>
 <description>&lt;p&gt;The recommended way of handling data in Symbian apps is to create a Model class (or several of them with a single interface) and let the Document class own that Model (to create and destroy it). Since the doc handles the storage, it is then easy to implement also saving the model from within the Document class.&lt;/p&gt;

&lt;p&gt;View then displays the content, getting a pointer to Model from the Document. Usually the pointer to Model in View is initialized in the creation of the view.&lt;/p&gt;

&lt;p&gt;AppUi handles commands and forwards them to the Model (by calling Model&#039;s methods), Model then updates itself based on the commands. As model then is updated it can notify the views of the state changes by using an interface class (M class) the view(s) implement (Observer design pattern). &lt;/p&gt;

&lt;p&gt;This way your applications will become easily portable, it&#039;s logic being implemented in the Model, as AppUi and View &quot;only&quot; receiving commands from the user and handling the state changes of the Model by updating the View.&lt;/p&gt;

&lt;p&gt;In this case the selection of the list box in other view would tell the model that a specific object in a container would now be &quot;active&quot;; in use. When the view is then switched to the detail view, it would get the selected object in use from the model and display it.&lt;/p&gt;</description>
 <pubDate>Wed, 14 Nov 2007 13:10:15 +0100</pubDate>
 <dc:creator>Andreas</dc:creator>
 <guid isPermaLink="false">comment 42948 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: passing TInt type variable from one form to another form</title>
 <link>http://www.newlc.com/en/forum/passing-tint-type-variable-one-form-another-form#comment-42944</link>
 <description>&lt;p&gt;thanks a lot sameer for that small piece of code.. was stuck with this for the last 2 days.. it actually helped me in solving out my problem &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;&lt;/p&gt;</description>
 <pubDate>Wed, 14 Nov 2007 10:21:38 +0100</pubDate>
 <dc:creator>chandrasekharan080</dc:creator>
 <guid isPermaLink="false">comment 42944 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: passing TInt type variable from one form to another form</title>
 <link>http://www.newlc.com/en/forum/passing-tint-type-variable-one-form-another-form#comment-40463</link>
 <description>&lt;p&gt;Making public member variables is not recommended, so probably you may create the variables as a private one and create a public getter and setter functions to get/set the value of that member variables.&lt;/p&gt;</description>
 <pubDate>Mon, 06 Aug 2007 06:59:19 +0200</pubDate>
 <dc:creator>vin2ktalks</dc:creator>
 <guid isPermaLink="false">comment 40463 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: passing TInt type variable from one form to another form</title>
 <link>http://www.newlc.com/en/forum/passing-tint-type-variable-one-form-another-form#comment-40413</link>
 <description>&lt;p&gt;&lt;br /&gt;
Hi,&lt;/p&gt;

&lt;p&gt;     I done with this problem.   &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt;    &lt;img src=&quot;/sites/all/modules/smileys/packs/example/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; /&gt; &lt;/p&gt;

&lt;p&gt;    Adding code for other people...........&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Declare&amp;nbsp; variable in your &amp;quot;project_nameAppUi.h&amp;quot; as public&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TInt aNum;&amp;nbsp;&amp;nbsp; //public in appui&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Then set value for this &amp;#039;aNum&amp;#039;&amp;nbsp; in your current form as follows&amp;nbsp; (Add project_name.h file in your current CPP file) &lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Cproject_nameAppUi* iAppui;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iAppui=(CbomPassbookAppUi*)(CEikonEnv::Static()-&amp;gt;AppUi());&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iAppui-&amp;gt;aNum = 10;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //That&amp;#039;s it in current form&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Go to your next form&amp;nbsp; (.cpp file)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Add project_name.h &lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; Add following in function where you want to access previous form&amp;#039;s value as&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CbomPassbookAppUi* iAppui;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iAppui=(CbomPassbookAppUi*)(CEikonEnv::Static()-&amp;gt;AppUi());&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TInt selectedNumber = iAppui-&amp;gt;aNum;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;         Regards &lt;/p&gt;

&lt;p&gt;         Sameer&lt;/p&gt;

&lt;p&gt;        ( iWork Technologies, Pune, india )&lt;/p&gt;</description>
 <pubDate>Fri, 03 Aug 2007 08:13:16 +0200</pubDate>
 <dc:creator>iworktech_sameer</dc:creator>
 <guid isPermaLink="false">comment 40413 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: passing TInt type variable from one form to another form</title>
 <link>http://www.newlc.com/en/forum/passing-tint-type-variable-one-form-another-form#comment-40412</link>
 <description>&lt;p&gt;Thanks for your suggestions.&lt;/p&gt;

&lt;p&gt;But please let me know how i can use AppUi() for this. CAn you please give me code for that?&lt;/p&gt;

&lt;p&gt;Thanks&lt;br /&gt;
&lt;/p&gt;</description>
 <pubDate>Fri, 03 Aug 2007 07:14:00 +0200</pubDate>
 <dc:creator>iworktech_sameer</dc:creator>
 <guid isPermaLink="false">comment 40412 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: passing TInt type variable from one form to another form</title>
 <link>http://www.newlc.com/en/forum/passing-tint-type-variable-one-form-another-form#comment-40395</link>
 <description>&lt;p&gt;I hope you can create a member variable in your AppUi and a set/get function. You can access the AppUi reference from any where in your project. You may refer  this thread: &lt;a href=&quot;http://www.newlc.com/topic-13076&quot; class=&quot;bb-url&quot;&gt;get access to AppUI members&lt;/a&gt;.&lt;/p&gt;</description>
 <pubDate>Thu, 02 Aug 2007 13:22:21 +0200</pubDate>
 <dc:creator>vin2ktalks</dc:creator>
 <guid isPermaLink="false">comment 40395 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: passing TInt type variable from one form to another form</title>
 <link>http://www.newlc.com/en/forum/passing-tint-type-variable-one-form-another-form#comment-40389</link>
 <description>&lt;p&gt;One way is to use TLS. Check out Dll::Tls()&lt;/p&gt;

&lt;p&gt;Cheers,&lt;br /&gt;
Sri&lt;/p&gt;</description>
 <pubDate>Thu, 02 Aug 2007 12:15:49 +0200</pubDate>
 <dc:creator>srikanth</dc:creator>
 <guid isPermaLink="false">comment 40389 at http://www.newlc.com</guid>
</item>
<item>
 <title>passing TInt type variable from one form to another form</title>
 <link>http://www.newlc.com/en/forum/passing-tint-type-variable-one-form-another-form</link>
 <description>&lt;p&gt;Hello all,&lt;/p&gt;

&lt;p&gt;         I have two forms in my application.&lt;/p&gt;

&lt;p&gt;When I select any item from listbox (list on 1st form), i want to pass that item index to&lt;br /&gt;
another form (where i want to use that TInt variable)&lt;/p&gt;

&lt;p&gt;I can get &quot;Selected item&quot; from ListBox like.......&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;TInt itemIndex = iListBox-&amp;gt;CurrentItemIndex();&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
Now i want to use this itemIndex on another form.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.newlc.com/en/forum/passing-tint-type-variable-one-form-another-form&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.newlc.com/en/forum/passing-tint-type-variable-one-form-another-form#comments</comments>
 <category domain="http://www.newlc.com/en/forums/symbian-c">Symbian C++</category>
 <pubDate>Thu, 02 Aug 2007 11:40:15 +0200</pubDate>
 <dc:creator>iworktech_sameer</dc:creator>
 <guid isPermaLink="false">18532 at http://www.newlc.com</guid>
</item>
</channel>
</rss>
