- unit UMiFContenedor; 
-   
- interface 
-   
- uses 
-   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs; 
-   // Variants, 
-   
-   type 
-     TModel =(FormMensaje,FormEditor); 
-     TTypeAcc = (IInfo,IOk,IError,Iquestion,INone); 
-     TIConBand = (SInfo,SError,SQuestion,SCheck,SNone); 
-     TIconMensaje = (MError,MQuestion,MInfo,MNone); 
-   
- //----{LA BANDA}------------------------------------------------------------------------ 
-     TBand = class (Tpersistent)        //La banda 
-     private 
-          FBanda					:Boolean;    //Mostrar banda con icono 
-          FTextBand      :string;     //Texto a mostrar en la banda 
-          FColorBand     :TColor;		 //Color De La banda 
-          FIconBand  		:TIConBand;  //Iconop de la banda 
-          FFontSize  		:Integer;  	 //Tamaño de la Fuente 
-          FFontColor  		:TColor;     //Color de la fuente de la banda 
-          FFontName  		:TFontName;  //Nombre de la fuente de la banda 
-   
-          procedure setFontName  (const Value:TFontName); 
-          procedure setBanda			(const Value:Boolean); 
-          procedure setTextBand	(const Value:string); 
-          procedure setColorBand	(const Value:TColor); 
-          procedure setIconBand  (const Value:TIConBand); 
-          procedure setFontSize  (const Value:Integer); 
-          procedure setFontColor (const Value:TColor); 
-     published 
-         property  Banda			:Boolean      read FBanda          write setBanda 	 		default True; 
-         property  TextBand	:string       read FTextBand       write setTextBand; 
-         property  ColorBand :TColor       read FColorBand      write setColorBand 	default clBtnFace; 
-         property  IconBand 	:TIConBand		read FIconBand			 write SetIconBand    default SNone; 
-         property  FontSize  :Integer			read FFontSize		 	 write SetFontSize    default 12; 
-         property  FontColor :TColor				read FFontColor			 write SetFontColor   default clBlack; 
-         property  FontName 	:TFontName		read FFontName			 write SetFontName;  							    //Nombre de la fuente de la banda 
-     end; 
- //----{DESCUENTO}---------------------------------------------------------------------- 
-     TDescuento = class (Tpersistent)        //Cuenta atras 
-     private 
-          FCuentaAtras   :Boolean;    //Realiza una cuenta atraz 
-          FTimeCuenta    :Integer;    //Numero de segundos para la cuanta atraz 
-          procedure setCuentaAtras		(const Value:Boolean); 
-          procedure setTimeCuenta		(const Value:Integer); 
-     published 
-         property  CuentaAtras :Boolean      read FCuentaAtras    write setCuentaAtras 	 		default True; 
-         property  TimeCuenta  :Integer      read FTimeCuenta     write setTimeCuenta        default 30; 
-     end; 
- //----{EL COMPONENTE}------------------------------------------------------------------- 
-     TMiFContenedor = class(TComponent) 
-     private 
-          FBand					:TBand;      		//Llamamos a la colection de la banda 
-          FDescuento			:TDescuento; 		//Llamamos a la coleccion Descuento 
-          FTitulo				:string;     		//Titulo de la barra del Form 
-          FMensaje 	    :string;     		//Texto a mostrar 
-          FIcono  				:TIconMensaje;  //Icono a mostrar 
-          FSound					:Boolean;    		//Hacer sonar al mostrar 
-          FModel         :TModel;      	//Modelo del Form a llamar 
-          FTypeAcc       :TTypeAcc;    	//Determina parametros como icono, sonido color 
-          FColor         :TColor;      	//Color para partes no banda 
-          FMentFontColor :TColor;  			//Color de la fuente del Mensaje 
-          FMEnFontSize  	:Integer;  			//Tamaño de la fuente 
-          FMenFontNegrita:Boolean;  			//Usar la Fuente del mensaje en negrita 
-          FMenFontName   :TFontName;  	  //Fuente a usar 
-   
-          procedure setMenFontName		(const Value:TFontName); 
-          procedure setMenFontNegrita(const Value:Boolean); 
-          procedure setMenFontSize		(const Value:Integer); 
-          procedure setMentFontColor	(const Value:TColor); 
-          procedure setTitulo				(const Value:string); 
-          procedure setMensaje 			(const Value:string); 
-          procedure setIcono					(const Value:TIconMensaje); 
-          procedure setSound					(const Value:Boolean); 
-          procedure setModel 				(const Value:TModel); 
-          procedure setTypeAcc  			(const Value:TTypeAcc); 
-          procedure SetColor     		(const Value:TColor); 
-     protected 
-     public 
-         constructor Create(AOwner:TComponent);override; 
-         procedure Execute; 
-         destructor    Destroy; override; 
-     published 
-         property  Titulo				:string   	   	read FTitulo        	write setTitulo; 
-         property  Mensaje				:string     	 	read FMensaje 	     	write setMensaje; 
-         property  Icono 	 	  	:TIconMensaje		read FIcono						write SetIcono					default MNone; 
-         property  Sound 				:Boolean      	read FSound      			write setSound					default False; 
-         property  Model					:TModel      		read FModel         	write setModel     			default FormMensaje; 
-         property  TypeAcc				:TTypeAcc    		read FTypeAcc 				write setTypeAcc  			default INone; 
-         property  Color    	 		:TColor      		read FColor     	    write SetColor      		default clBtnFace; 
-         property  Banda    	 		:TBand       		read FBand        	  write FBand;                            //Sin esta no se ve 
-         property  Descuento	 		:TDescuento  		read FDescuento    		write FDescuento; 
-         property  MentFontColor :TColor					read FMentFontColor		write SetMentFontColor  default clBlack; 
-         property  MenFontSize  	:Integer				read FMEnFontSize		 	write setMenFontSize    default 10; 
-         property  MenFontNegrita:Boolean				read FMenFontNegrita	write SetMenFontNegrita default False; 
-         property  MenFontName 	:TFontName			read FMenFontName			write SetMenFontName; 
-   end; 
-   
- implementation 
-   
- uses UFMensaje,		//Tipo Showmesaage 
-      UEditor;			//Editor con teclado para memos 
-   
- constructor TMiFContenedor.Create(AOwner: TComponent); 
-   
- begin 
-    inherited Create(Aowner); 
-    FBand				:=TBand.Create; 
-    with FBand do 
-    begin 
-       FBanda						  :=True; 
-       FTextBand 					:=''; 
-       FColorBand				  :=clBtnFace; 
-       FIconBand 					:=SNone; 
-       FFontColor     			:=$00CC3300; 
-       FFontName    			  :='Arial'; 
-       FFontSize    			  :=12; 
-    end; 
-    FDescuento		:=TDescuento.Create; 
-    with FDescuento do 
-    begin 
-       FCuentaAtras				:=True; 
-       FTimeCuenta					:=30; 
-    end; 
-    FTitulo				:='Tirulo'; 
-    FMensaje				:='Mensaje'; 
-    FIcono     	  :=MNone; 
-    FSound					:=False; 
-    FModel  	  	  :=FormMensaje; 
-    FTypeAcc				:=INone; 
-    FColor       	:=clBtnFace; 
-    FMEnFontSize 	:=10; 
-    FMentFontColor	:=clBlack; 
-    FMenFontNegrita:=False; 
-    FMenFontName		:='Arial'; 
-   
- end; 
-   
- destructor TMiFContenedor.Destroy; 
- //------------------------------------------------------------------------------ 
- //**************************************************************[ DESTRUOY ]**** 
- //  Se encarga de liberar la memoria 
- //------------------------------------------------------------------------------ 
- begin 
-   FBand.Free; 
-   FDescuento.Free; 
- end; 
-   
- procedure TMiFContenedor.Execute;   //------------------------------------------------[Inicio Execute]---- 
- //------------------------------------------------------------------------------ 
- //***************************************************************[ EXECUTE ]**** 
- //  Llama segun el Model 
- //------------------------------------------------------------------------------ 
- var VarIIcon,VariiconMen:Integer; 
- begin 
-    case FTypeAcc of 
-      IInfo:begin 
-               FBand.ColorBand:=$003399FF; 
-               FBand.FontColor:=$00CC6600; 
-               VarIIcon:=2; 
-            end; 
-      IOk  :begin 
-               FBand.ColorBand:=clGreen; 
-               FBand.FontColor:=$00FF7FFF; 
-               VarIIcon:=4; 
-            end; 
-      IError:begin 
-               FBand.ColorBand:=clRed; 
-               FBand.FontColor:=clAqua; 
-               VarIIcon:=1; 
-            end; 
-   
-      Iquestion:begin 
-               FBand.ColorBand:=clNavy; 
-               FBand.FontColor:=$007FFFFF; 
-               VarIIcon:=3; 
-            end; 
-      INone:begin 
-               FBand.FontColor:=$FFFFFFF0; 
-               VarIIcon:=0; 
-            end; 
-    end; 
-    case FIcono  of 
-        MError:VariiconMen:=1; 
-        MQuestion:VariiconMen:=3; 
-        MInfo:VariiconMen:=2; 
-        MNone:VariiconMen:=0; 
-    end; 
-    case FModel of 
-      FormMensaje:begin      //Para tipo Showmmesage 
-      							FFormensaje:=TFFormensaje.Create(Application); 
-                   try 
-                       //  FTTitux,FTMenx,FTBanx:string; 
-                     FFormensaje.Fbandx:=FBand.FBanda; 
-                     FFormensaje.FColorPX:=FBand.FColorBand; 
-                     FFormensaje.FTBanx:=FBand.FTextBand; 
-                     FFormensaje.FIconBx:=VarIIcon; 
-                     FFormensaje.Panel1.Font.Size:=FBand.FFontSize; 
-                     FFormensaje.Panel1.Font.Color:=FBand.FFontColor; 
-                     FFormensaje.Panel1.Font.Name:=FBand.FFontName; 
-                     FFormensaje.Panel1.Font.Style:=[fsBold]; 
-                     FFormensaje.FtimerX:=FDescuento.FCuentaAtras; 
-                     FFormensaje.FIntervalx:=FDescuento.FTimeCuenta*1000; 
-                     FFormensaje.FTMenx:=FMensaje; 
-                     FFormensaje.FTTitux:=FTitulo; 
-                     FFormensaje.FColorX:=FColor; 
-                     FFormensaje.FIconMx:=VariiconMen; 
-                     FFormensaje.FSoundx:=FSound; 
-                     FFormensaje.Memo1.Font.Name:=FMenFontName; 
-                     FFormensaje.Memo1.Font.Color:=FMentFontColor; 
-                     FFormensaje.Memo1.Font.Size:=FMEnFontSize; 
-                     if FMenFontNegrita then FFormensaje.Memo1.Font.Style:=[fsBold] 
-                                        else FFormensaje.Memo1.Font.Style:=[]; 
-                     FFormensaje.Iniciar; 
-                     Fformensaje.ShowModal; 
-                   finally 
-                     Fformensaje.Free; 
-                   end; 
-      					end; 
-        FormEditor:begin 
-                     FEditor:=TFEditor.Create(Application); 
-                  	  try 
-                       FEditor.Memo1.Font.Name:=FMenFontName; 
-                       FEditor.Memo1.Font.Color:=FMentFontColor; 
-                       FEditor.Memo1.Font.Size:=FMEnFontSize; 
-                       if FMenFontNegrita then FEditor.Memo1.Font.Style:=[fsBold] 
-                                          else FEditor.Memo1.Font.Style:=[]; 
-                       FEditor.VarStextOriginal:=FMEnsaje; 
-                       FEditor.Memo1.Lines.text:=FMensaje; 
-                       FEditor.showmodal 
-   
-                    	finally 
-                       FMENSAJE:=FEditor.Memo1.Lines.text; 
-                    	  FEditor.Free; 
-                     end; 
- 	                end; 
-   
-    end; 
-   
- end;                                //------------------------------------------------[Fin Execute]------- 
-   
- procedure TMiFContenedor.SetColor(const Value: TColor); 
- //------------------------------------------------------------------------------ 
- //*****************************************************************[ Color ]**** 
- //  Color general del Form 
- //------------------------------------------------------------------------------ 
- begin 
-    if FColor<>value then FColor:=Value; 
- end; 
-   
- procedure TMiFContenedor.SetIcono(const Value: TIconMensaje); 
- //------------------------------------------------------------------------------ 
- //*****************************************************************[ ICONO ]**** 
- // Icono del Mensaje 
- //------------------------------------------------------------------------------ 
- begin 
-    if FIcono<>value then FIcono:=Value; 
- End; 
-   
-   
- procedure TMiFContenedor.setMensaje(const Value: string); 
- //------------------------------------------------------------------------------ 
- //***************************************************************[ Mensaje ]**** 
- //  Texto general del Cuerpo 
- //------------------------------------------------------------------------------ 
- begin 
-    if FMensaje<>value then FMensaje:=Value; 
- end; 
-   
- procedure TMiFContenedor.setModel(const Value: TModel); 
- //------------------------------------------------------------------------------ 
- //*****************************************************************[ MODEL ]**** 
- //  Los diferentes tipos de mensajes a mandar 
- //------------------------------------------------------------------------------ 
- begin 
-    if FModel<>value then FModel:=Value; 
- end; 
-   
- procedure TMiFContenedor.setSound(const Value: Boolean); 
- //------------------------------------------------------------------------------ 
- //*****************************************************************[ Sound ]**** 
- // Mandar sonido al mostrar el form (ojo si TypeAcc <>Inone, los carde windows) 
- //------------------------------------------------------------------------------ 
- begin 
-    if FSound<>value then FSound:=Value; 
- end; 
-   
- procedure TMiFContenedor.setTitulo(const Value: string); 
- //------------------------------------------------------------------------------ 
- //****************************************************************[ Titulo ]**** 
- // Texto que aparece en el Caption del Form si lo tiene 
- //------------------------------------------------------------------------------ 
- begin 
-    if FTitulo<>value then FTitulo:=Value; 
- end; 
-   
- procedure TMiFContenedor.setTypeAcc(const Value: TTypeAcc); 
- //------------------------------------------------------------------------------ 
- //***************************************************************[ TypeAcc ]**** 
- //  Carga valores como color, sonido, Texto de la banda e icono, según acción seleccionada 
- //------------------------------------------------------------------------------ 
- begin 
-    if FTypeAcc<>value then FTypeAcc:=Value; 
- end; 
-   
- procedure TMiFContenedor.SetMenFontSize(const Value: Integer); 
- //------------------------------------------------------------------------------ 
- //***********************************************************[ MENFONTSIZE ]**** 
- // Tamaño de la fuente del Mensaje 
- //------------------------------------------------------------------------------ 
- begin 
-    if FMenFontSize<>value then FMenFontSize:=Value; 
- End; 
-   
- procedure TMiFContenedor.SetMentFontColor(const Value: TColor); 
- //------------------------------------------------------------------------------ 
- //*********************************************************[ MENTFONTCOLOR ]**** 
- // Color de la fuente del Mensaje 
- //------------------------------------------------------------------------------ 
- begin 
-    if FMentFontColor<>value then FMentFontColor:=Value; 
- End; 
-   
- procedure TMiFContenedor.SetMenFontNegrita(const Value: Boolean); 
- //------------------------------------------------------------------------------ 
- //********************************************************[ MENFONTNEGRITA ]**** 
- // Usar la Fuente del mensaje en negrita 
- //------------------------------------------------------------------------------ 
- begin 
-    if FMenFontNegrita<>value then FMenFontNegrita:=Value; 
- End; 
-   
- procedure TMiFContenedor.SetMenFontName(const Value: TFontName); 
- //------------------------------------------------------------------------------ 
- //***********************************************************[ MENFONTNAME ]**** 
- // Fuente a usar 
- //------------------------------------------------------------------------------ 
- begin 
-    if FMenFontName<>value then FMenFontName:=Value; 
- End; 
-   
-   
- //La banda------------------------------------------------------------------------------------------------ 
- procedure TBand.setBanda(const Value: Boolean); 
- //------------------------------------------------------------------------------ 
- //*****************************************************************[ Banda ]**** 
- //  Muestrar la banda y lo que conlleba 
- //------------------------------------------------------------------------------ 
- begin 
-    if FBanda<>value then FBanda:=Value; 
- end; 
-   
-   
- procedure TBand.setColorBand(const Value: TColor); 
- //------------------------------------------------------------------------------ 
- //*************************************************************[ ColorBand ]**** 
- //  Color de la banda, cambia según TypeAcc 
- //------------------------------------------------------------------------------ 
- begin 
-    if FColorBand<>value then FColorBand:=Value; 
- end; 
-   
- procedure TBand.SetFontSize(const Value: Integer); 
- //------------------------------------------------------------------------------ 
- //**************************************************************[ FONTSIZE ]**** 
- // Tamaño de la fuente en la banda 
- //------------------------------------------------------------------------------ 
- begin 
-    if FFontSize<>value then FFontSize:=Value; 
- End; 
-   
- procedure TBand.SetFontColor(const Value: TColor); 
- //------------------------------------------------------------------------------ 
- //*************************************************************[ FONTCOLOR ]**** 
- // Color de la fuente de la banda 
- //------------------------------------------------------------------------------ 
- begin 
-    if FFontColor<>value then FFontColor:=Value; 
- End; 
-   
- procedure TBand.SetFontName(const Value: TFontName); 
- //------------------------------------------------------------------------------ 
- //**************************************************************[ FONTNAME ]**** 
- // Nombre de la fuente de la banda 
- //------------------------------------------------------------------------------ 
- begin 
-    if FFontName<>value then FFontName:=Value; 
- End; 
-   
-   
- procedure TBand.SetIconBand(const Value: TIConBand); 
- //------------------------------------------------------------------------------ 
- //**************************************************************[ ICONBAND ]**** 
- // iconos de uso en la banda 
- //------------------------------------------------------------------------------ 
- begin 
-    if FIconBand<>value then FIconBand:=Value; 
- End; 
-   
- procedure TBand.setTextBand(const Value: string); 
- //------------------------------------------------------------------------------ 
- //**************************************************************[ TextBand ]**** 
- // texto de la banda, cambia según TypeAcc 
- //------------------------------------------------------------------------------ 
- begin 
-    if FTextBand<>value then FTextBand:=Value; 
- end; 
-   
- //Descuento ------------------------------------------------------------------------------- 
- procedure TDescuento.setCuentaAtras(const Value: Boolean); 
- //------------------------------------------------------------------------------ 
- //***********************************************************[ CuentaAtras ]**** 
- // Muestra o No la cuenta atras 
- //------------------------------------------------------------------------------ 
- begin 
-    if FCuentaAtras<>value then FCuentaAtras:=Value; 
- end; 
-   
- procedure TDescuento.setTimeCuenta(const Value: Integer); 
- //------------------------------------------------------------------------------ 
- //************************************************************[ TimeCuenta ]**** 
- // Número de segundo de cuenta atras 
- //------------------------------------------------------------------------------ 
- begin 
-    if FTimeCuenta<>value then FTimeCuenta:=Value; 
- end; 
-   
- end.