void CWaterCheckDlg::OnCheckfile() { CFileDialog FileChooser(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "All files(*.*)|*.*||"); //choose file if (FileChooser.DoModal()==IDOK) { m_csFilePath = FileChooser.GetPathName() ; } GetDlgItem(IDC_EDIT_CHECKFILEPATH)->SetWindowText(m_csFilePath); if (m_csFilePath != "") { GetDlgItem(IDC_BUTTON_CHECK)->EnableWindow(TRUE); } else { GetDlgItem(IDC_BUTTON_CHECK)->EnableWindow(FALSE); } m_lCheckErrorNum = 0; m_WaterInfoList.DeleteAllItems(); GetDlgItem(IDC_EDIT_WATREMARK)->SetWindowText(""); }
void EditorUI::menuMappingExportUV () { const char *fn=FileChooser("Save merged model for UV mapping:", FileChooserPattern, filename.c_str(),true); if(fn) { model->ExportUVMesh (fn); } }
void EditorUI::menuFileLoad() { const char *fn=FileChooser("Load model file:", FileChooserPattern, filename.c_str(),false); if(fn) { Load (fn); UpdateTitle(); } }
void EditorUI::menuFileSaveAs() { const char *fn=FileChooser("Save model file:", FileChooserPattern, filename.c_str(),true); if(fn) { filename=fn; Model::Save(model,fn); UpdateTitle(); } }
void EditorUI::BrowseForTexture(int textureIndex) { const char *fn=FileChooser("Select texture:", 0, 0,false); if(fn) { Texture *tex = new Texture (fn); if (!tex->IsLoaded ()) { delete tex; } else SetModelTexture (textureIndex, tex); } }
void EditorUI::menuObjectSave() { MdlObject* sel = GetSingleSel(); if (!sel) return; const char *fn=FileChooser ("Save model file:", FileChooserPattern, sel->name.c_str(),true); if(fn) { Model *submdl = new Model; submdl->root = sel; Model::Save (submdl,fn); submdl->root = 0; delete submdl; } }
void EditorUI::menuObjectLoad() { MdlObject* obj = GetSingleSel(); if (!obj) return; const char *fn=FileChooser("Load model file:",FileChooserPattern, 0,false); if(fn) { Model* submdl = Model::Load(fn); if (submdl) model->InsertModel (obj, submdl); delete submdl; } }
void EditorUI::menuScriptLoad() { const char *pattern ="Lua script (LUA)\0*.lua\0"; static std::string lastLuaScript; const char *fn = FileChooser("Load script:", pattern, lastLuaScript.c_str(), false); if (fn) { lastLuaScript = fn; if (luaL_dofile(luaState, fn) != 0) { const char *err = lua_tostring(luaState, -1); fltk::message("Error while executing %s: %s", fn, err); } } }
void EditorUI::menuMappingImportUV () { const char *fn=FileChooser("Select model to copy UV coördinates from:", FileChooserPattern, filename.c_str(),false); if(fn) { IProgressCtl progctl; progctl.cb = EditorUIProgressCallback; progctl.data = this; progress->range (0.0f, 1.0f, 0.01f); progress->position (0.0f); progress->show (); model->ImportUVMesh (fn, progctl); progress->hide (); } }
void EditorUI::menuObjectReplace() { MdlObject* old = GetSingleSel(); if (!old) return; char buf[128]; sprintf (buf, "Select model to replace \'%s\' ", old->name.c_str()); const char *fn=FileChooser (buf, FileChooserPattern, 0,false); if(fn) { Model *submdl = new Model; if (submdl->Load (fn)) { model->ReplaceObject (old, submdl->root); submdl->root = 0; Update (); } delete submdl; } }
void CaptureSoundDlg::OnButtonSoundfile() { CFileDialog FileChooser(FALSE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "pcm files(*.pcm)|*.pcm||"); //choose file if (FileChooser.DoModal()==IDOK) { m_csSoundFile = FileChooser.GetPathName() ; } int iPos = m_csSoundFile.Find(".pcm"); if (iPos == -1) { m_csSoundFile += ".pcm"; } GetDlgItem(IDC_EDIT_SOUNDFILE)->SetWindowText(m_csSoundFile); }