Listbox menus???

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • seano
    Indigo Rose Customer
    • Jul 2005
    • 21

    Listbox menus???

    Hi all,

    Let me begin by saying that I am very new to this and am slowly getting to grips with AMS!

    My question is:-

    I want to build a multiple listbox menu that when the user clicks on the "Product" button they get a list box display!

    Then they move down to the item they need and when they "hover" above that item another list box appears next to the first!

    Then they do the same with the 2nd listbox and move down to the item and again when they hover above that item another list box appears next to it!

    They then click on the last item they require and it jumps to another page with all the details of that product!

    Also, if at any time they move their cursor out of any of the list boxes, they dissapear!

    The easiest way to give an example is similar to all of your menu buttons at the top of internet explorer!!! Eg. File - new - window!!!!!

    Thats what I need to do!

    If anybody could help I would be most grateful.

    Regards


    Sean
  • -dakis-
    Forum Member
    • Mar 2005
    • 13

    #2
    You can not do it with ListBox object, because ListBox object does not recognize "hovering", in other words it does not have an "On Enter" trigger... You can perform actions only when user clicks on an item in the ListBox...

    When I was making something like the menu of a program (file, edit, help), I was doing it only with homemade buttons...

    Comment

    • -dakis-
      Forum Member
      • Mar 2005
      • 13

      #3
      It is not suitable for any kind of dynamic data, but for the menu it can do...

      Here, take a look:
      Attached Files

      Comment

      • seano
        Indigo Rose Customer
        • Jul 2005
        • 21

        #4
        Hi guys,

        Can I link multiple list boxes to the first? So when I click on an item in the first it then opens a second list box, then the same again and then open the corresponding page?

        OR

        How would you sugest the best way to achieve what I need to do??

        Cheers

        Sean

        Comment

        • Corey
          Indigo Rose Staff Alumni
          • Aug 2002
          • 9741

          #5
          Hi. Here's a simple working example attached you can check out if you like. It should get you started anyhow.
          Attached Files

          Comment

          • seano
            Indigo Rose Customer
            • Jul 2005
            • 21

            #6
            Hi all,

            I've posted a sample of my project here for you guys to check out!

            I need help!!! My head is exploding at the moment trying to get around this!!

            No doubt you should be able to see the problem I'm having.

            Firstly, everything is fine for the first item in listbox1! Except when you come to Listbox3 and jump page! It keeps going to page 1????? Even though I've told it to jump to page 2 for item 2 and page 3 for item 3!

            Next problem, how do I then program the other items in Listbox1 to then follow through with their relevent items to appear in Listbox2 and 3?

            Any help would be much apreciated.

            Thanks

            Sean :o
            Attached Files

            Comment

            • JimS
              Indigo Rose Customer
              • May 2003
              • 1054

              #7
              Your problem seems to be the first two lines of code in the On Select event of ListBox3

              Get rid of the first line of code, and change the second to look at ListBox3 instead of ListBox2

              result = ListBox.GetSelected("ListBox3");




              .

              Comment

              • seano
                Indigo Rose Customer
                • Jul 2005
                • 21

                #8
                Thanks, that's sorted the first problem out!

                What about my second problem? How do I program it for the other items?

                Any clues?

                Thanks

                Sean

                Comment

                • Worm
                  Indigo Rose Customer
                  • Jul 2002
                  • 3967

                  #9
                  This is a little late, but have you looked into the PopupMenu plugin offered at Icy North (http://www.icynorth.com/popupmenuplugin/index.html)

                  Comment

                  • JimS
                    Indigo Rose Customer
                    • May 2003
                    • 1054

                    #10
                    Worm is right, PopupMenu is a great plugin.

                    If you decide to keep with the ListBoxes, I would consider creating a number if text files, to hold the proper contents of the ListBoxes, rather than trying to code everything.

                    For instance, I would have a text file called Iveco Ford.txt
                    It’s contents would be:

                    Daily 2000
                    New Cargo
                    Eurotech
                    Eurostar

                    Then when a person clicked on Iveco Ford in the first listbox, it would load the textfile of the same name, into the next listbox.

                    When someone then clicked on Daily 2000, it would load the Daily 200.txt file to fill the third listbox, etc.

                    It also seems to me that this approach would make it easier for you to make product changes.

                    That’s my thoughts anyway.


                    .

                    Comment

                    • ami
                      Forum Member
                      • May 2005
                      • 6

                      #11
                      Need help in scripting with listbox

                      Hi all, i'm also still a very new with this autoplay
                      I need some help in scripting with listbox. I want to make some item with listbox and the number for this item is more than 50. How to make the script for this listbox if i don't want to use this script like in the example.
                      This is the script of listbox in the example :
                      if result[1]==1 then
                      ListBox.AddItem("ListBox2", "Carrots", "");
                      ListBox.AddItem("ListBox2", "Onions", "");
                      ListBox.AddItem("ListBox2", "Peas", "");
                      Image.Load("Image2", "AutoPlay\\Images\\1.jpg");
                      elseif result[1]==2 then
                      ListBox.AddItem("ListBox2", "Apples", "");
                      ListBox.AddItem("ListBox2", "Oranges", "");
                      ListBox.AddItem("ListBox2", "Grapes", "");
                      Image.Load("Image2", "AutoPlay\\Images\\2.jpg");
                      end

                      I don't want to use this script because scripting like this with item more than 50 is too long. I need some help to making listbox with item more than 50, but not use the script like in the example. I need a simple script to make a listbox with item more than 50. Thanks
                      Attached Files

                      Comment

                      • TJ_Tigger
                        Indigo Rose Customer
                        • Sep 2002
                        • 3159

                        #12
                        You could store the items you want to be in your listbox in a text file or INI file (for AMS5 Pro) and then read in that file and automatically populate the list box.

                        vegetable.txt has the following entries
                        Carrots
                        Onions
                        Peas

                        fruti.txt has the following entries
                        Apples
                        Oranges
                        Grapes

                        if result[1]==1 then
                        table = TextFile.ReadToTable("vegetables.txt")
                        for i,v in table do
                        ListBox.AddItem("ListBox2", v, "");
                        end
                        Image.Load("Image2", "AutoPlay\\Images\\1.jpg");
                        elseif result[1]==2 then
                        table = TextFile.ReadToTable("fruit.txt")
                        for i,v in table do
                        ListBox.AddItem("ListBox2", v, "");
                        end
                        Image.Load("Image2", "AutoPlay\\Images\\2.jpg");
                        end

                        Tigg
                        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

                        Comment

                        • ami
                          Forum Member
                          • May 2005
                          • 6

                          #13
                          I mean the item in the first listbox. If i want to make item with more than 50 use listbox. I am use this script
                          Example
                          if result[1]==1 then
                          --action or condition
                          elseif result[1]==2 then
                          --action or condition
                          elseif result[1]==3 then
                          --action or condition
                          elseif result[1]==4 then
                          --action or condition
                          elseif result[1]==5 then
                          until 50
                          end
                          I want to ask, there is another script for sripting this listbox? If i use script like example, i will doing it until 50 times and it waste a time and my scripting become not efficient.

                          Comment

                          • TJ_Tigger
                            Indigo Rose Customer
                            • Sep 2002
                            • 3159

                            #14
                            Yes there are ways to make it more efficient. Each item in a list box has two fields, the Text field and the Data field. You could store information in the Data field that you want to act upon.

                            you could do somthing like this

                            result = ListBox.GetSelected("ListBox3");
                            if result then
                            strLBData = ListBox.GetItemData("ListBox3", result[1]);
                            if strLBData then
                            -- perform some action on what was stored in data
                            -- it could point to a text file and you could then open the file
                            -- or a function and you could then execute the function
                            end


                            It is hard to come up with ideas on how to make something more efficient without knowing what it is you are fully trying to do. I understand that you do not want to type 50 elseif statements but more details may help in providing a better solution than just guessing.

                            I hope the above helps.

                            Tigg
                            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

                            Comment

                            Working...
                            X