LabWindows/CVI Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
Wolfgang

adjust MultiFileSelectPopupEx to FileSelectPopupEx

Status: New

Hello,

 

the FileSelectPopup(Ex) provides the option to choose 'Select' or 'Load'... buttons with the benefit that the users choice of files can be limited to existing files only.

 

Unfortunately, the new MultiFileSelectPopupEx behaves differently, with the new function the user can always select new file even if it doesn't make sense in a specific context, hence the programmer has to take extra care for this scenario. Also, the response is different for "newfile.c" "existing1.c" "existing2.c" and "existing1.c" "existing2.c" "newfile.c". From a users perpective, however, this doesn't make much sense.

 

I understand that most of these restrictions result from Windows and thus can not be easily changed.

 

But may be it is possible to use a similar idea of different buttons (OK vs. Select) for the multifile popup, too, allowing the programmer to limit the user to select exisiting files only. OK would keep the current behavior, while Select would restrict the choice of files to existing files only.

 

Thanks!

1 Comment
Wolfgang
Trusted Enthusiast

To possibly better explain my issue I am attaching some code showing the 'asymmetry' of the two functions FileSelectPopupEx and MultiFileSelectPopupEx - this asymmetry did not exist with the previous, old-style functions FileSelectPopup and MultiFileSelectPopup:

 

    if ( multiple_source_files )
    {
        selection_status = MultiFileSelectPopupEx ( "", default_file_spec, file_type_list, title_multi, 0, 0, &number_of_files, &file_list );
        if ( selection_status == VAL_EXISTING_FILE_SELECTED )
        {
//

        }

        else if ( selection_status == VAL_NO_FILE_SELECTED )
        {
//

        }
        else if ( selection_status == VAL_NEW_FILE_SELECTED )
        {
            MessagePopup ( "File Selection Error", "Please select existing files only!" );
            for ( index = 0; index < number_of_files; index ++ )
            {     
                MemoryFreeDynamicMemory ( file_list [ index ] );
            }
            MemoryFreeDynamicMemory ( file_list );
        }
        else if ( selection_status < 0 )
        {
            MessagePopup ( "Program Error", GetUILErrorString ( selection_status ) );
        }
    }
    else
    {
        selection_status = FileSelectPopupEx ( "", default_file_spec, file_type_list, title, VAL_SELECT_BUTTON, 0, 0, path_name );
        if ( selection_status == VAL_EXISTING_FILE_SELECTED )
        {
//

        }
        else if ( selection_status == VAL_NO_FILE_SELECTED )
        {
//

        }
        else if ( selection_status < 0 )
        {
            MessagePopup ( "Program Error", GetUILErrorString ( selection_status ) );
        }
    }