mirror of
https://github.com/fltk/fltk.git
synced 2026-05-27 10:57:58 +08:00
Fixed error when browsing for a directory and using a non-ascii starting directory.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10207 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -441,7 +441,7 @@ int Fl_Native_File_Chooser::showfile() {
|
|||||||
int CALLBACK Fl_Native_File_Chooser::Dir_CB(HWND win, UINT msg, LPARAM param, LPARAM data) {
|
int CALLBACK Fl_Native_File_Chooser::Dir_CB(HWND win, UINT msg, LPARAM param, LPARAM data) {
|
||||||
switch (msg) {
|
switch (msg) {
|
||||||
case BFFM_INITIALIZED:
|
case BFFM_INITIALIZED:
|
||||||
if (data) ::SendMessage(win, BFFM_SETSELECTION, TRUE, data);
|
if (data) ::SendMessage(win, BFFM_SETSELECTIONW, TRUE, data);
|
||||||
break;
|
break;
|
||||||
case BFFM_SELCHANGED:
|
case BFFM_SELCHANGED:
|
||||||
TCHAR path[FNFC_MAX_PATH];
|
TCHAR path[FNFC_MAX_PATH];
|
||||||
@@ -518,10 +518,11 @@ int Fl_Native_File_Chooser::showdir() {
|
|||||||
_binf.pszDisplayName = displayname;
|
_binf.pszDisplayName = displayname;
|
||||||
|
|
||||||
// PRESET DIR
|
// PRESET DIR
|
||||||
char presetname[FNFC_MAX_PATH];
|
WCHAR presetname[FNFC_MAX_PATH];
|
||||||
if ( _directory ) {
|
if ( _directory ) {
|
||||||
strcpy(presetname, _directory);
|
|
||||||
// Unix2Win(presetname);
|
// Unix2Win(presetname);
|
||||||
|
wcsncpy(presetname, utf8towchar(_directory), FNFC_MAX_PATH);
|
||||||
|
presetname[FNFC_MAX_PATH-1] = 0;
|
||||||
_binf.lParam = (LPARAM)presetname;
|
_binf.lParam = (LPARAM)presetname;
|
||||||
}
|
}
|
||||||
else _binf.lParam = 0;
|
else _binf.lParam = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user