text stringlengths 0 234 |
|---|
Function Definition: procedure ejercicio1 is |
Function Body: s : String := "Comenzamos las prácticas de STR"; |
numero : Natural := 0; |
begin |
Put("Hola Mundo!!!"); |
Put_Line(s); |
pkg_ejercicio2c.OtroProcedimiento; |
-- Ejercicio 3 |
begin |
Put("Introduce un numero:"); |
Ada.Integer_Text_IO.Get(numero); |
case numero is |
when 12 | 1 | 2 => Put_Line("Invierno"); |
when 3 | 4 | 5 => Put_Line("Primavera"); |
when 6 | 7 | 8 => Put_Line("Verano"); |
when 9 | 10 | 11 => Put_Line("Otoño"); |
when others => Put_Line("Mes incorrecto"); |
end case; |
-- Ejercicio 5 |
exception |
when Constraint_Error => Put_Line("El numero de mes debe ser > 0"); |
Function Definition: procedure Simular_Sistema IS |
Function Body: BEGIN |
Gtk.Main.Main; |
END Simular_Sistema; |
------------------------------------------------------------------------ |
-- Procedure que se encarga de inicializar la interfaz gráfica |
------------------------------------------------------------------------ |
procedure Inicializar_Interfaz_Grafica is |
Win : Gtk_Window; |
Buffer : Gtk_Double_Buffer; |
Vbox, Hbox : Gtk_Box; |
Id : G_Source_Id;--Timeout_Handler_Id; |
Button : Gtk_Button; |
inbuilt_font : Pango.Font.Pango_Font_Description; |
--ventana : Gdk_Window; |
--TAM_BUTTON_EXIT : constant GLib.Gint := 20; |
alinea_button_exit: Gtk.Alignment.Gtk_Alignment; |
A_Check_Button1, A_Check_Button2 : Gtk_Check_Button; |
begin |
-- ventana principal |
Gtk.Window.Gtk_New (Win, Window_Toplevel); |
Set_Title (Win, "PRACTICA STR: CONTROL DE TRAFICO"); |
Win.Set_Default_Size(CANVAS_WIDTH, CANVAS_HEIGHT);--+TAM_BUTTON_EXIT); |
Void_Cb.Connect (Win, "destroy", Void_Cb.To_Marshaller (Quit'Access)); |
-- botón Exit |
Gtk_New (Button, "EXIT"); |
Destroyed.Object_Connect (Button, |
"clicked", |
Destroyed.To_Marshaller (Quit'Access), |
Slot_Object => Win); |
Button.Set_Size_Request(100, 20);--TAM_BUTTON_EXIT); |
Gtk.Alignment.Gtk_New(alinea_button_exit, 0.5, 0.5, 0.0, 0.0); |
alinea_button_exit.Add(Button); |
-- Double buffer |
Double_Buffer.Gtk_New(Buffer); |
Buffer.Set_Size_Request(CANVAS_WIDTH, CANVAS_HEIGHT);-- -TAM_BUTTON_EXIT); |
-- Botones para la generación de averías |
Gtk_New (A_Check_Button1, "Averia en Carril 1"); |
Widget_Handler.Object_Connect(A_Check_Button1, "clicked", |
Widget_Handler.To_Marshaller (Averia1_Generada'ACCESS), |
Slot_Object => Win); |
Gtk_New (A_Check_Button2, "Averia en Carril 2"); |
Widget_Handler.Object_Connect(A_Check_Button2, "clicked", |
Widget_Handler.To_Marshaller (Averia2_Generada'ACCESS), |
Slot_Object => Win); |
-- Asociar widgets a la ventana principal y mostrarla |
Gtk_New_Hbox (Hbox, Homogeneous => True, Spacing => 10); |
Gtk_New_Vbox (Vbox, Homogeneous => False, Spacing => 0); |
Pack_Start (Vbox, Buffer); |
--Pack_Start (Vbox, Button, Expand => False, Fill => False); |
Pack_Start (Vbox, alinea_button_exit);--, Expand => False, Fill => False); |
Pack_Start (Vbox, A_Check_Button1); |
Pack_Start (Vbox, A_Check_Button2); |
Pack_Start (Hbox, Vbox); |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 6