Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 11 of 11
  1. #1
    Join Date
    Jun 2006
    Posts
    36

    Star Two Listbox in the same project

    Hi,

    How can I use two different Listbox in the same project and each listbox
    has its own pages?

    Any examples?

    Hope it's clear.

    Thank you.

  2. #2
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    What do you mean by "has its own page"s?
    No problems to have two LBs, each one behaving separately.
    Please explain

    Yossi

  3. #3
    Join Date
    Jul 2006
    Location
    In a black hole
    Posts
    91
    Quote Originally Posted by Brave Heart
    Hi,

    How can I use two different Listbox in the same project and each listbox
    has its own pages?

    Any examples?

    Hope it's clear.

    Thank you.
    As long as the LBs have different names, which AMS will force, you can do as many LBs as you want. One LB calls on this and one on that. No different really then using one big one. I know that's not what you're looking for but I used it as an example. If possible try loading the information used to process in the Data slot. If say you use the same reg address except for the Value, just put the value in the data, and a Variable in the Value part of the address to accept what ever is passed ot it.

    Hope I made some sense. Some guys here are better at describing things then me.

  4. #4
    Join Date
    Jun 2006
    Posts
    36
    Thanks for replying.

    Could you plz have a look to the atached file? It may make my idea clearer.

    http://www.sendspace.com/file/opbqn6

    The problem is that whenever I add a new page to one of the LBs it also
    appears in the other one.

    Now, I want to add several pages to (Stories List) and others to (Movies List)
    but I don't want them to get mixed.

    Thanks a lot.

  5. #5
    Join Date
    Feb 2004
    Location
    Cowfields of Germany
    Posts
    617
    your ZIP file is broke. winzip doesnt recognize it.

    chris

  6. #6
    Join Date
    Jun 2006
    Posts
    36
    Here is the file again. It's copressed with winrar.

    http://www.sendspace.com/file/sbejj9

    Thanks

  7. #7
    Join Date
    Feb 2004
    Location
    Cowfields of Germany
    Posts
    617
    your problem is... you only have 3 pages. Main....Movies.....Stories

    you have this code (this is copied from the Movies page.

    Code:
    -- get the pages
    tbl_Pages = Application.GetPages();
    
    if tbl_Pages then
    	
    	-- clear the listbox
    	for num_Item = 1, ListBox.GetCount("ListBox2") do
    		ListBox.DeleteItem("ListBox2", 1);
    	end
    	
    	for num_Index, str_PageName in tbl_Pages do
    		ListBox.AddItem("ListBox2", str_PageName, "");
    		end
    	end
    it looks like you want a seperate page for each movie/stories.

    well you need to create the pages for those movies/stories, one per page.

    name the pages movie1, movie2, movie3, .... same for the stories.

    then you can use this script.

    Code:
    -- get the pages
    tbl_Pages = Application.GetPages();
    
    if tbl_Pages then
    	
    	-- clear the listbox
    	for num_Item = 1, ListBox.GetCount("ListBox2") do
    		ListBox.DeleteItem("ListBox2", 1);
    	end
    	
    	for num_Index, str_PageName in tbl_Pages do
    		nMovie = String.Find(str_PageName, "movie", 1, false)
    		if nMovie ~= -1 then
    		ListBox.AddItem("ListBox2", str_PageName, "");
    		end
    	end
    end
    it will step through the table and only put the pages that have the word MOVIE in its title into your listbox.

    change the text in red to stor and it will do the same for that listbox too.


    now, the way i would go about doing this is, put the movies you want in your project into one folder (AutoPlay\ Videos)

    the same for the stories (AutoPlay\Stories)

    then you would only need one page (you also only need one page with the way you're working it right now) with 2 listbox's

    Use this script to fill both listbox's with the contents of the folders.

    Code:
    ----On your Page-Show
    ListBox.DeleteItem("ListBox1", -1);
    ListBox.DeleteItem("ListBox2", -1);
    tVids = File.Find("AutoPlay\\Videos", "*.*", false, false, "", "")
    count = 1
    for y,z in tVids do
    ListBox.AddItem("ListBox1", "Movie"..count, z)
    count = count +1
    end
    Code:
    --On Your Listbox's
    tSelected = ListBox.GetSelected("ListBox1")
    GO = ListBox.GetItemData("ListBox1", tSelected[1])
    
    Dialog.Message(tSelected[1], GO, MB_OK, MB_ICONNONE, MB_DEFBUTTON1
    HTH

    Chris

  8. #8
    Join Date
    Jun 2006
    Posts
    36
    Thank you very much.

    I found some difficulties to aplly the codes you already posted.

    Could you plz help me with an example.

    Thanks

  9. #9
    Join Date
    Dec 2003
    Posts
    891
    Brave Heart and other interested newbies
    Here is a simple little learning example that will display almost all of the media supported in AMS 6. It only uses 2 pages to do so. A Menu and Media Viewer page.
    There are several listboxes on the menu page to "drill" down to the media type. These are populated from the files in folders under the project AutoPlay directory (Docs, Audio, etc.) I included a sample of each media type except video missing to keep the .apz size down).
    All info labels are set by media selected.
    It has the Media Player plugin (for video and music.), Web (which can support several text formats, html, text, .doc, .rtf, even PDF if the system has Adobe reader installed, etc), Image, and Flash all on one page. The viewer type is set by a variable when the media type is selected prior to the page jump.
    Just put your media files in the folders shown in the script. It is simple, so there's room for lots of custom tweaks.
    Attached Files
    Last edited by Roboblue; 07-29-2006 at 08:15 PM.

  10. #10
    Join Date
    Jun 2006
    Posts
    36
    Thank you Robo.

    But what I really need is what stickck suggested in reply 7. I need an example

    to apply the codes he posted.

    Thanks

  11. #11
    Join Date
    Feb 2004
    Location
    Cowfields of Germany
    Posts
    617
    Sorry. i only have Version 5 at work. it should convert just fine to Version 6.

    Chris
    Attached Files

Similar Threads

  1. Status of project when doing a backup
    By yosik in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 05-01-2005, 12:46 AM
  2. Example: Using the ListBox object
    By Ted Sullivan in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 05-07-2004, 12:24 PM
  3. HOWTO: Open a Version 3.0 Project in Version 4.0
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-30-2002, 02:09 PM
  4. HOWTO: Create a Project Template
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-28-2002, 01:49 PM
  5. INFO: Recovering a Project File From a Built Application
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-10-2002, 08:44 AM

Posting Permissions

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