Indigo Rose Software
  #1  
Old 12-05-2007
Davide It Davide It is offline
Forum Member
 
Join Date: Oct 2006
Posts: 7
Grin ComboBox bug???

Hello everybody.
My suspect is the following is a bug of AMS 7.

I wanted to use a ComboBox to select among three items. I wanted also to display some text in two labels, according to the selected item.
That's how I wrote down the code.
In On Startup section tAppName (table) and bIsDebug (boolean) are initialized, according to ini file values (boolean variable is set to true).

In Global Functions section the following function is present.
function ShowDebugMessage( sInString )
if bIsDebug then
Dialog.Message( "Debug", sInString );
end
end


In On Preload section of a given Page, the following instructions are present.
ShowDebugMessage( "Press OK to continue" );
ComboBox.ResetContent( "CoBAppName" );
for i = 1, Table.Count( tAppName ), 1 do
ComboBox.AddItem( "CoBAppName", tAppName[ i ], "" );
end


If ShowDebugMessage is invoked, CoBAppName ComboBox is correctly initialized.
Vice-versa, if I comment that function, all items of ComboBox are blank!!!
Why? I just cannot understand.
I moved around the obstacle using a ListBox instead of a ComboBox (it works!), but I am still curious...

Thanks to everyone that will try to help me.
Reply With Quote
  #2  
Old 12-05-2007
azmanar's Avatar
azmanar azmanar is offline
Indigo Rose Customer
 
Join Date: Oct 2004
Location: East, South & West Asia
Posts: 948
Hi,

Have you tried switching the codes from the Page OnPreload to Page OnShow?
__________________
Newbie Examples
------> AMS 7.5 : amstudio.azman.info
----> AMS 6 & 5: www.azman.info/ams/
----> Twitter: www.twitter.com/azmanar/
Reply With Quote
  #3  
Old 12-05-2007
Dermot Dermot is offline
Indigo Rose Customer
 
Join Date: Apr 2004
Location: Vancouver, Canada
Posts: 1,520
You can't add items to a ComboBox in the On Preload event. You must do it in the On Show event.
__________________
Dermot

AMS Add-ons - xDialog.com

A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.
Reply With Quote
  #4  
Old 12-05-2007
Davide It Davide It is offline
Forum Member
 
Join Date: Oct 2006
Posts: 7
Dermot, azmanar, you are right!!!

It just works moving that portion of code from On Preload to On Show event.

But I can tell you this: since I started learning and using AMS, I am used to write code in On Preload event as much as I can. (The final effect is more elegant, to me.)
And, believe me, I made a working application in AMS 6 with a similar portion of code in On Preload event!

That's why I was thinking to a bug of AMS 7...

Thanks a lot anyway, you guys were very fast!!!
Reply With Quote
  #5  
Old 12-05-2007
azmanar's Avatar
azmanar azmanar is offline
Indigo Rose Customer
 
Join Date: Oct 2004
Location: East, South & West Asia
Posts: 948
Hi Davide,

I learnt it from Dermot.
__________________
Newbie Examples
------> AMS 7.5 : amstudio.azman.info
----> AMS 6 & 5: www.azman.info/ams/
----> Twitter: www.twitter.com/azmanar/
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
TrueUpdate 2.0 Update (v2.0.6.0) Released Brett TrueUpdate 2.0 0 10-31-2006 02:10 PM
ComboBox Reset azmanar AutoPlay Media Studio 6.0 2 12-29-2005 01:46 PM
New Setup Factory 7.0 (v 7.0.2.0) Available Darryl Setup Factory 7.0 Discussion 9 03-06-2005 02:57 PM
AutoPlay Media Studio 4.0.0.3 Released Brett AutoPlay Media Studio 4.0 0 12-11-2002 09:39 AM


All times are GMT -6. The time now is 04:36 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software