Martin Sevior wrote:
>
> On Tue, 29 May 2001, Andrew Dunbar wrote:
>
> > I'm working on a dialog for the text importer and exporter that
> > lets you choose the file encoding. It's very close to finished
> > but to call Dialog::runModal I need a pointer to an XAP_Frame.
> >
> > I don't know much about Abi's internals and I can't see an
> > obvious and elegant way to get the correct Frame pointer from
> > inside an ie_Exp or ie_Imp. They are only passed a pd_Document
> > pointer and this doesn't seem to be enough.
> >
> > Please help if you can see the right answer!
> >
>
> Hi Andrew,
> Are you sure the dialog should be called from within ie_*? Why
> not from within the "open" or "save as" dialogs? These are called from the
> the file:
I thought of this too and calling a dialog from a dialog seems
undesirable. Also for importing it's nice to run the function that
tries to guess the encoding first and making it the default option.
> src/wp/ap/xp/ap_EditMethods.cpp.
>
> I think that ie_imp_* and ie_exp* should report back to their calling
> dialogs (open) and "save" or "save as" or "export" the state of the
> encoding.
I'll look down that path, thanks.
> However as a plain old ascii user I certainly wouldn't want to know about
> what encoding to set my file to. How do you plan on hiding this info from
> this large target market?
Well you'd probably be surprised how many characters above 127 you
actually do use unless you consciously avoid them. On almost all
OSes the default charset is 8 bit: ISO-8859-1 for *nix, code page
1252 for Windows, and Mac Roman of course on a Mac. And even then
English is almost alone in being fully expressable in 7-bit ASCII.
Still, I intend to supplement the current "Text" option with an
"Encoded Text" option in the Open and Save dialogs. Note that
this will only work properly once Bug 1471 is fixed:
http://bugzilla.abisource.com/show_bug.cgi?id=1471
Andrew.
--
http://linguaphile.sourceforge.net
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com