Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2008
    Location
    Wisconsin
    Posts
    3

    Select a File Screen

    I need a screen that allows the users to select a file, exactly like the "Select Install Folder" screen only showing a file browse. I can't find anything in the stock screens. Any ideas?

  2. #2
    Join Date
    Jan 2008
    Location
    Wisconsin
    Posts
    3
    Okay, so I realized I could create a new global function using most of the g_EditFieldFolderBrowse function as such:

    --[[
    ************************************************** ********************************
    Function: g_EditFieldFileBrowse
    Purpose: Browses for a file and fills an edit field with the path. It uses
    the edit field's text as the initial folder in the folder browse dialog.
    Arguments: (number) nIDEditField - The ID of the edit field
    (string) strPrompt - The prompt for the folder browse dialog
    Returns: Nothing.
    ************************************************** ********************************
    --]]
    function g_EditFieldFileBrowse(nIDEditField, strPrompt)

    -- get the current properties of the edit field
    local tbEditProps = DlgEditField.GetProperties(nIDEditField);
    if(not tbEditProps) then
    -- The edit field is not accessible or does not exist
    return;
    end

    -- display a folder browse dialog, using the current contents of the edit
    -- field as the initial folder path (the folder to start browsing from)
    local strInitialFolder = tbEditProps.Text;
    local strTargetFile = Dialog.FileBrowse(true, strPrompt, strInitialFolder, "All Files (*.*)|*.*|", "", false, true);
    if((strTargetFile == "") or (strTargetFile == "CANCEL")) then
    return;
    end

    -- replace the contents of the edit field with the folder path that was selected
    tbEditProps.Text = strTargetFile;
    DlgEditField.SetProperties(nIDEditField, tbEditProps);
    end

  3. #3
    Join Date
    Jan 2008
    Location
    Wisconsin
    Posts
    3
    A few corrections due to FileBrowse returning a table instead of a string and a missing parameter:

    --[[
    ************************************************** ********************************
    Function: g_EditFieldFileBrowse
    Purpose: Browses for a file and fills an edit field with the path. It uses
    the edit field's text as the initial folder in the folder browse dialog.
    Arguments: (number) nIDEditField - The ID of the edit field
    (string) strPrompt - The prompt for the folder browse dialog
    Returns: Nothing.
    ************************************************** ********************************
    --]]
    function g_EditFieldFileBrowse(nIDEditField, strPrompt, strFileFilters)

    -- get the current properties of the edit field
    local tbEditProps = DlgEditField.GetProperties(nIDEditField);
    if(not tbEditProps) then
    -- The edit field is not accessible or does not exist
    return;
    end

    -- display a folder browse dialog, using the current contents of the edit
    -- field as the initial folder path (the folder to start browsing from)
    local strInitialFolder = tbEditProps.Text;
    local strTarget = {};
    local strTarget = Dialog.FileBrowse(true, strPrompt, strInitialFolder, strFileFilters, "", "", false, true);
    local strTargetFile = strTarget[1];
    if((strTargetFile == "") or (strTargetFile == "CANCEL")) then
    return;
    end

    -- replace the contents of the edit field with the folder path that was selected
    tbEditProps.Text = strTargetFile;
    DlgEditField.SetProperties(nIDEditField, tbEditProps);
    end

Similar Threads

  1. Display File Description in the "While Installing" progress bar screen
    By jassing in forum Setup Factory 8.0 Examples
    Replies: 0
    Last Post: 11-15-2008, 09:30 AM
  2. screen rez file
    By jordo2798 in forum AutoPlay Media Studio 4.0
    Replies: 9
    Last Post: 04-12-2003, 10:07 AM
  3. HOWTO: "Hide" Externally Referenced Files
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-23-2002, 03:19 PM
  4. Bug in single file properties screen?
    By Tim Tester in forum Setup Factory 6.0
    Replies: 0
    Last Post: 05-01-2002, 12:02 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