Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 8 of 8

Thread: Combobox menu

  1. #1
    Join Date
    May 2005
    Location
    Sweden
    Posts
    21

    Combobox menu

    Hi I am just playing around with autoplay and trying to learn how it works.
    If anyone has the time to answer my question I would appreciate it and maybe I learn something.

    I want to make a combobox dropdown menu.
    I want it to take all my pages add them to the menu and page.jump to selected page

    Sorry if im writing kind of short but my English is not the best.

    Thanks
    Rikard

  2. #2
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    You can use the following actions:

    -- read page names into table
    all_pages = Application.GetPages();

    -- count number of pages
    ttl_pages = Table.Count(all_pages);

    --Populate your Combo Box (starting from page 2 as page1 is where your combo box is located)
    ComboBox.SetUpdate("yourCombo", false);
    for i = 2, ttl_pages do
    ComboBox.AddItem ("yourCombo", all_pages[i],"");
    end
    ComboBox.SetUpdate("yourCombo", true);

    Good luck

    Yossi

  3. #3
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    I have done this as well. If you don't want your page to be visible in the combobox you can add this

    -- read page names into table
    all_pages = Application.GetPages();

    -- count number of pages
    ttl_pages = Table.Count(all_pages);

    --Populate your Combo Box (starting from page 2 as page1 is where your combo box is located)
    ComboBox.SetUpdate("yourCombo", false);
    for i = 1, ttl_pages do
    if all_pages[i] ~= Application.GetCurrentPage() then
    ComboBox.AddItem ("yourCombo", all_pages[i],"");
    end
    end
    ComboBox.SetUpdate("yourCombo", true);
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  4. #4
    Join Date
    May 2005
    Location
    Sweden
    Posts
    21
    Thanks for the answer.
    TJ_Tiger you are refering to the number in the combobox of the file thats not gona show.
    Lets say im adding alot of files so that number wont be corect.
    e.g. i have 2 files that i dont want to show "file1 and "file2" is it posible to putt in the names instead in the code or maby even better putt some code on the page that i dont want to show so it wont show up in the list

  5. #5
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Quote Originally Posted by Rikard
    Thanks for the answer.
    TJ_Tiger you are refering to the number in the combobox of the file thats not gona show.
    Lets say im adding alot of files so that number wont be corect.
    e.g. i have 2 files that i dont want to show "file1 and "file2" is it posible to putt in the names instead in the code or maby even better putt some code on the page that i dont want to show so it wont show up in the list

    Certainly,

    All you need to do is add some if this or that statements or use a table containing all the page names you don't want to display. Yoss's code is great for dynamically filling the ComboBox, that way if you add more pages they will be added to the list automatically. No additional coding required from you. If you have pages you don't want to be displayed you can do this:

    -- read page names into table
    all_pages = Application.GetPages();

    -- count number of pages
    ttl_pages = Table.Count(all_pages);

    -- reset the comboBox content
    ComboBox.ResetContent("yourCombo");

    --Populate your Combo Box (starting from page 2 as page1 is where your combo box is located)
    ComboBox.SetUpdate("yourCombo", false);
    for i = 1, ttl_pages do
    --list of pages not to show. As long as the name is not equal to one of
    -- these pages will not be displayed.
    if all_pages[i] ~= "EasterEgg" or all_pages[i] ~= "Secret" or all_pages[i] ~= "Admin" then
    ComboBox.AddItem ("yourCombo", all_pages[i],"");
    end
    end
    ComboBox.SetUpdate("yourCombo", true);
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  6. #6
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Another option I have used recently is to have a string containing a list of names not to be displayed and then using String.Find to search the string and if it is not found then add the list.

    -- read page names into table
    all_pages = Application.GetPages();

    -- count number of pages
    ttl_pages = Table.Count(all_pages);

    -- reset the comboBox content
    ComboBox.ResetContent("yourCombo");

    --Populate your Combo Box (starting from page 2 as page1 is where your combo box is located)
    ComboBox.SetUpdate("yourCombo", false);

    --Define string of pages not to find
    strSearchMe = "Admin, Secret, EasterEgg, Yadayadayada, George, Kramer";

    for i = 1, ttl_pages do
    --list of pages not to show. As long as the name is not found (-1) in the string
    -- these pages will not be displayed.
    if String.Find(strSearchMe, all_Pages[i], 1, false) == -1 then
    ComboBox.AddItem ("yourCombo", all_pages[i],"");
    end
    end
    ComboBox.SetUpdate("yourCombo", true);
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  7. #7
    Join Date
    May 2005
    Location
    Sweden
    Posts
    21
    Thanks for the replies I will play with it for a while now.

    I’m amazed every time I take a look in this forum an sees all the fast and explaining replies.
    I think I will start an AMS religion

  8. #8
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    Yes, you're right TJ. A correct addendum. Thanks
    Yossi

Similar Threads

  1. ComboBox Plugin not in Insert Menu
    By ChatNoir in forum AutoPlay Media Studio 5.0
    Replies: 5
    Last Post: 03-21-2005, 09:04 AM
  2. TUTORIAL: Showing and Hiding Objects in AutoPlay Menu Studio 3.0
    By Support in forum AutoPlay Menu Studio 3.0
    Replies: 0
    Last Post: 10-10-2002, 02:39 PM
  3. FAQ: AutoPlay Menu Studio 3.0 Frequently Asked Questions
    By Support in forum AutoPlay Menu Studio 3.0
    Replies: 0
    Last Post: 10-10-2002, 01:15 PM
  4. Have a file execute then go to the menu upon startup...?
    By Dog in forum AutoPlay Menu Studio 3.0
    Replies: 2
    Last Post: 05-10-2000, 02:56 PM
  5. Press Release: AutoPlay Menu Studio 2.0
    By Ted in forum Announcements & News
    Replies: 0
    Last Post: 01-31-2000, 10:10 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