Exemplo n.º 1
0
//---------------------------------------------------------
bool		Open_Application(const wxChar *Reference, const wxChar *Mime_Extension)
{
	bool		bResult		= false;

	if( Reference && Reference[0] )
	{
		wxString	Extension;
		wxFileType	*pFileType;

		if( Mime_Extension && Mime_Extension[0] )
		{
			Extension	= Mime_Extension;
		}
		else
		{
			wxFileName	FileName(Reference);

			Extension	= FileName.GetExt();
		}

		if( Extension.Length() > 0 && (pFileType = wxTheMimeTypesManager->GetFileTypeFromExtension(Extension)) != NULL )
		{
			wxString	Command;

			if( pFileType->GetOpenCommand(&Command, wxFileType::MessageParameters(Reference, wxT(""))) )
			{
				MSG_Execution_Add_Line();
				MSG_Execution_Add(Command, true, true);

				bResult	= wxExecute(Command) == 0;
			}

			delete(pFileType);
		}
	}

	return( bResult );
}
Exemplo n.º 2
0
//---------------------------------------------------------
int		Callback(TSG_UI_Callback_ID ID, CSG_UI_Parameter &Param_1, CSG_UI_Parameter &Param_2)
{
	int		Result, *iArray;

	Result	= 1;

	//-----------------------------------------------------
	switch( ID )
	{
	default:

		Result	= 0;

		break;


	///////////////////////////////////////////////////////
	//                                                   //
	//                                                   //
	//                                                   //
	///////////////////////////////////////////////////////

	//-----------------------------------------------------
	case CALLBACK_PROCESS_GET_OKAY:

		Result	= PROCESS_Get_Okay(Param_1.True);

		break;


	//-----------------------------------------------------
	case CALLBACK_PROCESS_SET_OKAY:

		Result	= PROCESS_Set_Okay(Param_1.True);

		break;


	//-----------------------------------------------------
	case CALLBACK_PROCESS_SET_PROGRESS:

		Result	= PROGRESSBAR_Set_Position(Param_1.Number, Param_2.Number);

		break;

	//-----------------------------------------------------
	case CALLBACK_PROCESS_SET_READY:

		STATUSBAR_Set_Text(_TL("ready"));

		Result	= PROGRESSBAR_Set_Position(0);

		break;


	//-----------------------------------------------------
	case CALLBACK_PROCESS_SET_TEXT:

		STATUSBAR_Set_Text(Param_1.String.c_str());

		break;


	///////////////////////////////////////////////////////
	//                                                   //
	//                                                   //
	//                                                   //
	///////////////////////////////////////////////////////

	//-----------------------------------------------------
	case CALLBACK_STOP_EXECUTION:

		if( g_pModule && g_pModule->is_Executing() )
		{
			Result	= g_pModule->Execute(Param_1.True) ? 1 : 0;
		}
		else if( g_pModule && g_pModule->is_Interactive() )
		{
			Result	= g_pModule->Execute(Param_1.True) ? 1 : 0;
		}

		break;


	///////////////////////////////////////////////////////
	//                                                   //
	//                                                   //
	//                                                   //
	///////////////////////////////////////////////////////

	//-----------------------------------------------------
	case CALLBACK_MESSAGE_ADD:

		iArray	= (int *)Param_2.Pointer;

		MSG_General_Add		(Param_1.String.c_str(), iArray[0] != 0, iArray[0] != 0, (TSG_UI_MSG_STYLE)iArray[1]);

		break;


	//-----------------------------------------------------
	case CALLBACK_MESSAGE_ADD_ERROR:

		MSG_Error_Add		(Param_1.String.c_str(), true);

		break;


	//-----------------------------------------------------
	case CALLBACK_MESSAGE_ADD_EXECUTION:

		iArray	= (int *)Param_2.Pointer;

		MSG_Execution_Add	(Param_1.String.c_str(), iArray[0] != 0, iArray[0] != 0, (TSG_UI_MSG_STYLE)iArray[1]);

		break;


	///////////////////////////////////////////////////////
	//                                                   //
	//                                                   //
	//                                                   //
	///////////////////////////////////////////////////////

	//-----------------------------------------------------
	case CALLBACK_DLG_MESSAGE:

		DLG_Message_Show(Param_1.String.c_str(), Param_2.String.c_str());

		break;


	//-----------------------------------------------------
	case CALLBACK_DLG_CONTINUE:

		Result	= DLG_Message_Confirm(Param_1.String.c_str(), Param_2.String.c_str());

		break;


	//-----------------------------------------------------
	case CALLBACK_DLG_ERROR:

		Result	= DLG_Message_Show_Error(Param_1.String.c_str(), Param_2.String.c_str());

		break;


	///////////////////////////////////////////////////////
	//                                                   //
	//                                                   //
	//                                                   //
	///////////////////////////////////////////////////////

	//-----------------------------------------------------
	case CALLBACK_DLG_PARAMETERS:

		Result	= DLG_Parameters((CSG_Parameters *)Param_1.Pointer, Param_2.String.c_str()) ? 1 : 0;

		break;


	///////////////////////////////////////////////////////
	//                                                   //
	//                                                   //
	//                                                   //
	///////////////////////////////////////////////////////

	//-----------------------------------------------------
	case CALLBACK_DATAOBJECT_ADD:

		Result	= g_pData->Add((CSG_Data_Object *)Param_1.Pointer) ? 1 : 0;

		if( Result && Param_2.True )
		{
			g_pData->Show((CSG_Data_Object *)Param_1.Pointer, false);
		}

		break;


	//-----------------------------------------------------
	case CALLBACK_DATAOBJECT_UPDATE:

		Result	= g_pData->Update((CSG_Data_Object *)Param_1.Pointer, (CSG_Parameters *)Param_2.Pointer) ? 1 : 0;

		break;


	//-----------------------------------------------------
	case CALLBACK_DATAOBJECT_SHOW:

		Result	= g_pData->Show((CSG_Data_Object *)Param_1.Pointer, (int)Param_2.Number) ? 1 : 0;

		break;


	//-----------------------------------------------------
	case CALLBACK_DATAOBJECT_ASIMAGE:

		Result	= g_pData->asImage((CSG_Data_Object *)Param_1.Pointer, (CSG_Grid *)Param_2.Pointer) ? 1 : 0;

		break;


	//-----------------------------------------------------
	case CALLBACK_DATAOBJECT_COLORS_GET:

		Result	= g_pData->Get_Colors((CSG_Data_Object *)Param_1.Pointer, (CSG_Colors *)Param_2.Pointer) ? 1 : 0;

		break;


	//-----------------------------------------------------
	case CALLBACK_DATAOBJECT_COLORS_SET:

		Result	= g_pData->Set_Colors((CSG_Data_Object *)Param_1.Pointer, (CSG_Colors *)Param_2.Pointer) ? 1 : 0;

		break;


	//-----------------------------------------------------
	case CALLBACK_DATAOBJECT_PARAMS_GET:

		Result	= g_pData->Get_Parameters((CSG_Data_Object *)Param_1.Pointer, (CSG_Parameters *)Param_2.Pointer) ? 1 : 0;

		break;


	//-----------------------------------------------------
	case CALLBACK_DATAOBJECT_PARAMS_SET:

		Result	= g_pData->Set_Parameters((CSG_Data_Object *)Param_1.Pointer, (CSG_Parameters *)Param_2.Pointer) ? 1 : 0;

		break;


	//-----------------------------------------------------
	case CALLBACK_ODBC_UPDATE:

		Result	= g_pData_Source->Update_ODBC_Source(Param_1.String.c_str()) ? 1 : 0;

		break;


	///////////////////////////////////////////////////////
	//                                                   //
	//                                                   //
	//                                                   //
	///////////////////////////////////////////////////////

	//-----------------------------------------------------
	case CALLBACK_GUI_GET_WINDOW:

		Param_1.Pointer	= MDI_Get_Frame();

		break;


	///////////////////////////////////////////////////////
	//                                                   //
	//                                                   //
	//                                                   //
	///////////////////////////////////////////////////////

	//-----------------------------------------------------
	}

	return( Result );
}