Ejemplo n.º 1
0
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("");
}
Ejemplo n.º 2
0
void EditorUI::menuMappingExportUV ()
{
    const char *fn=FileChooser("Save merged model for UV mapping:", FileChooserPattern, filename.c_str(),true);

    if(fn) {
        model->ExportUVMesh (fn);
    }
}
Ejemplo n.º 3
0
void EditorUI::menuFileLoad()
{
    const char *fn=FileChooser("Load model file:", FileChooserPattern, filename.c_str(),false);

    if(fn) {
        Load (fn);
        UpdateTitle();
    }
}
Ejemplo n.º 4
0
void EditorUI::menuFileSaveAs()
{
    const char *fn=FileChooser("Save model file:", FileChooserPattern, filename.c_str(),true);

    if(fn) {
        filename=fn;
        Model::Save(model,fn);
        UpdateTitle();
    }
}
Ejemplo n.º 5
0
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);
    }
}
Ejemplo n.º 6
0
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;
    }
}
Ejemplo n.º 7
0
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;
    }
}
Ejemplo n.º 8
0
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);
        }
    }
}
Ejemplo n.º 9
0
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 ();
    }
}
Ejemplo n.º 10
0
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;
    }
}
Ejemplo n.º 11
0
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);
}