Fixing unicode in georges edit dll
This commit is contained in:
parent
d2fc5d200e
commit
bb792b8307
10 changed files with 79 additions and 78 deletions
|
@ -44,7 +44,7 @@ IAction::IAction (TTypeAction type, uint selId, uint slot)
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
void IAction::setLabel (const std::string &logLabel, CGeorgesEditDoc &doc)
|
||||
void IAction::setLabel (const char *logLabel, CGeorgesEditDoc &doc)
|
||||
{
|
||||
_LogLabel = logLabel;
|
||||
|
||||
|
@ -75,7 +75,7 @@ bool IAction::doAction (CGeorgesEditDoc &doc, bool redo, bool &modified, bool fi
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
void IAction::update (bool updateLeftView, TUpdateRightView rightViewFlag, CGeorgesEditDoc &doc, const std::string &_FormName)
|
||||
void IAction::update (bool updateLeftView, TUpdateRightView rightViewFlag, CGeorgesEditDoc &doc, const char *_FormName)
|
||||
{
|
||||
// Right and left view
|
||||
CGeorgesEditView *rightView = doc.getRightView ();
|
||||
|
@ -129,7 +129,7 @@ void IAction::update (bool updateLeftView, TUpdateRightView rightViewFlag, CGeor
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
CActionString::CActionString (IAction::TTypeAction type, const std::string &newValue, CGeorgesEditDoc &doc, const std::string &formName, const std::string &userData, uint selId, uint slot) : IAction (type, selId, slot)
|
||||
CActionString::CActionString (IAction::TTypeAction type, const char *newValue, CGeorgesEditDoc &doc, const char *formName, const char *userData, uint selId, uint slot) : IAction (type, selId, slot)
|
||||
{
|
||||
// Set the new value
|
||||
_NewValue = newValue;
|
||||
|
@ -235,7 +235,7 @@ CActionString::CActionString (IAction::TTypeAction type, const std::string &newV
|
|||
bool vdfnArray;
|
||||
CForm *form=doc.getFormPtr ();
|
||||
CFormElm *elm = doc.getRootNode (slot);
|
||||
nlverify ( elm->getNodeByName (_FormName, &parentDfn, indexDfn,
|
||||
nlverify ( elm->getNodeByName (_FormName.c_str (), &parentDfn, indexDfn,
|
||||
&nodeDfn, &nodeType, &node, type, array, vdfnArray, true, NLGEORGES_FIRST_ROUND) );
|
||||
if (node)
|
||||
{
|
||||
|
@ -364,7 +364,7 @@ bool CActionString::doAction (CGeorgesEditDoc &doc, bool redo, bool &modified, b
|
|||
bool parentVDnfArray;
|
||||
CForm *form=doc.getFormPtr ();
|
||||
CFormElm *elm = doc.getRootNode (_Slot);
|
||||
nlverify ( elm->getNodeByName (_FormName, &parentDfn, indexDfn,
|
||||
nlverify ( elm->getNodeByName (_FormName.c_str (), &parentDfn, indexDfn,
|
||||
&nodeDfn, &nodeType, &node, type, array, parentVDnfArray, true, NLGEORGES_FIRST_ROUND) );
|
||||
nlassert (node);
|
||||
CFormElmAtom *atom = safe_cast<CFormElmAtom*> (node);
|
||||
|
@ -437,14 +437,14 @@ bool CActionString::doAction (CGeorgesEditDoc &doc, bool redo, bool &modified, b
|
|||
bool vdfnArray;
|
||||
CForm *form=doc.getFormPtr ();
|
||||
CFormElm *elm = doc.getRootNode (_Slot);
|
||||
nlverify ( elm->getNodeByName (_FormName, &parentDfn, indexDfn,
|
||||
nlverify ( elm->getNodeByName (_FormName.c_str (), &parentDfn, indexDfn,
|
||||
&nodeDfn, &nodeType, &node, type, array, vdfnArray, true, NLGEORGES_FIRST_ROUND) );
|
||||
if (node)
|
||||
{
|
||||
CFormElmArray* array = safe_cast<CFormElmArray*> (node->getParent ());
|
||||
array->Elements[idInParent].Name = _Value[index];
|
||||
modified = true;
|
||||
update (true, DoNothing, doc, _FormName);
|
||||
update (true, DoNothing, doc, _FormName.c_str ());
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -716,14 +716,14 @@ bool CActionStringVector::doAction (CGeorgesEditDoc &doc, bool redo, bool &modif
|
|||
bool parentVDfnArray;
|
||||
CForm *form=doc.getFormPtr ();
|
||||
CFormElm *elm = doc.getRootNode (slot);
|
||||
nlverify ( elm->getNodeByName (_FormName, &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true) );
|
||||
nlverify ( elm->getNodeByName (_FormName.c_str (), &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true) );
|
||||
|
||||
// Is a type entry ?
|
||||
if ((type == UFormDfn::EntryType) && array)
|
||||
{
|
||||
// Create the array
|
||||
bool created;
|
||||
nlverify ( elm->createNodeByName (_FormName, &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, created) );
|
||||
nlverify ( elm->createNodeByName (_FormName.c_str (), &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, created) );
|
||||
nlassert (node);
|
||||
|
||||
// Get the atom
|
||||
|
@ -921,7 +921,7 @@ bool CActionStringVectorVector::doAction (CGeorgesEditDoc &doc, bool redo, bool
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
CActionBuffer::CActionBuffer(IAction::TTypeAction type, const uint8 *buffer, uint bufferSize, CGeorgesEditDoc &doc, const std::string &formName, const std::string &userData, uint selId, uint slot) : IAction(type, selId, slot)
|
||||
CActionBuffer::CActionBuffer (IAction::TTypeAction type, const uint8 *buffer, uint bufferSize, CGeorgesEditDoc &doc, const char *formName, const char *userData, uint selId, uint slot) : IAction (type, selId, slot)
|
||||
{
|
||||
// New value
|
||||
_FormName = formName;
|
||||
|
|
|
@ -59,7 +59,7 @@ protected:
|
|||
IAction (TTypeAction type, uint selId, uint slot);
|
||||
|
||||
// Init log label
|
||||
void setLabel (const std::string &logLabel, CGeorgesEditDoc &doc);
|
||||
void setLabel (const char *logLabel, CGeorgesEditDoc &doc);
|
||||
|
||||
public:
|
||||
|
||||
|
@ -96,7 +96,7 @@ protected:
|
|||
UpdateValues,
|
||||
Redraw
|
||||
};
|
||||
void update (bool updateLeftView, TUpdateRightView rightView, CGeorgesEditDoc &doc, const std::string &_FormName);
|
||||
void update (bool updateLeftView, TUpdateRightView rightView, CGeorgesEditDoc &doc, const char *_FormName);
|
||||
};
|
||||
|
||||
// String modification action
|
||||
|
@ -105,7 +105,7 @@ class CActionString : public IAction
|
|||
public:
|
||||
|
||||
// Constructor
|
||||
CActionString(IAction::TTypeAction type, const std::string &newValue, CGeorgesEditDoc &doc, const std::string &formName, const std::string &userData, uint selId, uint slot);
|
||||
CActionString (IAction::TTypeAction type, const char *newValue, CGeorgesEditDoc &doc, const char *formName, const char *userData, uint selId, uint slot);
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -165,7 +165,7 @@ class CActionBuffer : public IAction
|
|||
public:
|
||||
|
||||
// Constructor
|
||||
CActionBuffer (IAction::TTypeAction type, const uint8 *buffer, uint bufferSize, CGeorgesEditDoc &doc, const std::string &formName, const std::string &userData, uint selId, uint slot);
|
||||
CActionBuffer (IAction::TTypeAction type, const uint8 *buffer, uint bufferSize, CGeorgesEditDoc &doc, const char *formName, const char *userData, uint selId, uint slot);
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -182,4 +182,5 @@ protected:
|
|||
virtual bool doAction (CGeorgesEditDoc &doc, bool redo, bool &modified, bool firstTime);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif /* GEORGES_EDIT_ACTION_H */
|
||||
|
||||
|
|
|
@ -230,7 +230,7 @@ BOOL CBaseDialog::PreTranslateMessage(MSG* pMsg)
|
|||
return CDialog::PreTranslateMessage(pMsg);
|
||||
}
|
||||
|
||||
void CBaseDialog::setEditTextMultiLine (CEdit &edit, const std::string &text)
|
||||
void CBaseDialog::setEditTextMultiLine (CEdit &edit, const char *text)
|
||||
{
|
||||
edit.SetWindowText (utf8ToTStr(NLMISC::addSlashR(text)));
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ public:
|
|||
void registerLastControl ();
|
||||
void unRegisterLastControl ();
|
||||
|
||||
static void setEditTextMultiLine(CEdit &edit, const std::string &text);
|
||||
static void setEditTextMultiLine (CEdit &edit, const char *text);
|
||||
|
||||
virtual void onOpenSelected ();
|
||||
virtual void setFocusLastWidget ();
|
||||
|
|
|
@ -468,16 +468,16 @@ void CDfnDialog::onOpenSelected ()
|
|||
int nItem = Parents.ListCtrl.GetNextSelectedItem(pos);
|
||||
|
||||
// Get the string
|
||||
std::string str = tStrToUtf8(Parents.ListCtrl.GetItemText (nItem, 0));
|
||||
if (!str.empty())
|
||||
CString str = Parents.ListCtrl.GetItemText (nItem, 0);
|
||||
if (str != "")
|
||||
{
|
||||
// Look for the file
|
||||
string name = CPath::lookup (str, false, false);
|
||||
if (name.empty ())
|
||||
CString name = utf8ToTStr(CPath::lookup(tStrToUtf8(str), false, false));
|
||||
if (name.IsEmpty())
|
||||
name = str;
|
||||
|
||||
// Open the file
|
||||
theApp.OpenDocumentFile (utf8ToTStr(name));
|
||||
theApp.OpenDocumentFile(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -490,16 +490,16 @@ void CDfnDialog::onOpenSelected ()
|
|||
int nItem = Struct.ListCtrl.GetNextSelectedItem(pos);
|
||||
|
||||
// Get the string
|
||||
std::string str = tStrToUtf8(Struct.ListCtrl.GetItemText (nItem, 2));
|
||||
if (!str.empty())
|
||||
CString str = Struct.ListCtrl.GetItemText (nItem, 2);
|
||||
if (str != "")
|
||||
{
|
||||
// Look for the file
|
||||
string name = CPath::lookup (str, false, false);
|
||||
if (name.empty ())
|
||||
CString name = utf8ToTStr(CPath::lookup(tStrToUtf8(str), false, false));
|
||||
if (name.IsEmpty())
|
||||
name = str;
|
||||
|
||||
// Open the file
|
||||
theApp.OpenDocumentFile (utf8ToTStr(name));
|
||||
theApp.OpenDocumentFile(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -548,7 +548,7 @@ void CFormDialog::setToDocument (uint widget)
|
|||
bool parentVDfnArray;
|
||||
CForm *form=doc->getFormPtr ();
|
||||
CFormElm *elm = doc->getRootNode (Widgets[widget]->getSlot ());
|
||||
nlverify ( elm->getNodeByName (Widgets[widget]->getFormName (), &parentDfn, indexDfn,
|
||||
nlverify ( elm->getNodeByName (Widgets[widget]->getFormName ().c_str (), &parentDfn, indexDfn,
|
||||
&nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) );
|
||||
|
||||
// Must create array or virtual dfn ?
|
||||
|
@ -811,7 +811,7 @@ BOOL CFormDialog::OnCommand(WPARAM wParam, LPARAM lParam)
|
|||
bool parentVDfnArray;
|
||||
CForm *form=doc->getFormPtr ();
|
||||
CFormElm *elm = doc->getRootNode (Widgets[widgetId]->getSlot ());
|
||||
nlverify ( elm->getNodeByName (Widgets[widgetId]->getFormName (), &parentDfn, indexDfn,
|
||||
nlverify ( elm->getNodeByName (Widgets[widgetId]->getFormName ().c_str (), &parentDfn, indexDfn,
|
||||
&nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) );
|
||||
nlassert (parentDfn);
|
||||
|
||||
|
@ -832,7 +832,7 @@ BOOL CFormDialog::OnCommand(WPARAM wParam, LPARAM lParam)
|
|||
smprintf (filter, 512, "%s Files (%s)|%s|All Files(*.*)|*.*|", typeName+i, ext.c_str(), ext.c_str());
|
||||
|
||||
// Open the dialog
|
||||
CFileDialog dlgFile (TRUE, ext.c_str (), ext.c_str (), OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, filter, theApp.m_pMainWnd);
|
||||
CFileDialog dlgFile(TRUE, utf8ToTStr(ext), utf8ToTStr(ext), OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, utf8ToTStr(filter), theApp.m_pMainWnd);
|
||||
if (dlgFile.DoModal () == IDOK)
|
||||
{
|
||||
combo->Combo.UpdateData ();
|
||||
|
@ -850,7 +850,7 @@ BOOL CFormDialog::OnCommand(WPARAM wParam, LPARAM lParam)
|
|||
if (colorEdit && IsWindow (colorEdit->Color))
|
||||
{
|
||||
colorEdit->Empty = true;
|
||||
colorEdit->Edit.SetWindowText("");
|
||||
colorEdit->Edit.SetWindowText(_T(""));
|
||||
setToDocument (getWidget (wParam));
|
||||
updateValues ();
|
||||
}
|
||||
|
@ -926,7 +926,7 @@ BOOL CFormDialog::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
|
|||
CString str;
|
||||
combo->Combo.UpdateData ();
|
||||
combo->Combo.GetWindowText (str);
|
||||
if (sscanf (str, "%f", &value) == 1)
|
||||
if (_stscanf (str, _T("%f"), &value) == 1)
|
||||
{
|
||||
CGeorgesEditDoc *doc = View->GetDocument();
|
||||
if (doc)
|
||||
|
@ -1173,7 +1173,7 @@ void CFormDialog::getDfnName (string &result) const
|
|||
{
|
||||
// Get the DFN filename
|
||||
CString str = doc->GetPathName();
|
||||
result NLMISC::CFile::getExtension(tStrToUtf8(str));
|
||||
result = NLMISC::CFile::getExtension(tStrToUtf8(str));
|
||||
}
|
||||
else
|
||||
result.clear();
|
||||
|
@ -1316,16 +1316,16 @@ void IFormWidget::updateLabel ()
|
|||
switch (where)
|
||||
{
|
||||
case UFormElm::ValueForm:
|
||||
Label.SetWindowText ((SavedLabel+comp).c_str());
|
||||
Label.SetWindowText(utf8ToTStr(SavedLabel + comp));
|
||||
break;
|
||||
case UFormElm::ValueParentForm:
|
||||
Label.SetWindowText ((SavedLabel+" (in parent form)"+comp).c_str());
|
||||
Label.SetWindowText(utf8ToTStr(SavedLabel + " (in parent form)" + comp));
|
||||
break;
|
||||
case UFormElm::ValueDefaultDfn:
|
||||
Label.SetWindowText ((SavedLabel+" (default DFN value)"+comp).c_str());
|
||||
Label.SetWindowText(utf8ToTStr(SavedLabel + " (default DFN value)" + comp));
|
||||
break;
|
||||
case UFormElm::ValueDefaultType:
|
||||
Label.SetWindowText ((SavedLabel+" (default TYPE value)"+comp).c_str());
|
||||
Label.SetWindowText(utf8ToTStr(SavedLabel + " (default TYPE value)" + comp));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1569,7 +1569,7 @@ void CFormMemCombo::create (DWORD wStyle, RECT ¤tPos, CFormDialog *parent,
|
|||
|
||||
// Create the type combo
|
||||
parent->setStaticSize (currentPos);
|
||||
Label.Create (label, WS_VISIBLE, currentPos, parent);
|
||||
Label.Create (utf8ToTStr(label), WS_VISIBLE, currentPos, parent);
|
||||
parent->initWidget (Label);
|
||||
parent->getNextPosLabel (currentPos);
|
||||
|
||||
|
@ -1603,7 +1603,7 @@ void CFormMemCombo::create (DWORD wStyle, RECT ¤tPos, CFormDialog *parent,
|
|||
RECT spinPos = currentPos;
|
||||
parent->getNextBrowsePos (spinPos);
|
||||
parent->setBrowseSize (spinPos);
|
||||
Browse.Create ("...", WS_CHILD|WS_VISIBLE|WS_TABSTOP, spinPos, parent, dialog_index+1);
|
||||
Browse.Create (_T("..."), WS_CHILD|WS_VISIBLE|WS_TABSTOP, spinPos, parent, dialog_index+1);
|
||||
parent->initWidget (Browse);
|
||||
parent->getNextPos (currentPos);
|
||||
|
||||
|
@ -1675,7 +1675,7 @@ void CFormMemCombo::getValue (std::string &result)
|
|||
Combo.UpdateData (FALSE);
|
||||
|
||||
// Set the atom value
|
||||
result = (const char*)str;
|
||||
result = tStrToUtf8(str);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
@ -1720,7 +1720,7 @@ void CFormMemCombo::getFromDocument (CForm &form)
|
|||
CFormElmArray *arrayNode = safe_cast<CFormElmArray*> (node);
|
||||
char label[512];
|
||||
smprintf (label, 512, "%d", arrayNode->Elements.size ());
|
||||
Combo.SetWindowText (label);
|
||||
Combo.SetWindowText (utf8ToTStr(label));
|
||||
|
||||
if (arrayNode->getForm () == &form)
|
||||
Label.SetWindowText (_T("Array size:"));
|
||||
|
@ -1903,7 +1903,7 @@ void CFormCombo::create (DWORD wStyle, RECT ¤tPos, CFormDialog *parent, ui
|
|||
|
||||
// Create the type combo
|
||||
parent->setStaticSize (currentPos);
|
||||
Label.Create (label, WS_VISIBLE, currentPos, parent);
|
||||
Label.Create (utf8ToTStr(label), WS_VISIBLE, currentPos, parent);
|
||||
parent->initWidget (Label);
|
||||
parent->getNextPosLabel (currentPos);
|
||||
|
||||
|
@ -1918,10 +1918,10 @@ void CFormCombo::create (DWORD wStyle, RECT ¤tPos, CFormDialog *parent, ui
|
|||
// Get predefs
|
||||
if (nodeType)
|
||||
{
|
||||
Combo.InsertString (0, "");
|
||||
Combo.InsertString (0, _T(""));
|
||||
for (uint predef=0; predef<nodeType->Definitions.size(); predef++)
|
||||
{
|
||||
Combo.InsertString (predef+1, nodeType->Definitions[predef].Label.c_str());
|
||||
Combo.InsertString (predef+1, utf8ToTStr(nodeType->Definitions[predef].Label));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1973,7 +1973,7 @@ void CFormCombo::getValue (std::string &result)
|
|||
Combo.UpdateData (FALSE);
|
||||
|
||||
// Set the atom value
|
||||
result = (const char*)str;
|
||||
result = tStrToUtf8(str);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
@ -2088,13 +2088,13 @@ void CFormBigEdit::create (DWORD wStyle, RECT ¤tPos, CFormDialog *parent,
|
|||
|
||||
// Create the type combo
|
||||
parent->setStaticSize (currentPos);
|
||||
Label.Create (label, WS_VISIBLE, currentPos, parent);
|
||||
Label.Create (utf8ToTStr(label), WS_VISIBLE, currentPos, parent);
|
||||
parent->initWidget (Label);
|
||||
parent->getNextPosLabel (currentPos);
|
||||
|
||||
// Create the mem combobox
|
||||
parent->setBigEditSize (currentPos, parent->SmallWidget);
|
||||
Edit.CreateEx (WS_EX_CLIENTEDGE, _T("EDIT"), "", WS_VSCROLL|ES_OEMCONVERT|ES_MULTILINE|ES_WANTRETURN|WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|ES_AUTOVSCROLL, currentPos, parent, dialog_index);
|
||||
Edit.CreateEx (WS_EX_CLIENTEDGE, _T("EDIT"), _T(""), WS_VSCROLL|ES_OEMCONVERT|ES_MULTILINE|ES_WANTRETURN|WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|ES_AUTOVSCROLL, currentPos, parent, dialog_index);
|
||||
parent->initWidget (Edit);
|
||||
parent->getNextPos (currentPos);
|
||||
|
||||
|
@ -2146,7 +2146,7 @@ void CFormBigEdit::getValue (std::string &result)
|
|||
Edit.UpdateData (FALSE);
|
||||
|
||||
// Set the atom value
|
||||
result = (const char*)str;
|
||||
result = tStrToUtf8(str);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
@ -2262,7 +2262,7 @@ void CColorEdit::create (DWORD wStyle, RECT ¤tPos, CFormDialog *parent, ui
|
|||
|
||||
// Create the type combo
|
||||
parent->setStaticSize (currentPos);
|
||||
Label.Create (label, WS_VISIBLE, currentPos, parent);
|
||||
Label.Create (utf8ToTStr(label), WS_VISIBLE, currentPos, parent);
|
||||
parent->initWidget (Label);
|
||||
parent->getNextPosLabel (currentPos);
|
||||
|
||||
|
@ -2275,13 +2275,13 @@ void CColorEdit::create (DWORD wStyle, RECT ¤tPos, CFormDialog *parent, ui
|
|||
RECT resetPos = currentPos;
|
||||
parent->getNextColorPos (resetPos);
|
||||
parent->setResetColorSize (resetPos);
|
||||
Reset.Create ("Reset", WS_CHILD|WS_VISIBLE|WS_TABSTOP, resetPos, parent, dialog_index+1);
|
||||
Reset.Create (_T("Reset"), WS_CHILD|WS_VISIBLE|WS_TABSTOP, resetPos, parent, dialog_index+1);
|
||||
parent->initWidget (Reset);
|
||||
parent->getNextPosLabel (currentPos);
|
||||
|
||||
// Create the Edit
|
||||
parent->setBigEditSize (currentPos, parent->SmallWidget);
|
||||
Edit.CreateEx (WS_EX_CLIENTEDGE, _T("EDIT"), "", ES_OEMCONVERT|ES_WANTRETURN|WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL, currentPos, parent, dialog_index+2);
|
||||
Edit.CreateEx (WS_EX_CLIENTEDGE, _T("EDIT"), _T(""), ES_OEMCONVERT|ES_WANTRETURN|WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL, currentPos, parent, dialog_index+2);
|
||||
parent->initWidget (Edit);
|
||||
parent->getNextPos (currentPos);
|
||||
|
||||
|
@ -2492,7 +2492,7 @@ void CListWidget::create (DWORD wStyle, RECT ¤tPos, CFormDialog *parent, u
|
|||
|
||||
// Create the type combo
|
||||
parent->setStaticSize (currentPos);
|
||||
Label.Create (label, WS_VISIBLE, currentPos, parent);
|
||||
Label.Create (utf8ToTStr(label), WS_VISIBLE, currentPos, parent);
|
||||
parent->initWidget (Label);
|
||||
parent->getNextPosLabel (currentPos);
|
||||
|
||||
|
@ -2504,7 +2504,7 @@ void CListWidget::create (DWORD wStyle, RECT ¤tPos, CFormDialog *parent, u
|
|||
|
||||
// Create the assign parent
|
||||
parent->setButtonSize (currentPos, parent->SmallWidget);
|
||||
Button.Create ("Assign parents", WS_CHILD|WS_VISIBLE|WS_TABSTOP, currentPos, parent, dialog_index+1);
|
||||
Button.Create (_T("Assign parents"), WS_CHILD|WS_VISIBLE|WS_TABSTOP, currentPos, parent, dialog_index+1);
|
||||
parent->initWidget (Button);
|
||||
parent->getNextPos (currentPos);
|
||||
|
||||
|
@ -2515,7 +2515,7 @@ void CListWidget::create (DWORD wStyle, RECT ¤tPos, CFormDialog *parent, u
|
|||
|
||||
void CListWidget::addColumn (const char *name)
|
||||
{
|
||||
ListCtrl.insertColumn (0, name);
|
||||
ListCtrl.insertColumn (0, utf8ToTStr(name));
|
||||
ListCtrl.recalcColumn ();
|
||||
}
|
||||
|
||||
|
@ -2566,7 +2566,7 @@ void CListWidget::getFromDocument (NLGEORGES::CForm &form)
|
|||
string filename = form.getParentFilename (parent);
|
||||
|
||||
// Insert in the list
|
||||
ListCtrl.ListCtrl.InsertItem (parent, filename.c_str ());
|
||||
ListCtrl.ListCtrl.InsertItem (parent, utf8ToTStr(filename));
|
||||
|
||||
ListCtrl.ListCtrl.UpdateData (FALSE);
|
||||
updateLabel ();
|
||||
|
@ -2585,7 +2585,7 @@ uint CListWidget::getNumValue ()
|
|||
void CListWidget::getValue (std::string &result, uint value)
|
||||
{
|
||||
CString str = ListCtrl.ListCtrl.GetItemText (value, 0);
|
||||
result = str;
|
||||
result = tStrToUtf8(str);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
@ -2709,12 +2709,12 @@ void CListWidget::onOpenSelected ()
|
|||
if (str != "")
|
||||
{
|
||||
// Look for the file
|
||||
string name = CPath::lookup ((const char*)str, false, false);
|
||||
if (name.empty ())
|
||||
CString name = utf8ToTStr(CPath::lookup(tStrToUtf8(str), false, false));
|
||||
if (name.IsEmpty())
|
||||
name = str;
|
||||
|
||||
// Open the file
|
||||
theApp.OpenDocumentFile (name.c_str ());
|
||||
theApp.OpenDocumentFile(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2750,7 +2750,7 @@ void CIconWidget::create (DWORD wStyle, RECT ¤tPos, CFormDialog *parent, u
|
|||
|
||||
// Create the type combo
|
||||
parent->setStaticSize (currentPos);
|
||||
Label.Create (label, WS_VISIBLE, currentPos, parent);
|
||||
Label.Create (utf8ToTStr(label), WS_VISIBLE, currentPos, parent);
|
||||
parent->initWidget (Label);
|
||||
parent->getNextPosLabel (currentPos);
|
||||
|
||||
|
|
|
@ -1025,7 +1025,7 @@ void CGeorgesEditApp::OnUpdateFileSaveAll(CCmdUI* pCmdUI)
|
|||
pCmdUI->Enable (getActiveDocument () != NULL);
|
||||
}
|
||||
|
||||
bool CGeorgesEditApp::SerialIntoMemStream (const std::string &formName, CGeorgesEditDoc *doc, uint slot, bool copyToClipboard)
|
||||
bool CGeorgesEditApp::SerialIntoMemStream (const char *formName, CGeorgesEditDoc *doc, uint slot, bool copyToClipboard)
|
||||
{
|
||||
// Ok, get the node
|
||||
const CFormDfn *parentDfn;
|
||||
|
@ -1228,7 +1228,7 @@ bool CGeorgesEditApp::FillMemStreamWithClipboard (const char *formName, CGeorges
|
|||
return false;
|
||||
}
|
||||
|
||||
bool CGeorgesEditApp::SerialFromMemStream (const std::string &formName, CGeorgesEditDoc *doc, uint slot)
|
||||
bool CGeorgesEditApp::SerialFromMemStream (const char *formName, CGeorgesEditDoc *doc, uint slot)
|
||||
{
|
||||
// The form pointer
|
||||
CForm *form = doc->getFormPtr ();
|
||||
|
|
|
@ -119,11 +119,11 @@ public:
|
|||
public:
|
||||
// Memory stream
|
||||
NLMISC::CMemStream MemStream;
|
||||
bool FillMemStreamWithClipboard (const std::string &formName, CGeorgesEditDoc *doc, uint slot);
|
||||
bool FillMemStreamWithClipboard (const char *formName, CGeorgesEditDoc *doc, uint slot);
|
||||
void FillMemStreamWithBuffer (const uint8 *buffer, uint size);
|
||||
|
||||
bool SerialIntoMemStream (const std::string &formName, CGeorgesEditDoc *doc, uint slot, bool copyToClipboard);
|
||||
bool SerialFromMemStream (const std::string &formName, CGeorgesEditDoc *doc, uint slot);
|
||||
bool SerialIntoMemStream (const char *formName, CGeorgesEditDoc *doc, uint slot, bool copyToClipboard);
|
||||
bool SerialFromMemStream (const char *formName, CGeorgesEditDoc *doc, uint slot);
|
||||
|
||||
// Init
|
||||
BOOL initInstance (int nCmdShow, bool exeStandalone, int x, int y, int cx, int cy);
|
||||
|
@ -136,7 +136,7 @@ public:
|
|||
|
||||
// From IEdit
|
||||
NLGEORGES::IEditDocument *getActiveDocument ();
|
||||
NLGEORGES::IEditDocument *createDocument (const std::string &dfnName, const std::string &pathName);
|
||||
NLGEORGES::IEditDocument *createDocument (const char *dfnName, const char *pathName);
|
||||
virtual void getSearchPath (std::string &searchPath);
|
||||
virtual NLMISC::CConfigFile &getConfigFile() { return ConfigFile; }
|
||||
|
||||
|
@ -153,10 +153,10 @@ public:
|
|||
CImageListEx ImageList;
|
||||
|
||||
// Get a template form
|
||||
CMultiDocTemplate *getFormDocTemplate (const std::string &dfnName);
|
||||
CMultiDocTemplate *getFormDocTemplate (const char *dfnName);
|
||||
|
||||
void saveWindowState (const CWnd *wnd, const std::string &name, bool controlBar);
|
||||
void loadWindowState (CWnd *wnd, const std::string &name, bool changeShowWindow, bool controlBar);
|
||||
void saveWindowState (const CWnd *wnd, const char *name, bool controlBar);
|
||||
void loadWindowState (CWnd *wnd, const char *name, bool changeShowWindow, bool controlBar);
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
|
@ -176,8 +176,8 @@ public:
|
|||
void releasePlugins ();
|
||||
|
||||
// Dialog function
|
||||
void outputError (const std::string &message);
|
||||
bool yesNo (const std::string &message);
|
||||
void outputError (const char* message);
|
||||
bool yesNo (const char* message);
|
||||
bool getColor (NLMISC::CRGBA &color);
|
||||
|
||||
// Browse an URL
|
||||
|
|
|
@ -460,7 +460,7 @@ void CMemoryComboBox::refreshStrings ()
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
void CMemoryComboBox::setRegisterAdress(const std::string ®isterAdress)
|
||||
void CMemoryComboBox::setRegisterAdress (const char *registerAdress)
|
||||
{
|
||||
RegisterAdress = registerAdress;
|
||||
refreshStrings ();
|
||||
|
@ -468,7 +468,7 @@ void CMemoryComboBox::setRegisterAdress(const std::string ®isterAdress)
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
void CMemoryComboBox::addCommand (const std::string &commandLabel, uint commandId)
|
||||
void CMemoryComboBox::addCommand (const char* commandLabel, uint commandId)
|
||||
{
|
||||
Commands.push_back (CCommand ());
|
||||
Commands[Commands.size()-1].Label = commandLabel;
|
||||
|
|
|
@ -48,9 +48,9 @@ public:
|
|||
void onCancel ();
|
||||
void create (DWORD style, const RECT &rect, CWnd *parent, UINT nId, const char *registerAdress, int memoryCount);
|
||||
void create (DWORD style, const RECT &rect, CWnd *parent, UINT nId);
|
||||
void setRegisterAdress(const std::string ®isterAdress);
|
||||
void setRegisterAdress (const char *registerAdress);
|
||||
void clearCommand ();
|
||||
void addCommand(const std::string &commandLabel, uint commandId);
|
||||
void addCommand (const char* commandLabel, uint commandId);
|
||||
void clearStaticStrings ();
|
||||
void addStaticStrings (const char* strings);
|
||||
uint getCommandCount () const;
|
||||
|
|
Loading…
Reference in a new issue