#include "orimpexptool_tool.h"
#define ORTOOLIMPORTEXPORT__CLASS ORTOOLIMPORTEXPORT__CLASSNAME
#define ORTOOLIMPORTEXPORT__LABEL "Import/Export"
#define ORTOOLIMPORTEXPORT__DESC "OR - Import/Export Description"
ORTOOLIMPORTEXPORT__LABEL,
ORTOOLIMPORTEXPORT__DESC,
bool ORToolImportExport::FBCreate()
{
UICreate ();
UIConfigure ();
return true;
}
void ORToolImportExport::FBDestroy()
{
}
void ORToolImportExport::UICreate()
{
int lW = 200;
int lS = 5;
int lH = 25;
AddRegion ( "LabelImport", "LabelImport",
AddRegion ("ButtonBrowse", "ButtonBrowse",
AddRegion ("ButtonImportScene", "ButtonImportScene",
AddRegion ("ButtonImportOptical", "ButtonImportOptical",
AddRegion ("ButtonImportAnimation", "ButtonImportAnimation",
AddRegion ("LabelExport", "LabelExport",
AddRegion ("ButtonExportSelected", "ButtonExportSelected",
AddRegion ("ButtonExportVoice", "ButtonExportVoice",
SetControl("LabelImport", mLabelImport );
SetControl("LabelExport", mLabelExport );
SetControl("ButtonBrowse", mButtonBrowse );
SetControl("ButtonImportScene", mButtonImportScene );
SetControl("ButtonImportOptical", mButtonImportOptical );
SetControl("ButtonImportAnimation", mButtonImportAnimation );
SetControl("ButtonExportSelected", mButtonExportSelected );
SetControl("ButtonExportVoice", mButtonExportVoice );
}
void ORToolImportExport::UIConfigure()
{
mLabelImport.Caption = "Importing";
mLabelExport.Caption = "Exporting";
mButtonBrowse.Caption = "Browse File...";
mButtonImportScene.Caption = "Import Scene";
mButtonImportOptical.Caption = "Import Optical";
mButtonImportAnimation.Caption = "Import Animation on Selected";
mButtonExportSelected.Caption = "Export Selected Model and Animation...";
mButtonExportVoice.Caption = "Export Voice...";
mButtonBrowse.OnClick.Add (
this,(
FBCallback)&ORToolImportExport::EventButtonBrowseClick );
mButtonImportScene.OnClick.Add (
this,(
FBCallback)&ORToolImportExport::EventButtonImportSceneClick );
mButtonImportOptical.OnClick.Add (
this,(
FBCallback)&ORToolImportExport::EventButtonImportOpticalClick );
mButtonImportAnimation.OnClick.Add (
this,(
FBCallback)&ORToolImportExport::EventButtonImportAnimationClick );
mButtonExportSelected.OnClick.Add (
this,(
FBCallback)&ORToolImportExport::EventButtonExportSelectedClick );
mButtonExportVoice.OnClick.Add (
this,(
FBCallback)&ORToolImportExport::EventButtonExportVoiceClick );
}
{
FBFilePopup lFilePopup;
lFilePopup.Path = "C:\\";
lFilePopup.Filter = "*.txt";
if( lFilePopup.Execute() )
{
mEngine.ImportFile( lFilePopup.FullFilename.AsString() );
}
}
{
mEngine.ImportScene();
}
{
mEngine.ImportAnimation();
}
{
mEngine.ImportOptical();
}
{
FBFilePopup FilePopup;
FilePopup.Path = "C:\\";
FilePopup.Filter = "*.txt";
if( FilePopup.Execute() )
{
mEngine.ExportSelected( FilePopup.FullFilename.AsString() );
}
}
{
FBFilePopup FilePopup;
FilePopup.Path = "C:\\";
FilePopup.Filter = "voice_export.txt";
if( FilePopup.Execute() )
{
mEngine.ExportVoice( FilePopup.FullFilename.AsString() );
}
}