From: Jeroen <jv...@cf...> - 2001-05-31 14:35:03
|
On Wednesday 30 May 2001 08:50, you wrote: > Hi, > > On Tue, 29 May 2001 09:27:32 -0500 > > Jeroen <jv...@cf...> wrote: > > 1) You can (with the upcoming version) associate a settings database > > other than the standard registry with FXFileDict. > > > > 2) You can add/remove file bindings into this settings database via > > FXFileDict::replace() or FXFileDict::remove() API's > > > > These API's take in the extension to be bound and the string > > (comprising command, icons, mime-type, etc just as you find in the > > registry). > > > > The difference from using FXSettings directly is that using > > FXFileDict::replace and FXFileDict::remove the associations found in > > FXFileDict are also updated, so that the effect of changing, adding, or > > removing file bindings is visible immediately (of course one does have to > > insure FXFileList completely reloads itself after a change to > > FXFileDict!). > > > > > > Perhaps you were not aware of FXFileDict::replace() and > > FXFileDict::remove() ? I think these should allow you to do what you want > > (if I understand it correctly). > > You are right, I didn't realize those methods, thanx. > But two major problems remain: > > I want to know which association fits /foo/bar.tar.gz so I invoke > findFileBinding (/foo/bar.tar.gz) and get an FXFileAssoc. > Maybe findFileBinding could not find bar.tar.gz but tar.gz is available and > thus used. But this information is hidden but I need to know exactly > whether bar.tar.gz, tar.gz, gz or nothing could be found. > > Furthermore I need the information in the registry as it is, I want to know > the icons' names, an FXIcon* is useless since the tar.gz string will be > eventually overwritten later and I have to compose the entry. > That is FXFileAssoc should contain (at least) the following variables: > FXString command; > FXString extension; > FXString mimetype; > FXString bigname; > FXString bignameopen; > FXString mininame; > FXString mininameopen > For the icons you could perhaps include both an FXString and an FXIcon*. > > Bye, > Josua FXFileDict is to manage the icons. To simply find the bindings string of course you'd ask FXSettings (FXRegistry) directly. Its a ';' separated string which whoulc be fairly easy to parse with sscanf. Try sscanf(buffer,"%[^;]%[^;] ... ",command,type,....); This is little known (I didn't know it either until recently) but sscanf() can be told to scan characters adhering to certain character class, so its easy to split stuff up based on a certain delimiter. My own code could probably be simplified to use this as well... - Jeroen -- +-------------------------------+--------------------------------------------+ | E-Mail : jv...@cf... | The FOX Platform Independent GUI Toolkit: | | USMail : 215 Wynn Drive, | | | Huntsville, AL 35805 | Official Site: | | Phone : (256) 726-4820 | http://www.cfdrc.com/FOX/fox.html | | Fax : (256) 726-4806 | ftp://ftp.cfdrc.com/pub/FOX | | WWW : http://www.cfdrc.com | | +-------------------------------+--------------------------------------------+ | Copyright (C) 09:10 05/31/2001 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ |