| 1 |
> Determine why Mac and OSX don't open browser with preset file selected. |
| 2 |
WINDOWS: tried to make this work, but it just doesn't support it! |
| 3 |
Even calling GetOpenFileName(&_ofn); twice in a row. |
| 4 |
|
| 5 |
> 0.84: Ian MacArthur indicated mingw warns about strapp and strdump |
| 6 |
being "defined but not used" cause it's a static. Should |
| 7 |
probably make a lib, disable this warning, or reference |
| 8 |
the calls in an unused subroutine. |
| 9 |
|
| 10 |
> 0.83d: Namespace pollution: Yuri wants Carbon.h/win32.h |
| 11 |
to not be in the public .H files. Can probably make an 'underbar' |
| 12 |
version of the class to isolate them. See erco's post on |
| 13 |
fltk.general 06/24/07. |
| 14 |
|
| 15 |
> 0.83d: MAC / Save File: |
| 16 |
If: |
| 17 |
1) /tmp/foo.xxx exists |
| 18 |
2) Directory: set to /tmp |
| 19 |
3) Preset File set to foo.xxx |
| 20 |
..when browser opens, foo.xxx is GRAYED OUT, even though filter |
| 21 |
appears to be on. Can still click on grayed out items to pick them, |
| 22 |
and Save As: name changes. Weird! |
| 23 |
Looks OK when 'Single File' is selected. |
| 24 |
|
| 25 |
(?) > 0.83d: WINDOWS/FILE BROWSE: |
| 26 |
(?) If simple-app's preset filename doesn't end in a backslash, |
| 27 |
(?) browser shows contents of parent dir, not dir itself. |
| 28 |
(?) Maybe append a slash if stat() shows preset filename is a DIR? |
| 29 |
|
| 30 |
-- 0.82c -- |
| 31 |
|
| 32 |
|
| 33 |
(?) > 0.82c: Windows "Save As" is not setting correct directory in browser |
| 34 |
|
| 35 |
|
| 36 |
(?) > 0.82: Andreas reports problem with Mac chooser not showing thumbnails |
| 37 |
(?) that live on remote drives even though the Finder does. |
| 38 |
(?) Files located on the local file system show up OK. |
| 39 |
(?) (See Reference #1 below for Apple's SimpleText.c excerpts?) |
| 40 |
(?) Also, see Andreas' email 12/05/2005 (Reference #2 below) |
| 41 |
|
| 42 |
(?) > 0.82: Presetting value() under linux causes chooser to open with file |
| 43 |
(?) highlighted in the chooser, but not in windows or mac. |
| 44 |
|
| 45 |
(?) > 0.82: Fl_Native_File_Chooser: WINDOWS doesn't handle returning UTF8 from |
| 46 |
(?) native windows file chooser.. comes back as garbage, possibly as non-UTF8? |
| 47 |
(?) (Found problem on Japanese localized machine by browsing to a dir |
| 48 |
(?) with Japanese chars. Shows OK in windows browser, but when returned |
| 49 |
(?) to Fl_Input, comes up as garbage, even though the Fl_Input is capable |
| 50 |
(?) of showing text correctly if japanese text pasted as text into the |
| 51 |
(?) Fl_Input from Windows URL input) |
| 52 |
|
| 53 |
*** DONE *** |
| 54 |
(DONE) > 0.82c: "Save As" + "Show Confirm Dialog" is not showing the confirm dialog..! |
| 55 |
(DONE) TESTED ON LINUX AND OSX TO WORK OK. |
| 56 |
|
| 57 |
(DONE) > 0.83c: Shane Hill on 02/07/06 reports that under Windows, doing regular |
| 58 |
(DONE) file browsing results in the current working dir being changed. |
| 59 |
(DONE) Luckily there appears to be a WIN32 flag for this, but the docs |
| 60 |
(DONE) say it's ineffective..!? |
| 61 |
(DONE) OFN_NOCHANGEDIR |
| 62 |
(DONE) Restores the current directory to its original value if the user changed |
| 63 |
(DONE) the directory while searching for files. |
| 64 |
(DONE) Windows NT 4.0/2000/XP: This flag is ineffective for GetOpenFileName. |
| 65 |
(DONE) ^^^^^^^^^^^^^^^^^^^^^^^^ |
| 66 |
|
| 67 |
(DONE) > 0.82: Alessandro: uses very long wildcard strings.. |
| 68 |
(DONE) Replace fixed arrays (char wildcard[80]) with new strapp() stuff. |
| 69 |
|
| 70 |
------------------------------------------------------------------------ |
| 71 |
Reference #1 |
| 72 |
------------------------------------------------------------------------ |
| 73 |
|
| 74 |
// REFERENCE FROM SimpleText.c for erco.. |
| 75 |
|
| 76 |
short numTypes; |
| 77 |
OSType typeList[20]; |
| 78 |
OSType fileType = '\?\?\?\?'; |
| 79 |
NavDialogRef navDialog; |
| 80 |
|
| 81 |
DetermineWindowTypeOrOpen( nil, fileType, &typeList[0], &numTypes, nil ); |
| 82 |
|
| 83 |
// Open as many documents as the user wishes through Appleevents |
| 84 |
return OpenFileDialog( 'ttxt', numTypes, typeList, &navDialog ); |
| 85 |
|
| 86 |
OSType typeList[20]; |
| 87 |
OSType docList[20]; |
| 88 |
|
| 89 |
pFileTypes[*numTypes] = 'MooV'; |
| 90 |
pDocumentTypes[*numTypes] = kMovieWindow; |
| 91 |
(*numTypes)++; |
| 92 |
|
| 93 |
|
| 94 |
OSStatus OpenFileDialog( |
| 95 |
OSType applicationSignature, |
| 96 |
short numTypes, |
| 97 |
OSType typeList[], |
| 98 |
NavDialogRef *outDialog ) |
| 99 |
{ |
| 100 |
OSStatus theErr = noErr; |
| 101 |
if ( gOpenFileDialog == NULL ) |
| 102 |
{ |
| 103 |
NavDialogCreationOptions dialogOptions; |
| 104 |
NavTypeListHandle openList = NULL; |
| 105 |
|
| 106 |
NavGetDefaultDialogCreationOptions( &dialogOptions ); |
| 107 |
|
| 108 |
dialogOptions.modality = kWindowModalityNone; |
| 109 |
dialogOptions.clientName = CFStringCreateWithPascalString( |
| 110 |
NULL, LMGetCurApName(), GetApplicationTextEncoding()); |
| 111 |
|
| 112 |
openList = (NavTypeListHandle)NewOpenHandle( applicationSignature, numTypes, typeList ); |
| 113 |
|
| 114 |
theErr = NavCreateGetFileDialog( &dialogOptions, openList, |
| 115 |
GetPrivateEventUPP(), |
| 116 |
NULL, NULL, NULL, &gOpenFileDialog ); |
| 117 |
|
| 118 |
------------------------------------------------------------------------ |
| 119 |
Reference #2 |
| 120 |
------------------------------------------------------------------------ |
| 121 |
|
| 122 |
Andreas Schömann wrote: |
| 123 |
> Greg Ercolano wrote: |
| 124 |
> |
| 125 |
>> Andreas Schömann wrote: |
| 126 |
>> |
| 127 |
>>> 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... |
| 128 |
|
| 129 |
BTW, Andreas is specifically referring to the MAC file browser; |
| 130 |
when you have it in 'column' mode, when you highlight eg. a jpg |
| 131 |
image, the preview that normally displays off to the right |
| 132 |
doesn't show up. |
| 133 |
|
| 134 |
I looked at the SimpleText.c code that comes with the OSX |
| 135 |
developer toolkit, ie: |
| 136 |
/Developer//Examples/Carbon/SimpleText/* |
| 137 |
|
| 138 |
..and it looks like they use a few options to NavCreateGetFileDialog() |
| 139 |
that I don't use, namely arg2 and arg3 to set a list of files |
| 140 |
and a callback. |
| 141 |
|
| 142 |
I have to admit I don't fully understand the Mac stuff when it |
| 143 |
comes to this sort of thing. Apparently there's a global database |
| 144 |
somewhere of 4 character file types that dates back to the 1980's, |
| 145 |
and it appears one needs to know these names and hard code them |
| 146 |
into your app (as is done in SimpleText.cxx). |
| 147 |
|
| 148 |
I think I'll leave this unfinished, since it's not really a show |
| 149 |
stopper, and I'm not sure how to make it work correctly. |
| 150 |
|
| 151 |
> 4) Here on my machine Fl_Native_File_Chooser displays a preview for _local_ images (e.g. .jpeg, .tiff and .png) |
| 152 |
|
| 153 |
Really? |
| 154 |
|
| 155 |
I actually couldn't get that to work on my 10.4.3 box. |
| 156 |
|
| 157 |
When I single click on a jpeg, png, or other image format, |
| 158 |
it shows a generic image, but the correct text info about |
| 159 |
the image's file type. |
| 160 |
|
| 161 |
What does work is if I click on .c or .cxx files it shows |
| 162 |
correctly, and if I click on a .rm file (Real Media), |
| 163 |
it shows Real's icon logo.. (shrug) |
| 164 |
|
| 165 |
In the Finder, when you click on images, it shows a thumbnail |
| 166 |
of the actual image. |
| 167 |
|
| 168 |
> Hmmmh, somewhat confusing results... |
| 169 |
> 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? |
| 170 |
> 1) and 2) tell me that one can disable file preview with 'Navigation Services', though probably not by intention. |
| 171 |
|
| 172 |
It might be I'm missing some args to NavCreateGetFileDialog() |
| 173 |
(arg2 and 3?) Unfortunately I'm not sure what is the correct |
| 174 |
code to make that work, if that's even the cause. |
| 175 |
|
| 176 |
Or maybe I need to link in some apple framework that's missing |
| 177 |
to make that stuff work. |
| 178 |
|
| 179 |
> 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. |
| 180 |
|
| 181 |
Right, as described above. |
| 182 |
However, I'd think there'd be defaults for things like jpeg/png/etc. |
| 183 |
|
| 184 |
I'd hate to think I have to manually provide callbacks for each |
| 185 |
image type..! |
| 186 |
|
| 187 |
------------------------------------------------------------------------ |
| 188 |
Reference #3 |
| 189 |
------------------------------------------------------------------------ |
| 190 |
|