Fix mdcrd import to allow coordinates using full 8 digits (like -123.456 or 1234.567).
Occasional crash during minimization is fixed.
+2011.9.30.
+ Windows の文字コードで厄介なバグを発見。内部コードを UTF-8 にしているのだが、Dir.pwd などは Windows の内部コードそのもの(Shift-JIS?)で動作するので、Molecule#path などと矛盾が生じる。さらに、Ruby_FileStringValuePtr などは Shift-JIS を前提としているので、Molecule#path などもおかしな文字列を生成してしまう。このため、パスに日本語が入っていると open(mol.path + "/test.txt", "w") などがうまくいかない。さてどうしたものか?
+→ wxConvUTF8 の代わりに Windows では *wxConvCurrent を使うようにした。
+
#include "MyApp.h"
#include "../MolLib/Ruby_bind/Molby_extern.h"
+#include "MyMBConv.h"
BEGIN_EVENT_TABLE(ConsoleFrame, wxMDIChildFrame)
EVT_UPDATE_UI(wxID_CLOSE, ConsoleFrame::OnUpdateUI)
RubyValue val;
Molecule *mol = MoleculeCallback_currentMolecule();
MoleculeLock(mol);
- val = Molby_evalRubyScriptOnMolecule(string.mb_str(wxConvUTF8), MoleculeCallback_currentMolecule(), &status);
+ val = Molby_evalRubyScriptOnMolecule(string.mb_str(WX_DEFAULT_CONV), MoleculeCallback_currentMolecule(), &status);
MoleculeUnlock(mol);
if (status != -1) { /* Status -1 is already handled */
MyAppCallback_setConsoleColor(1);
#include "MyListCtrl.h"
#include "../MolLib/MolLib.h"
#include "../MolLib/Missing.h"
+#include "MyMBConv.h"
// #include "../MolLib/Ruby_bind/Molby_extern.h"
if (i >= 0) {
char *s;
asprintf(&s, "File '%s' has already been read. Do you want to replace the parameters?", ParameterGetComment(src_idx));
- wxString mes(s, wxConvUTF8);
+ wxString mes(s, WX_DEFAULT_CONV);
if (::wxMessageBox(mes, _T("Reload global parameter file"), wxOK | wxCANCEL | wxICON_EXCLAMATION) != wxOK)
return;
}
cp = ParameterGetComment(ip->src);
if (cn > 0)
files << _T(", ");
- files << wxString(cp, wxConvUTF8);
+ files << wxString(cp, WX_DEFAULT_CONV);
cn++;
}
}
if (cn == 0)
return;
- asprintf(&s, "Do you really want to unload the parameter%s %s?", (cn > 1 ? "s" : ""), (const char *)files.mb_str(wxConvUTF8));
- wxString mes(s, wxConvUTF8);
+ asprintf(&s, "Do you really want to unload the parameter%s %s?", (cn > 1 ? "s" : ""), (const char *)files.mb_str(WX_DEFAULT_CONV));
+ wxString mes(s, WX_DEFAULT_CONV);
if (::wxMessageBox(mes, _T("Unload global parameter file"), wxOK | wxCANCEL | wxICON_EXCLAMATION) != wxOK)
return;
for (i = gGlobalParInfo.count - 1; i >= gGlobalParInfo.builtinCount; i--) {
else
p = ip->dir;
}
- wxString str((p ? p : ""), wxConvUTF8);
+ wxString str((p ? p : ""), WX_DEFAULT_CONV);
return str;
}
#include "MyApp.h"
#include "MyListCtrl.h"
#include "../MolLib/Ruby_bind/Molby_extern.h"
+#include "MyMBConv.h"
BEGIN_EVENT_TABLE(GlobalParameterFrame, wxMDIChildFrame)
EVT_CLOSE(GlobalParameterFrame::OnCloseWindow)
{
char buf[128];
MainView_valueForTable(NULL, column, row, buf, sizeof buf);
- wxString *str = new wxString(buf, wxConvUTF8);
+ wxString *str = new wxString(buf, WX_DEFAULT_CONV);
return *str;
}
int
GlobalParameterFrame::SetItemText(MyListCtrl *ctrl, long row, long column, const wxString &value)
{
-// MainView_setValueForTable(NULL, column, row, value.mb_str(wxConvUTF8));
+// MainView_setValueForTable(NULL, column, row, value.mb_str(WX_DEFAULT_CONV));
return 0;
}
#include "MySlider.h"
#include "MyListCtrl.h"
#include "../MolLib/Missing.h"
+#include "MyMBConv.h"
#include "wx/tglbtn.h"
#include "wx/listctrl.h"
MainView_tableTitleForIndex(mview, i, buf, sizeof buf);
if (buf[0] == 0)
break;
- wxString itemTitle(buf, wxConvUTF8);
+ wxString itemTitle(buf, WX_DEFAULT_CONV);
choiceItems.Add(itemTitle);
}
/* static wxString choiceItems[] = {
nframes = MoleculeGetNumberOfFrames(mview->mol);
if (nframes != 0) {
str = frameText->GetValue();
- ival = atoi((const char *)str.mb_str(wxConvUTF8));
+ ival = atoi((const char *)str.mb_str(WX_DEFAULT_CONV));
if (ival >= 0 && ival < nframes) {
MoleculeSelectFrame(mview->mol, ival, 1);
MoleculeUnlock(mview->mol);
{
char buf[128];
MainView_valueForTable(mview, column, row, buf, sizeof buf);
- wxString *str = new wxString(buf, wxConvUTF8);
+ wxString *str = new wxString(buf, WX_DEFAULT_CONV);
return *str;
}
int
MoleculeView::SetItemText(MyListCtrl *ctrl, long row, long column, const wxString &value)
{
- MainView_setValueForTable(mview, column, row, value.mb_str(wxConvUTF8));
+ MainView_setValueForTable(mview, column, row, value.mb_str(WX_DEFAULT_CONV));
return 0;
}
MainViewCallback_drawInfoText(MainView *mview, const char *label)
{
if (mview != NULL && mview->ref != NULL) {
- wxString labelstr(label, wxConvUTF8);
+ wxString labelstr(label, WX_DEFAULT_CONV);
((MoleculeView *)(mview->ref))->infotext->SetLabel(labelstr);
}
}
if (fname == NULL || *fname == 0) {
doc = manager->CreateDocument(wxT(""), wxDOC_NEW);
} else {
- wxString fnamestr(fname, wxConvUTF8); /* UTF8 -> wxString */
+ wxString fnamestr(fname, wxConvFile);
doc = manager->CreateDocument(fnamestr, wxDOC_SILENT);
}
return MainViewCallback_activeView();
{
MyDocument *doc;
if (mview != NULL && mview->ref != NULL && (doc = (((MoleculeView *)(mview->ref))->MolDocument())) != NULL) {
- wxString fnamestr(fname, wxConvUTF8); /* UTF8 -> wxString */
+ wxString fnamestr(fname, wxConvFile);
// doc->importFromFile(fnamestr);
MainViewCallback_setNeedsDisplay(mview, 1);
return 1;
if (mview != NULL && mview->ref != NULL && (doc = (((MoleculeView *)(mview->ref))->MolDocument())) != NULL) {
wxString fname;
fname = doc->GetFilename();
- strncpy(buf, (const char*)fname.mb_str(wxConvUTF8), bufsize - 1); /* wxString -> UTF8 */
+ strncpy(buf, (const char*)fname.mb_str(wxConvFile), bufsize - 1);
buf[bufsize - 1] = 0;
} else {
buf[0] = 0;
MainViewCallback_addTableColumn(MainView *mview, const char *name, int width, int editable)
{
int idx;
- wxString nstr(name, wxConvUTF8);
+ wxString nstr(name, WX_DEFAULT_CONV);
MyListCtrl *listctrl = s_MyListCtrlFromMainView(mview);
if (listctrl == NULL)
return 0;
#include "ProgressFrame.h"
#include "GlobalParameterFrame.h"
#include "GlobalParameterFilesFrame.h"
+#include "MyMBConv.h"
#include "../MolLib/MolLib.h"
#include "../MolLib/Ruby_bind/Molby.h"
if (ref != NULL) {
UInt8 buffer[256];
if (CFURLGetFileSystemRepresentation(ref, true, buffer, sizeof buffer)) {
- wxString dirname((const char *)buffer, wxConvUTF8);
+ wxString dirname((const char *)buffer, WX_DEFAULT_CONV);
CFRelease(ref);
return dirname;
}
{
// Check if the same application is already running
char *buf;
- asprintf(&buf, "Molby-%s", (const char *)wxGetUserId().mb_str(wxConvUTF8));
- wxString name(buf, wxConvUTF8);
+ asprintf(&buf, "Molby-%s", (const char *)wxGetUserId().mb_str(WX_DEFAULT_CONV));
+ wxString name(buf, WX_DEFAULT_CONV);
malloc(16);
free(buf);
m_checker = new wxSingleInstanceChecker(name);
free(wbuf);
}
- wxString fnamestr(fname, wxConvUTF8);
- Molby_startup(wxFileExists(fnamestr) ? fname : NULL, (const char *)dirname.mb_str(wxConvUTF8));
+ wxString fnamestr(fname, wxConvFile);
+ Molby_startup(wxFileExists(fnamestr) ? fname : NULL, (const char *)dirname.mb_str(wxConvFile));
wxSetWorkingDirectory(cwd);
MyAppCallback_showScriptMessage("%% ");
{
wxTextCtrl *textCtrl;
if (consoleFrame != NULL && (textCtrl = consoleFrame->textCtrl) != NULL) {
- wxString string(mes, wxConvUTF8);
+ wxString string(mes, WX_DEFAULT_CONV);
textCtrl->AppendText(string);
return string.Len();
} else return 0;
void
MyApp::ShowProgressPanel(const char *mes)
{
- wxString string((mes ? mes : ""), wxConvUTF8);
+ wxString string((mes ? mes : ""), WX_DEFAULT_CONV);
if (m_progressFrame == NULL) {
#if __WXMAC__
{
MyApp::SetProgressMessage(const char *mes)
{
if (m_progressFrame != NULL) {
- wxString string((mes ? mes : ""), wxConvUTF8);
+ wxString string((mes ? mes : ""), WX_DEFAULT_CONV);
m_progressFrame->SetProgressMessage(string);
}
}
if (title == NULL || title[0] == 0) {
smenu->AppendSeparator();
} else {
- wxString stitle(scriptMenuTitles[i], wxConvUTF8);
+ wxString stitle(scriptMenuTitles[i], WX_DEFAULT_CONV);
wxMenuItem *item = new wxMenuItem(smenu, myMenuID_CustomScript + i, stitle);
smenu->Append(item);
}
int status = 0;
char buf[256];
size_t len, len_total;
- wxString cmdstr(cmdline, wxConvUTF8);
+ wxString cmdstr(cmdline, WX_DEFAULT_CONV);
#if defined(__WXMSW__)
extern int myKillAllChildren(long pid, wxSignal sig, wxKillError *krc);
#endif
gVersionString, gCopyrightString, sLastBuildString,
wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER,
gRubyVersion, gRubyCopyright);
- wxString str(s, wxConvUTF8);
+ wxString str(s, WX_DEFAULT_CONV);
(void)wxMessageBox(str, _T("Molby"));
}
char *
MyAppCallback_getGlobalSettings(const char *key)
{
- wxString wxkey(key, wxConvUTF8);
+ wxString wxkey(key, WX_DEFAULT_CONV);
wxString wxvalue = wxGetApp().GetDefaultSetting(wxkey);
- return strdup(wxvalue.mb_str(wxConvUTF8));
+ return strdup(wxvalue.mb_str(WX_DEFAULT_CONV));
}
void
MyAppCallback_setGlobalSettings(const char *key, const char *value)
{
- wxString wxkey(key, wxConvUTF8);
- wxString wxvalue(value, wxConvUTF8);
+ wxString wxkey(key, WX_DEFAULT_CONV);
+ wxString wxvalue(value, WX_DEFAULT_CONV);
wxGetApp().SetDefaultSetting(wxkey, wxvalue);
}
{
wxString str;
str.PrintfV(wxString::FromUTF8(fmt).GetData(), ap);
- p = strdup((const char *)str.mb_str(wxConvUTF8));
+ p = strdup((const char *)str.mb_str(WX_DEFAULT_CONV));
}
#endif
if (p != NULL) {
wxStaticText *stext;
wxTextCtrl *tctrl;
int retval;
- wxString pstr(prompt, wxConvUTF8);
+ wxString pstr(prompt, WX_DEFAULT_CONV);
{ // Vertical sizer containing [prompt, textbox, buttons]
wxBoxSizer *sizer1;
sizer1 = new wxBoxSizer(wxVERTICAL);
tctrl->SetFocus();
}
if (dialog->ShowModal() == wxID_OK) {
- strncpy(buf, (const char *)(tctrl->GetValue().mb_str(wxConvUTF8)), bufsize - 1);
+ strncpy(buf, (const char *)(tctrl->GetValue().mb_str(WX_DEFAULT_CONV)), bufsize - 1);
buf[bufsize - 1] = 0;
retval = 1;
} else {
case 2: wxicon = wxICON_EXCLAMATION; break;
default: wxicon = wxICON_INFORMATION; break;
}
- wxString wxmessage(message, wxConvUTF8);
- wxString wxtitle(title, wxConvUTF8);
+ wxString wxmessage(message, WX_DEFAULT_CONV);
+ wxString wxtitle(title, WX_DEFAULT_CONV);
retval = ::wxMessageBox(wxmessage, wxtitle, wxflags | wxicon);
return (retval == wxOK ? 1 : 0);
}
*/
#include "MyClipboardData.h"
+#include "MyMBConv.h"
MyClipboardData::MyClipboardData(const char *type):
wxDataObjectSimple()
{
- wxString ftype(type, wxConvUTF8);
+ wxString ftype(type, WX_DEFAULT_CONV);
wxDataFormat customFormat((const wxChar *)ftype);
buffer = NULL;
length = 0;
*/
#include "MyDocManager.h"
+#include "MyMBConv.h"
BEGIN_EVENT_TABLE(MyDocManager, wxDocManager)
EVT_MENU(wxID_SAVE, MyDocManager::OnFileSave)
for (iter = tlist.begin(); iter != tlist.end(); ++iter) {
int i;
wxDocTemplate *dt = (wxDocTemplate *)(*iter);
- const char *p = (const char *)(dt->GetDefaultExtension().mb_str(wxConvUTF8));
+ const char *p = (const char *)(dt->GetDefaultExtension().mb_str(WX_DEFAULT_CONV));
for (i = 0; extensions[i] != NULL; i++) {
if (strcmp(extensions[i], p) == 0) {
dt->SetFlags(flag ? wxTEMPLATE_VISIBLE : wxTEMPLATE_INVISIBLE);
#include "MyCommand.h"
#include "MyClipboardData.h"
#include "MyThread.h"
+#include "MyMBConv.h"
#include "../MolLib/Ruby_bind/Molby_extern.h"
#include "../MolLib/MD/MDCore.h"
if (success) {
return 0;
} else {
- MyAppCallback_errorMessageBox("Error during deleting log file '%s'", (const char *)dir2.mb_str(wxConvUTF8));
+ MyAppCallback_errorMessageBox("Error during deleting log file '%s'", (const char *)dir2.mb_str(wxConvFile));
return -1;
}
}
/* Move to the temporary directory and export the molecule as a pdb */
wxString cwd = wxFileName::GetCwd();
if (!wxFileName::SetCwd(tdir)) {
- MyAppCallback_errorMessageBox("Cannot move to the temporary directory '%s'", (const char *)tdir.mb_str(wxConvUTF8));
+ MyAppCallback_errorMessageBox("Cannot move to the temporary directory '%s'", (const char *)tdir.mb_str(WX_DEFAULT_CONV));
return;
}
{
if (status == 0) {
wxString acfile = tdir + wxFileName::GetPathSeparator() + _T("mol.ac");
- status = MolActionCreateAndPerform(mol, SCRIPT_ACTION("s"), "import_ac", (const char *)acfile.mb_str(wxConvUTF8));
+ status = MolActionCreateAndPerform(mol, SCRIPT_ACTION("s"), "import_ac", (const char *)acfile.mb_str(wxConvFile));
if (status != 0) {
MyAppCallback_errorMessageBox("Cannot import antechamber output.");
}
if (calc_charge && status == 0) {
wxString sqmfile = tdir + wxFileName::GetPathSeparator() + _T("sqm.out");
if (wxFileName::FileExists(sqmfile)) {
- status = MolActionCreateAndPerform(mol, SCRIPT_ACTION("s"), "import_sqmout", (const char *)sqmfile.mb_str(wxConvUTF8));
+ status = MolActionCreateAndPerform(mol, SCRIPT_ACTION("s"), "import_sqmout", (const char *)sqmfile.mb_str(wxConvFile));
if (status != 0) {
MyAppCallback_errorMessageBox("Cannot import sqm output.");
}
if (status == 0) {
wxString frcmodfile = tdir + wxFileName::GetPathSeparator() + _T("frcmod");
- status = MolActionCreateAndPerform(mol, SCRIPT_ACTION("s"), "import_frcmod", (const char *)frcmodfile.mb_str(wxConvUTF8));
+ status = MolActionCreateAndPerform(mol, SCRIPT_ACTION("s"), "import_frcmod", (const char *)frcmodfile.mb_str(wxConvFile));
if (status != 0) {
MyAppCallback_errorMessageBox("Cannot import parmchk output.");
}
if (strcmp(type, "TEXT") == 0) {
wxTextDataObject *tp = new wxTextDataObject();
if (data != NULL) {
- wxString str((const char *)data, wxConvUTF8, length);
+ wxString str((const char *)data, WX_DEFAULT_CONV, length);
tp->SetText(str);
}
return tp;
if (strcmp(type, "TEXT") == 0) {
wxTextDataObject *tp = (wxTextDataObject *)dp;
wxString str = tp->GetText();
- const char *cp = str.mb_str(wxConvUTF8);
+ const char *cp = str.mb_str(WX_DEFAULT_CONV);
len = strlen(cp);
p = malloc(len + 1);
if (p != NULL) {
if (doc != NULL) {
wxString fname;
doc->GetPrintableName(fname);
- strncpy(buf, (const char*)fname.mb_str(wxConvUTF8), bufsize - 1); /* wxString -> UTF8 */
+ strncpy(buf, (const char*)fname.mb_str(wxConvFile), bufsize - 1);
buf[bufsize - 1] = 0;
} else {
buf[0] = 0;
#include "RubyDialogFrame.h"
#include "MyApp.h"
+#include "MyMBConv.h"
BEGIN_EVENT_TABLE(RubyDialogFrame, wxDialog)
// EVT_TEXT_ENTER(-1, ConsoleFrame::OnEnterPressed)
((wxWindow *)ditems[0])->Show(false);
} else {
if (oktitle[0] != 0) {
- wxString label1(oktitle, wxConvUTF8);
+ wxString label1(oktitle, WX_DEFAULT_CONV);
((wxButton *)ditems[0])->SetLabel(label1);
}
((wxWindow *)ditems[0])->Connect(-1, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(RubyDialogFrame::OnDialogItemAction), NULL, this);
((wxWindow *)ditems[1])->Show(false);
} else {
if (canceltitle[0] != 0) {
- wxString label2(canceltitle, wxConvUTF8);
+ wxString label2(canceltitle, WX_DEFAULT_CONV);
((wxButton *)ditems[1])->SetLabel(label2);
}
((wxWindow *)ditems[1])->Connect(-1, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(RubyDialogFrame::OnDialogItemAction), NULL, this);
void
RubyDialogCallback_setWindowTitle(RubyDialog *dref, const char *title)
{
- wxString str(title, wxConvUTF8);
+ wxString str(title, WX_DEFAULT_CONV);
((RubyDialogFrame *)dref)->SetLabel(str);
}
wxWindow *control = NULL;
wxRect rect, offset;
RubyDialogFrame *parent = ((RubyDialogFrame *)dref);
- wxString tstr((title ? title : ""), wxConvUTF8);
+ wxString tstr((title ? title : ""), WX_DEFAULT_CONV);
bool no_action = false;
rect = wxRectFromRDRect(frame);
void
RubyDialogCallback_setStringToItem(RDItem *item, const char *s)
{
- wxString str(s, wxConvUTF8);
+ wxString str(s, WX_DEFAULT_CONV);
if (wxDynamicCast((wxWindow *)item, wxTextCtrl) != NULL) {
((wxTextCtrl *)item)->SetValue(str);
}
buf[0] = 0;
return;
}
- strncpy(buf, str.mb_str(wxConvUTF8), bufsize - 1);
+ strncpy(buf, str.mb_str(WX_DEFAULT_CONV), bufsize - 1);
buf[bufsize - 1] = 0;
}
} else {
return NULL;
}
- return strdup(str.mb_str(wxConvUTF8));
+ return strdup(str.mb_str(WX_DEFAULT_CONV));
}
char *
} else {
str = ((wxWindow *)item)->GetLabel();
}
- return strdup(str.mb_str(wxConvUTF8));
+ return strdup(str.mb_str(WX_DEFAULT_CONV));
}
void
RubyDialogCallback_setTitleToItem(RDItem *item, const char *s)
{
- wxString str(s, wxConvUTF8);
+ wxString str(s, WX_DEFAULT_CONV);
if (wxDynamicCast((wxWindow *)item, wxTextCtrl) != NULL) {
((wxTextCtrl *)item)->SetValue(str);
} else {
int
RubyDialogCallback_appendSubItem(RDItem *item, const char *s)
{
- wxString str(s, wxConvUTF8);
+ wxString str(s, WX_DEFAULT_CONV);
if (wxDynamicCast((wxWindow *)item, wxChoice) != NULL) {
return ((wxChoice *)item)->Append(str);
} else return -1;
int
RubyDialogCallback_insertSubItem(RDItem *item, const char *s, int pos)
{
- wxString str(s, wxConvUTF8);
+ wxString str(s, WX_DEFAULT_CONV);
if (wxDynamicCast((wxWindow *)item, wxChoice) != NULL && pos >= 0 && pos < ((wxChoice *)item)->GetCount()) {
return ((wxChoice *)item)->Insert(str, pos);
} else return -1;
{
if (wxDynamicCast((wxWindow *)item, wxChoice) != NULL && pos >= 0 && pos < ((wxChoice *)item)->GetCount()) {
wxString str = ((wxChoice *)item)->GetString(pos);
- return strdup(str.mb_str(wxConvUTF8));
+ return strdup(str.mb_str(WX_DEFAULT_CONV));
} else return NULL;
}
s2 = strchr(s1, '\n');
if (s2 == NULL)
s2 = sfin;
- wxString str(s1, wxConvUTF8, s2 - s1);
+ wxString str(s1, WX_DEFAULT_CONV, s2 - s1);
dc.GetTextExtent(str, &w, &h, &descent, &leading);
if (size.width < w)
size.width = w;
RubyDialogCallback_savePanel(const char *title, const char *dirname, const char *wildcard, char *buf, int bufsize)
{
int result;
- wxString pstr((dirname ? dirname : ""), wxConvUTF8);
- wxString tstr((title ? title : "Choose a file"), wxConvUTF8);
- wxString fstr(buf, wxConvUTF8);
- wxString wstr((wildcard ? wildcard : "All files (*.*)|*.*"), wxConvUTF8);
+ wxString pstr((dirname ? dirname : ""), WX_DEFAULT_CONV);
+ wxString tstr((title ? title : "Choose a file"), WX_DEFAULT_CONV);
+ wxString fstr(buf, WX_DEFAULT_CONV);
+ wxString wstr((wildcard ? wildcard : "All files (*.*)|*.*"), WX_DEFAULT_CONV);
wxFileDialog *dialog = new wxFileDialog(NULL, tstr, pstr, fstr, wstr, wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
if (dialog->ShowModal() == wxID_OK) {
strncpy(buf, dialog->GetPath().mb_str(wxConvFile), bufsize - 1);
RubyDialogCallback_openPanel(const char *title, const char *dirname, const char *wildcard, char ***array, int for_directories, int multiple_selection)
{
int result = 0;
- wxString pstr((dirname ? dirname : ""), wxConvUTF8);
- wxString wstr((wildcard ? wildcard : "All files (*.*)|*.*"), wxConvUTF8);
+ wxString pstr((dirname ? dirname : ""), WX_DEFAULT_CONV);
+ wxString wstr((wildcard ? wildcard : "All files (*.*)|*.*"), WX_DEFAULT_CONV);
int style = wxFD_OPEN | (multiple_selection ? wxFD_MULTIPLE : 0);
if (for_directories) {
- wxString tstr((title ? title : "Choose a directory"), wxConvUTF8);
+ wxString tstr((title ? title : "Choose a directory"), WX_DEFAULT_CONV);
wxDirDialog *dialog = new wxDirDialog(NULL, tstr, pstr);
if (dialog->ShowModal() == wxID_OK) {
*array = (char **)malloc(sizeof(char *));
}
dialog->Destroy();
} else {
- wxString tstr((title ? title : "Choose a file"), wxConvUTF8);
+ wxString tstr((title ? title : "Choose a file"), WX_DEFAULT_CONV);
wxFileDialog *dialog = new wxFileDialog(NULL, tstr, pstr, _T(""), wstr, style);
if (dialog->ShowModal() == wxID_OK) {
*array = (char **)malloc(sizeof(char *));
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
8D1107320486CEB800E47090 /* Molby.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Molby.app; sourceTree = BUILT_PRODUCTS_DIR; };
9E12580E119EC42E00E95DC3 /* docview.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = docview.cpp; path = ../wxSources/docview.cpp; sourceTree = SOURCE_ROOT; };
+ E40DDC6C1435C03E000F0E81 /* MyMBConv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MyMBConv.h; path = ../wxSources/MyMBConv.h; sourceTree = SOURCE_ROOT; };
E4299DA60F2A191600780B44 /* ruby_types.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ruby_types.c; sourceTree = "<group>"; };
E42D8AEF1030193F00C20247 /* MDGraphite.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = MDGraphite.c; sourceTree = "<group>"; };
E42D8AF01030193F00C20247 /* MDGraphite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MDGraphite.h; sourceTree = "<group>"; };
E4A4667410C15B4300E40A9D /* listctrl.cpp */,
9E12580E119EC42E00E95DC3 /* docview.cpp */,
E4513F530EED72C0009DF1F7 /* MyListCtrl.h */,
+ E40DDC6C1435C03E000F0E81 /* MyMBConv.h */,
E4513F540EED72C0009DF1F7 /* MyListCtrl.cpp */,
E4C8CBDD10B83060006C4692 /* MyDocManager.h */,
E4C8CBDE10B83060006C4692 /* MyDocManager.cpp */,