Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 11 of 11

Thread: ListBox help

  1. #1
    Join Date
    Feb 2009
    Posts
    1,285

    ListBox help

    Hi everyone!
    I' m here for ask help with the ListBox object.
    In a project (Web browser) I've got a listbox object with some items wich are indexed by the following code:
    Code:
    
    ListBox.DeleteItem("ListBox1", -1);  --Clear list
    
    folder = Registry.GetValue(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Favorites", true);  --Get the path for the user Favorites folder
    file = File.Find(folder, "*.url", false, false, nil);  --Search for .URL files
    
    for j,file_path in file do
        ListBox.AddItem("ListBox1", String.SplitPath(file_path).Filename, file_path);  --Add the files to the ListBox object
    end
    Then, when I double click a item in the list, I need to give the complete path for the selected item, to use it with "INIFile.GetValue" and "Web.LoadURL" actions.
    The problem is here: I've tried to use
    Code:
    
    Selected = ListBox.GetSelected("ListBox1");
    Seldata = ListBox.GetItemData("ListBox1", Selceted);
    Link = INIFile.GetValue(Seldata, "InternetShortcut", "URL");
    Web.LoadURL("Web1", Link);
    but it doesn't work.

    Can anyone help me, please? Thankyou.

  2. #2
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Code:
    Selected = ListBox.GetSelected("ListBox1");
    Seldata = ListBox.GetItemData("ListBox1", Selected[1]);
    Link = INIFile.GetValue(Seldata, "InternetShortcut", "URL");
    Web.LoadURL("Web1", Link);
    Dermot

    I am so out of here

  3. #3
    Join Date
    Feb 2009
    Posts
    1,285
    Tankyou very very much!!! it works!

    But, i've got another question:
    How could I make a progressbar (progressbar plugin) that indicates the loading progress?

    Thankyou

  4. #4
    Join Date
    Mar 2007
    Posts
    172

    Grin

    why this code only loads 1 favorite to tree object ???

    Code:
    folder = Registry.GetValue(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Favorites", true);  --Get the path for the user Favorites folder
    file = File.Find(folder, "*.url", false, false, nil);  --Search for .URL files
    
    for j, file_path in file do
    			FavCount = Tree.GetChildCount("Tree1", "0");
    			FavNodeData = {};
    			FavNodeData.Text = String.SplitPath(file_path).Filename;
    			FavNodeData.Data = file;
    			FavNodeData.Expanded = true;
    			FavNodeData.NodeIndex = FavCount+1;
    			FavNodeData.ImageIndex = 8;
    			FavNodeData.SelectedImageIndex = 8;
    			Tree.InsertNode("Tree1", (FavCount), FavNodeData);
    end

  5. #5
    Join Date
    Oct 2007
    Location
    Gensokyo
    Posts
    1,324
    Quote Originally Posted by ButtonMaker View Post
    why this code only loads 1 favorite to tree object ???

    Code:
    folder = Registry.GetValue(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Favorites", true);  --Get the path for the user Favorites folder
    file = File.Find(folder, "*.url", false, false, nil);  --Search for .URL files
    
    for j, file_path in file do
    			FavCount = Tree.GetChildCount("Tree1", "0");
    			FavNodeData = {};
    			FavNodeData.Text = String.SplitPath(file_path).Filename;
    			FavNodeData.Data = file;
    			FavNodeData.Expanded = true;
    			FavNodeData.NodeIndex = FavCount+1;
    			FavNodeData.ImageIndex = 8;
    			FavNodeData.SelectedImageIndex = 8;
    			Tree.InsertNode("Tree1", (FavCount), FavNodeData);
    end
    Can't you ask this question in your own thread?

  6. #6
    Join Date
    Mar 2007
    Posts
    172

    Star

    Quote Originally Posted by ShadowUK View Post
    Can't you ask this question in your own thread?
    no because it was about favorites and also cant u answer it instead of complaning about it... i dont understand why people like u spend thier time about complaning !!!

  7. #7
    Join Date
    Oct 2007
    Location
    Gensokyo
    Posts
    1,324
    Quote Originally Posted by ButtonMaker View Post
    no because it was about favorites and also cant u answer it instead of complaning about it... i dont understand why people like u spend thier time about complaning !!!
    It may be relevant but you're asking about the Tree in a ListBox thread.

    Anyway, it's probably because of this

    Code:
    FavCount = Tree.GetChildCount("Tree1", "0");
    try changing it to

    Code:
    FavCount = Tree.GetChildCount("Tree1", "0") + 1;
    [/complain]

  8. #8
    Join Date
    Mar 2007
    Posts
    172
    thanks ShadowUK

    another small question;

    why this code doesnt load the node to web object ???
    Code:
    local infodelarbol = Tree.GetNode("Tree1", e_NodeIndex);
    if infodelarbol then
    Web.LoadURL("Web1",infodelarbol.Data);
    end

  9. #9
    Join Date
    Aug 2004
    Location
    Somewhere in Texas, USA
    Posts
    417

    Poor T3STY

    Looks like T3STY got his thread highjacked and he ain't gettin' it back.

    Shame on you Button...

  10. #10
    Join Date
    Mar 2007
    Posts
    172
    Quote Originally Posted by mwreyf1 View Post
    Looks like T3STY got his thread highjacked and he ain't gettin' it back.

    Shame on you Button...
    no, actually i am keeping it fresh for him

  11. #11
    Join Date
    Feb 2009
    Posts
    1,285
    Quote Originally Posted by T3STY View Post
    Tankyou very very much!!! it works!

    But, i've got another question:
    How could I make a progressbar (progressbar plugin) that indicates the loading progress?

    Thankyou
    No one knows help me?

  12. #12
    Join Date
    Aug 2004
    Location
    Somewhere in Texas, USA
    Posts
    417
    Maybe you could use an animated flash oject until the browser is up.

    Not sure why you would need (other than because) a progress bar for a few second wait.

    Anyway...

  13. #13
    Join Date
    Feb 2009
    Posts
    1,285
    Remember that the web object uses Internet Exporer's engine and anyone knows that IE isn't so faster.
    Anyway, the flash animation sounds good.
    Thnakyou for help.

    Bye!

Similar Threads

  1. ListBox indexing explained
    By Adam in forum AutoPlay Media Studio 7.5 FAQ
    Replies: 0
    Last Post: 11-01-2007, 01:58 PM
  2. Listbox disappearing question
    By ebrusher in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 07-09-2005, 06:38 AM
  3. 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
  4. Listbox... how to? part 2
    By cold_fusion in forum AutoPlay Media Studio 4.0
    Replies: 7
    Last Post: 02-07-2004, 12:28 PM
  5. From listbox to listbox to flash
    By Konradsen in forum AutoPlay Media Studio 4.0
    Replies: 5
    Last Post: 05-13-2003, 06:24 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