Commit 197ddb57 authored by hybrid's avatar hybrid

Add example for new file open dialog feature.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3963 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 72e5d287
...@@ -130,7 +130,11 @@ public: ...@@ -130,7 +130,11 @@ public:
case GUI_ID_FILE_OPEN_BUTTON: case GUI_ID_FILE_OPEN_BUTTON:
Context.listbox->addItem(L"File open"); Context.listbox->addItem(L"File open");
env->addFileOpenDialog(L"Please choose a file."); // There are some options for the file open dialog
// We set the title, make it a modal window, and make sure
// that the working directory is restored after the dialog
// is finished.
env->addFileOpenDialog(L"Please choose a file.", true, 0, -1, true);
return true; return true;
default: default:
...@@ -138,6 +142,15 @@ public: ...@@ -138,6 +142,15 @@ public:
} }
break; break;
case EGET_FILE_SELECTED:
{
// show the model filename, selected in the file dialog
IGUIFileOpenDialog* dialog =
(IGUIFileOpenDialog*)event.GUIEvent.Caller;
Context.listbox->addItem(dialog->getFileName());
}
break;
default: default:
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment