Need open file and save file dialog window

  • liyinghui

    I'll add utf-8 auto detecting quickly. I add it for reading an encoding file to wxStyledTextContral. But the encoding of a file may be various, like ascii, utf-8, Chinese encoding, Japanese encoding, Korea encoding, etc. Only support local encoding and utf-8 when open a file is not sufficiency. So we should use our own open file dialog window, that the user can choice an encoding of the file.

    You could ask why don't you use preference option to do this thing? Because the preference option is a general setting, but when open multi files, each file could has its own file encoding, and you may want to save each to different encoding, not a general encoding. Of cause when saveing a file, you can set encoding in preference window first, then click update, close the window, at the last save the file really in your specified encoding. But it's ugly.

    If we have our own open file and save file window, we can do these things neatly.

    BTW, in order to implement auto detecting utf-8 encoding, I have to add an array to save the encoding of each openned file. Because the encoding of each file may be different, in orer to save the file using its original encoding I had to do so. Is there some good ideas about it ? Or we might organize seperate info of each file in a class not in an array?

    • Allright:

      I was thinking of saving the encoding for each txtDocument and txtPrompt instance.  This would let
      you use the already existing array to keep track of the encoding for each file.

      Making a custom open/save dialog is a LOT of work.
      However it may be worth it.  I can think of lots of things I would like to add (access to bookmarks being at the top of the list).

      It also means we lose the native feel of using the built in version.

      In any case I will post the modification with txtDocument/txtPrompt to cvs soon, and we can proceed from there.