> Under OSX, the 'simple-app' program can't open up the file browser with the preset_file() selected in the browser. WHY?? It selects the dir ok, but not the file. > Christophe points out differences with FLTK's API: * type enums are different (Fl_File_Chooser::MULTI vs. Fl_Native_File_Chooser::BROWSE_MULTI_FILE) SOLUTION: mark old names legacy, implement FLTK's names as alternate, modify docs. * show() works differently (Native's show() blocks) SOLUTION: Meh, not sure there is one, native choosers have to block. * filters have slightly different syntax ("type (*.ext)\t" vs. "type\t*.ext\n") SOLUTION: Might be as simple as just ignoring parens around filter when specified. Document FLTK's syntax, and indicate old syntax is legacy. * filename() is indexed from 0 instead of 1 * filename() should be changed to value() SOLUTION: Kill above two birds with one stone: Mark filename() as obsolete/legacy in docs, keep method code. Implement value(int) and friends to replace filename(), making sure value(int) is 1 based. Make docs and for() loop example 1 based. > Christophe points out that adding but->shortcut(FL_META+'o'); to simple-app.cxx causes FLTK/MAC to theink the meta key is still down after invoking the short cut, then cancelling out of the chooser. (Just hitting 'o' after the chooser closes will re-open the browser) Probably the native chooser for MAC/Leopard is eating the keyup events. Had christophe repost question to fltk.general on 01/07/08. CHECK HISTORY TO SEE IF THIS WAS SOLVED. > Add an option to control enable/disable of 'New Folder' button on Mac. See: _keepstate = kNavDontNewFolderState; ..in the file Fl_Native_File_Chooser_MAC.cxx. Maybe change that to: if ( ! ( _options & NEW_FOLDER ) ) { _keepstate |= kNavDontNewFolderState; } > Determine why WIN32 and OSX don't open browser with preset file selected. 09/04/2009 MAC: It is years later, and I still can't figure this out. Several sources on the net say the pathname can only be a directory, not a filename for preselect to work. XX/XX/XXXX WIN: tried to make this work, but it just doesn't support it! Even calling GetOpenFileName(&_ofn); twice in a row. ### NOT SURE ### ### NOT SURE ### ### NOT SURE ### ### NOT SURE ### ### NOT SURE ### ### NOT SURE ### (?) > 0.83d: WINDOWS/FILE BROWSE: (?) If simple-app's preset filename doesn't end in a backslash, (?) browser shows contents of parent dir, not dir itself. (?) Maybe append a slash if stat() shows preset filename is a DIR? -- 0.82c -- (?) > 0.82c: Windows "Save As" is not setting correct directory in browser (?) > 0.82: Andreas reports problem with Mac chooser not showing thumbnails (?) that live on remote drives even though the Finder does. (?) Files located on the local file system show up OK. (?) (See Reference #1 below for Apple's SimpleText.c excerpts?) (?) Also, see Andreas' email 12/05/2005 (Reference #2 below) (?) > 0.82: Presetting value() under linux causes chooser to open with file (?) highlighted in the chooser, but not in windows or mac. (?) > 0.82: Fl_Native_File_Chooser: WINDOWS doesn't handle returning UTF8 from (?) native windows file chooser.. comes back as garbage, possibly as non-UTF8? (?) (Found problem on Japanese localized machine by browsing to a dir (?) with Japanese chars. Shows OK in windows browser, but when returned (?) to Fl_Input, comes up as garbage, even though the Fl_Input is capable (?) of showing text correctly if japanese text pasted as text into the (?) Fl_Input from Windows URL input) #### DONE #### #### DONE #### #### DONE #### #### DONE #### #### DONE #### #### DONE #### > 0.84: Ian MacArthur indicated mingw warns about strapp and strdump being "defined but not used" cause it's a static. Should probably make a lib, disable this warning, or reference the calls in an unused subroutine. > 0.83d: Namespace pollution: Yuri wants Carbon.h/win32.h to not be in the public .H files. Can probably make an 'underbar' version of the class to isolate them. See erco's post on fltk.general 06/24/07. > 0.83d: MAC / Save File: If: 1) /tmp/foo.xxx exists 2) Directory: set to /tmp 3) Preset File set to foo.xxx ..when browser opens, foo.xxx is GRAYED OUT, even though filter appears to be on. Can still click on grayed out items to pick them, and Save As: name changes. Weird! Looks OK when 'Single File' is selected. *** DONE *** (DONE) > 0.82c: "Save As" + "Show Confirm Dialog" is not showing the confirm dialog..! (DONE) TESTED ON LINUX AND OSX TO WORK OK. (DONE) > 0.83c: Shane Hill on 02/07/06 reports that under Windows, doing regular (DONE) file browsing results in the current working dir being changed. (DONE) Luckily there appears to be a WIN32 flag for this, but the docs (DONE) say it's ineffective..!? (DONE) OFN_NOCHANGEDIR (DONE) Restores the current directory to its original value if the user changed (DONE) the directory while searching for files. (DONE) Windows NT 4.0/2000/XP: This flag is ineffective for GetOpenFileName. (DONE) ^^^^^^^^^^^^^^^^^^^^^^^^ (DONE) > 0.82: Alessandro: uses very long wildcard strings.. (DONE) Replace fixed arrays (char wildcard[80]) with new strapp() stuff. ------------------------------------------------------------------------ Reference #1 ------------------------------------------------------------------------ // REFERENCE FROM SimpleText.c for erco.. short numTypes; OSType typeList[20]; OSType fileType = '\?\?\?\?'; NavDialogRef navDialog; DetermineWindowTypeOrOpen( nil, fileType, &typeList[0], &numTypes, nil ); // Open as many documents as the user wishes through Appleevents return OpenFileDialog( 'ttxt', numTypes, typeList, &navDialog ); OSType typeList[20]; OSType docList[20]; pFileTypes[*numTypes] = 'MooV'; pDocumentTypes[*numTypes] = kMovieWindow; (*numTypes)++; OSStatus OpenFileDialog( OSType applicationSignature, short numTypes, OSType typeList[], NavDialogRef *outDialog ) { OSStatus theErr = noErr; if ( gOpenFileDialog == NULL ) { NavDialogCreationOptions dialogOptions; NavTypeListHandle openList = NULL; NavGetDefaultDialogCreationOptions( &dialogOptions ); dialogOptions.modality = kWindowModalityNone; dialogOptions.clientName = CFStringCreateWithPascalString( NULL, LMGetCurApName(), GetApplicationTextEncoding()); openList = (NavTypeListHandle)NewOpenHandle( applicationSignature, numTypes, typeList ); theErr = NavCreateGetFileDialog( &dialogOptions, openList, GetPrivateEventUPP(), NULL, NULL, NULL, &gOpenFileDialog ); ------------------------------------------------------------------------ Reference #2 ------------------------------------------------------------------------ Andreas Schömann wrote: > Greg Ercolano wrote: > >> Andreas Schömann wrote: >> >>> I've found a problem: when loading images (jpg) via network, no thumbnail is shown in the file chooser. Actual loading works. The network device is NTFS formatted. I thought it might be an access rights problem, but with 'Finder' it works fine... BTW, Andreas is specifically referring to the MAC file browser; when you have it in 'column' mode, when you highlight eg. a jpg image, the preview that normally displays off to the right doesn't show up. I looked at the SimpleText.c code that comes with the OSX developer toolkit, ie: /Developer//Examples/Carbon/SimpleText/* ..and it looks like they use a few options to NavCreateGetFileDialog() that I don't use, namely arg2 and arg3 to set a list of files and a callback. I have to admit I don't fully understand the Mac stuff when it comes to this sort of thing. Apparently there's a global database somewhere of 4 character file types that dates back to the 1980's, and it appears one needs to know these names and hard code them into your app (as is done in SimpleText.cxx). I think I'll leave this unfinished, since it's not really a show stopper, and I'm not sure how to make it work correctly. > 4) Here on my machine Fl_Native_File_Chooser displays a preview for _local_ images (e.g. .jpeg, .tiff and .png) Really? I actually couldn't get that to work on my 10.4.3 box. When I single click on a jpeg, png, or other image format, it shows a generic image, but the correct text info about the image's file type. What does work is if I click on .c or .cxx files it shows correctly, and if I click on a .rm file (Real Media), it shows Real's icon logo.. (shrug) In the Finder, when you click on images, it shows a thumbnail of the actual image. > Hmmmh, somewhat confusing results... > Especially the different behaviour of Finder and File Chooser is a mystery to me. Why did Apple do that? Maybe this has changed with Tiger? > 1) and 2) tell me that one can disable file preview with 'Navigation Services', though probably not by intention. It might be I'm missing some args to NavCreateGetFileDialog() (arg2 and 3?) Unfortunately I'm not sure what is the correct code to make that work, if that's even the cause. Or maybe I need to link in some apple framework that's missing to make that stuff work. > I also had a look into the documentation ( http://developer.apple.com/documentation/Carbon/Conceptual/ProvidingNavigationDialogs/index.html ) and it says that 'Navigation Services' offers to specify a 'preview callback' with 'NavCreateGetFileDialog'. This is called when the user selects a file and offers a way to preview custom file types. But Fl_Native_File_Chooser does not use this feature and in that case 'Navigation Services' inspects the file. Right, as described above. However, I'd think there'd be defaults for things like jpeg/png/etc. I'd hate to think I have to manually provide callbacks for each image type..! ------------------------------------------------------------------------ Reference #3 ------------------------------------------------------------------------ -- 0.86 -- > (DONE -- 0.86) ADDITIONS REQUESTED BY MANOLO OCT 08 2008 Hi Greg, I have been using your Fl_Native_File_Chooser with general satisfaction but had to make 3 changes in Fl_Native_File_Chooser_MAC.cxx for it to suit my needs, and would like to present them to you. 1) using a BROWSE_SAVE_FILE displays the list of file formats as set by the filter member function plus a "Default" format that I wanted to get rid of. The solution to that is to put kNavGenericSignature as 3rg argument of the NavCreatePutFileDialog call in your <-- (DONE 0.86) post() function. Because the initially selected file format can be controlled by the filter_value member function, I don't see what can be the purpose of having a Default format in addition to a programmable set of formats. Furthermore, presence of the Default format renders the call to filter_value ignored by the navigation dialog window. Thus, I would think that using this kNavGenericSignature argument would benefit Fl_Native_Fie_Chooser_MAC without loss of functionality. Alternatively, an accessor function to the 3rd argument of the NavCreatePutFileDialog call would be helpful. 2) using a BROWSE_SAVE_FILE, with a call to the preset_file member function, often fails to correctly display the desired preset filename in the navigation dialog. This happens in your event_handler function, case kNavCBStart, that attempts to get the FSSpec of the preset file and fails because this file does not exist yet. I thus changed the 1st statement of the kNavCBStart clause as follows: if ( nfb->directory() /* || nfb->preset_file() */) { <-- (DONE 0.86) 3) the preset_file member function does not work correctly with non-ascii containing filenames. This is easily repaired, without side effect, using kCFStringEncodingUTF8 instead of <-- (DONE 0.86) kCFStringEncodingASCII in the statement just before the NavDialogSetSaveFileName call. I take this opportunity to mention to you my XCode plug-in that fully drives a Win32 C/C++ cross-compiler within Apple's Xcode development environment: http://pbil.univ-lyon1.fr/members/mgouy/XCodeWin32Plugin/ Many thanks for your Fl_Native_Fie_Chooser, and best wishes, > (DONE -- 0.86) Walter Garms points out mapped network shares (eg. Z:) don't show up in 'BROWSE_DIRECTORY' mode unless the code is modified. See emails dated 05/12/2008: --- Garms, Walter (GE EntSol, Security) wrote: With your help I was able to solve the problem of the network drives. For Version 6.0, at least, the BIF_SHAREABLE flag seems to have the opposite sense: With BIF_SHAREABLE not set I see the mapped network drives, and with BIF_SHAREABLE set I do not. --- ie. he removed BIF_SHAREABLE from this section: #if defined(BIF_NONEWFOLDERBUTTON) // Version 6.0 if ( _btype == BROWSE_DIRECTORY ) _binf.ulFlags |= BIF_NONEWFOLDERBUTTON; _binf.ulFlags |= BIF_USENEWUI | BIF_SHAREABLE | BIF_RETURNONLYFSDIRS; ^^^^^^^^^^^^^ #elif defined(BIF_USENEWUI)