Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 7 of 7
  1. #1
    Join Date
    May 2003
    Posts
    83

    file browse dialog causes problems?!?!?!

    Hi Guys,

    I have been spending the last 3 hours trying to get this to work in my project, and couldn’t, so I made a whole new project with the problem in it. The list box on page 2 is automatically populated by some code in the "Preload" Section, which looks for jpg files in a directory "Data", everytime page 2 loads, the first command is to delete all items from the listbox (to avoid adding duplicates everytime the page is accessed again). Now... this works fine if you simply switch between page 2 and page 1 (i.e. click page 2, then from page 2 click the page 1 button, do this many times, it works) BUT AS SOON as you try to browse for a file, by clicking the "File Browse" button on page 2, the whole thing go out the window, select any file, then press ok. Then press the "go to page 1 button" then go back to page 2 by pressing the page 2 button. The listbox is no longer being populated, its blank, all this is caused by just launching the file browse command.

    download from: http://www.gnetcanada.com/problemwithfilebrowse.apz

    Im bewildered, and EXTREMLY frustrated, any help would be good.

    Shawn

  2. #2
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Shawn, the link is broken...

  3. #3
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Will not break . . will not break . . . it broke . . .
    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 2003
    Posts
    83
    hey guys, sorry. wouldnt let me post an apz, so try the zip:

    http://www.gnetcanada.com/filebrowse.zip

    Thanks,

  5. #5
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Shawn,

    In your Page 2's Preload event, you have the following code. The line

    file_table = File.Find("Data", "*.jpg", false, false, nil);

    This is your problem line. It works until you've used the FileBrowse because by default AMS is using it's EXE folder as the working folder. Once you browse, the folder has changed. You need to change the line to this:

    file_table = File.Find(_SourceFolder .. "\\Data", "*.jpg", false, false, nil);

    to ensure that AMS will look in the correct folder. See the code below.


    Code:
    --delete all picture box data
    ListBox.DeleteItem("ListBox_Advertisements", LB_ALLITEMS);
    
    --fill picture box data
    file_table = File.Find(_SourceFolder .. "\\Data", "*.jpg", false, false, nil);
    
    if (file_table == nil or Table.Count(file_table)==0) then
    
    else
    		file_count = Table.Count(file_table);
    		ctr = 1;
    		for i,file in file_table do
    			filetemp = String.SplitPath(file);
    			ListBox.AddItem("ListBox_Advertisements", filetemp.Filename, file);
    		end				
    		listphotoitemnum = ListBox.FindItem("ListBox_Advertisements", LB_ALLITEMS, LB_BYTEXT, "Listing Photo");
    		if (listphotoitemnum~=-1) then --if Listing photo exists in the listbox, select that one, otherwise select item 1
    			ListBox.SelectItem("ListBox_Advertisements", listphotoitemnum);
    			picdata = ListBox.GetItemData("ListBox_Advertisements", listphotoitemnum);
    		else
    			ListBox.SelectItem("ListBox_Advertisements", 1);
    			picdata = ListBox.GetItemData("ListBox_Advertisements", 1);
    		end	
    end

  6. #6
    Join Date
    May 2003
    Posts
    83
    hey worm, THANK You very much.... it is a little rediculous however though, how it works as it is, until you use the file browse dialog.

    but thanks!

  7. #7
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    I have to admit it kind of threw me. I do wonder know if there is an issue with the relative paths. I haven't looked any deeper into it.

Similar Threads

  1. Audio Tracks Project
    By Michael in forum AutoPlay Media Studio 5.0
    Replies: 7
    Last Post: 03-18-2004, 10:58 PM
  2. 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
  3. Path problems in NT when executing file with spaces in path
    By tomarppe in forum Setup Factory 6.0
    Replies: 6
    Last Post: 03-21-2002, 02:01 PM
  4. Can search allow manual browse even if file is found?
    By RichardShaw in forum Setup Factory 5.0
    Replies: 2
    Last Post: 08-28-2000, 06:08 PM
  5. Replies: 0
    Last Post: 08-17-2000, 02:29 PM

Posting Permissions

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