List Box help needed (total newbie)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • shepparddon4182
    Forum Member
    • Apr 2006
    • 2

    List Box help needed (total newbie)

    Hello,
    I would like to run multiple quicktime movies from the list box. I used file.open and selected my movie and gave it a trial and it worked first time. After the initial trial I added several more movies and tested it again. Upon opening the second movie all that succeded it opened 1 after the other.

    I had a look at the basic script tutorial but didn't seem to grasp the concept at all scripts and actions are all new to me. If anyone can help with what I should do for the action and script for quicktime movies to open from a listbox, so that only the nominated movie I click on opens and how I should set it up for multiple movies, ie; Global functions or whatever? I might get the idea.

    I used buttons and quick action for the links no problems except I can open another movie while the current movie is still going and I don't what that to happen either. So ideally I want to open quicktime movies one at a time from the listbox and some script or action ? to stop further movies from being opened while a movie is allready running. So if anyone can give me guidelines on how I should go about this It might help a great deal for me to understand what to do.

    Thankyou,

    shepparddon4182
    Last edited by shepparddon4182; 04-15-2006, 09:15 AM.
  • azmanar
    Indigo Rose Customer
    • Oct 2004
    • 1020

    #2
    Shep,

    I felt the same way when I first used AMS. But at some points, I would definitely need to know how it works.

    So I set-up my own reference area. Try out some building blocks there. It is for starters.
    Newbie Examples
    ------> AMS 7.5 : amstudio.azman.info
    ----> AMS 6 & 5: www.azman.info/ams/
    ----> FB: facebook.com/GuideToWealth

    ----> Content Development Blog: www.AZMAN.asia

    Comment

    • shepparddon4182
      Forum Member
      • Apr 2006
      • 2

      #3
      Actions and Scripts

      Thanx Azmanar for the building blocks perhaps I missed something as I didn't see any Actions and Script examples for what I'm trying to do.
      In a List Box (Item text) I have several movies names listed, In (Item Data) I linked the files. I have 5 pages each a seperate categorie.

      So in step by step I need guidance on a sensible approach how to do this !
      Because there is so many movies for e.g Can I use a Global Function to get the movies to open and to stop other movies being opened while 1 is playing. If so what type of actions and scripts would I need to do this. If that is not a sensible or possible way what is.

      I looked through the search and found some info on List Box problems and some examples of what other people did to fix there problems and I employed there examples but none of them worked for me unfortunately. I must be missing some basic stuff so where do I start. == I used file.open action like it suggested and like I said before it worked fine on 1 movie but after I added more it opened them all so do I need boolean or if & and, On Select, On Double Click or WHAT ! to open only the selected movie.

      Can somebody please write a code example for me to try to do this as I noticed one guy was pulling his hair out and it wasn't until RoboBlue put an example code in that his problem was solved and then Worm gave another example that I didn't follow but was evidently a more correct way.

      Hoping for an example or direction on how to do this ...

      Thankyou,
      shepparddon4182

      Comment

      • MrSmith
        Forum Member
        • Mar 2006
        • 10

        #4
        Hello everyone this is my first post here. I think I've missed the boat along with shepparddon4182. I've searched the forum hoping to find a step-by-step guide on Listbox but to no avail. I have redesigned my project three times trying to work around my inexperience. The project I'm working on basically deals with PDF files. What needs to happen is when the equipment test form is selected from the right side listbox it can be printed once the print button has been selected. Also it has to have multiple selections because these people may be operating different pieces of equipment in one day. I will attach a part of this project hoping for guidance. Thank you for any help!
        Attached Files
        Last edited by MrSmith; 04-16-2006, 11:02 AM.

        Comment

        • azmanar
          Indigo Rose Customer
          • Oct 2004
          • 1020

          #5
          It really depends on how 1 want my ListBox populated. I have to decide early. It could be dynamically populated from SQLite, File Folders, Combo Boxes, Input, Text Files and from other ListBoxes as well.

          If I want to populate my ListBox from a selected file folder, I need to create a button to look for folders. Once I selected the folder, it will populate my ListBox. In the OnClick of the button I put such script:
          Code:
          LB = "ListBox1";
          
          --Disable listbox Updating  
          ListBox.SetUpdate(LB, false);
          
          --Set default folder
          folder = Dialog.FolderBrowse("Open Folder", _DesktopFolder);
          --Set Default Extension
          if folder ~= "CANCEL" then
          
          	ListBox.DeleteItem(LB, -1); -- this will clear previous list
          	
          	-- tbSearchFiles = {"*.avi", "*.mpg", "*.dat"}; set your own file filters here
          	-- this one search all types of files
          	tbSearchFiles = {"*.*"};
          
          	for index,type in tbSearchFiles do
                 file = File.Find(folder, type, false, false, nil);
                 
                 	if file ~= nil and file ~="CANCEL" then
          		
                        --do the following for each file:
                        for j,file_path in file do
                               --add the item to the listbox, with the name visible and path as data
                               tbFileParts = String.SplitPath(file_path);
                               sFile = tbFileParts.Filename..tbFileParts.Extension;
                               ListBox.AddItem(LB, sFile, file_path);                                      
                        end
                 	end
          	end
          end
          
          --Allow the listbox to display the updated content
          ListBox.SetUpdate(LB, true);
          As for executing any file selected from a ListBox that I want to open in its default reader, I prefer putting scripts in the OnDouble Click Area of the ListBox.

          Code:
          LB = "ListBox1";
          -- Get the selected items
          tSelected = ListBox.GetSelected(LB);
          
          -- Only for single selection
          
          if tSelected then
          	-- There is an item selected, get the data!
          	sFileToOpen = ListBox.GetItemData(LB, tSelected[1]);
          	File.Open(sFileToOpen, "", SW_SHOWNORMAL);
          else
          	-- Display an error message
          	Dialog.Message("Error", "There is no item selected.");
          end
          The codes are just hacks from my sample called : ListFiles.apz .
          Of course, we just dont populate ListBoxes, we also need to edit, delete, save and etc.

          For dealing with Media Player, you need to download and hack all 3 samples I have.

          I can help only upto this point. Hope it is useful.
          Last edited by azmanar; 04-16-2006, 12:39 PM.
          Newbie Examples
          ------> AMS 7.5 : amstudio.azman.info
          ----> AMS 6 & 5: www.azman.info/ams/
          ----> FB: facebook.com/GuideToWealth

          ----> Content Development Blog: www.AZMAN.asia

          Comment

          • MrSmith
            Forum Member
            • Mar 2006
            • 10

            #6
            Hello again,

            I have a listbox with 14 listbox items. How do I set up the listbox to display a PDF file once it's double clicked on. I can get one PDF file to display but once I double-click on any of the other selections the same PDF file displays. Or both files appear the same time, what am I doing wrong?

            Comment

            • azmanar
              Indigo Rose Customer
              • Oct 2004
              • 1020

              #7
              Alo Mr Smith,

              Go to this sample site and search for
              AMS 6 [ Dynamic List Box ] Examples:
              > Dynamically list Files from chosen Folder into a List Box.

              Download the APZ file.

              Place all your PDF files in 1 folder anywhere. Open it with the sample AMS app. Double click and check the behaviour whether you face the same problems.

              If not, you can checkout the method I used that might be useful for your purpose.
              Newbie Examples
              ------> AMS 7.5 : amstudio.azman.info
              ----> AMS 6 & 5: www.azman.info/ams/
              ----> FB: facebook.com/GuideToWealth

              ----> Content Development Blog: www.AZMAN.asia

              Comment

              • MrSmith
                Forum Member
                • Mar 2006
                • 10

                #8
                azmanar

                Thank you for your examples, just what I needed.

                Comment

                • MrSmith
                  Forum Member
                  • Mar 2006
                  • 10

                  #9
                  Hello again more questions, Lets say I have a listbox with more the twenty PDF selections. How can I select more the one file at once and files I've selected be Highlighted showing I've selected them for printing? Thanks

                  Comment

                  • yosik
                    Indigo Rose Customer
                    • Jun 2002
                    • 1858

                    #10
                    From the help file:

                    Options
                    MultipleSelection
                    Enable multiple listbox items to be selected at one time. Choose from:

                    True
                    Multiple items can be selected in the object at one time.

                    False
                    Only one listbox item can be selected at one time.

                    Hope that helps

                    Yossi

                    Comment

                    • MrSmith
                      Forum Member
                      • Mar 2006
                      • 10

                      #11
                      Yes I've read that topic in the Help file, but No-Go! "True = Multiple items can be selected in the object at one time". That is my current sitting.

                      Comment

                      • Roboblue
                        Forum Member
                        • Dec 2003
                        • 892

                        #12
                        Not knowing how experienced you are in windows operations, I will make a suggestion you may already know.
                        When making multiple selections in the List box, you must either use Ctrl + click to select individual lines, or Shift + click to select several consecutive lines.

                        Comment

                        • mikeln
                          Forum Member
                          • Aug 2006
                          • 27

                          #13
                          My god you guys are pure genius.
                          I dunno where i would be without this place.
                          I like to try and spend 48 hours smashing my head on the keyboard
                          before I come in here.
                          But the people here are real cool and nothing is a problem.
                          azmanar ....i could just kiss you sometimes...( not really, but..):yes

                          Comment

                          • boku
                            Indigo Rose Customer
                            • Mar 2009
                            • 283

                            #14
                            Error post
                            Attached Files
                            Last edited by boku; 08-30-2009, 06:41 AM.
                            - BoKu -

                            Comment

                            Working...
                            X