diff --git a/Source/Templates/NetCore/GtkSharp.Template.CSharp/GtkSharp.Template.CSharp.nuspec b/Source/Templates/NetCore/GtkSharp.Template.CSharp/GtkSharp.Template.CSharp.nuspec index d7993ef42..b89373e98 100755 --- a/Source/Templates/NetCore/GtkSharp.Template.CSharp/GtkSharp.Template.CSharp.nuspec +++ b/Source/Templates/NetCore/GtkSharp.Template.CSharp/GtkSharp.Template.CSharp.nuspec @@ -3,7 +3,7 @@ GtkSharp.Template.CSharp 3.0.0 - Gtk template for CSharp + Gtk templates for CSharp A set of C# templates for your .Net Core Gtk Application. A set of C# templates for your .Net Core Gtk Application. GtkSharp Contributors @@ -11,7 +11,7 @@ https://github.com/GtkSharp/GtkSharp false - gtk gtksharp gtk-sharp app dotnet new template + gtk gtksharp gtk-sharp app dotnet new template c# csharp diff --git a/Source/Templates/NetCore/GtkSharp.Template.CSharp/content/GtkSharp.Application.CSharp/MainWindow.cs b/Source/Templates/NetCore/GtkSharp.Template.CSharp/content/GtkSharp.Application.CSharp/MainWindow.cs index 48fdfde76..e8f74a988 100755 --- a/Source/Templates/NetCore/GtkSharp.Template.CSharp/content/GtkSharp.Application.CSharp/MainWindow.cs +++ b/Source/Templates/NetCore/GtkSharp.Template.CSharp/content/GtkSharp.Application.CSharp/MainWindow.cs @@ -19,11 +19,11 @@ namespace GtkNamespace { builder.Autoconnect(this); - DeleteEvent += OnDeleteEvent; + DeleteEvent += Window_DeleteEvent; _button1.Clicked += Button1_Clicked; } - private void OnDeleteEvent(object sender, DeleteEventArgs a) + private void Window_DeleteEvent(object sender, DeleteEventArgs a) { Application.Quit(); } diff --git a/Source/Templates/NetCore/GtkSharp.Template.CSharp/content/GtkSharp.Dialog.CSharp/Gtk_Dialog.cs b/Source/Templates/NetCore/GtkSharp.Template.CSharp/content/GtkSharp.Dialog.CSharp/Gtk_Dialog.cs index 7d0fcd7e7..e4133f658 100755 --- a/Source/Templates/NetCore/GtkSharp.Template.CSharp/content/GtkSharp.Dialog.CSharp/Gtk_Dialog.cs +++ b/Source/Templates/NetCore/GtkSharp.Template.CSharp/content/GtkSharp.Dialog.CSharp/Gtk_Dialog.cs @@ -10,12 +10,13 @@ namespace GtkNamespace private Gtk_Dialog(Builder builder) : base(builder.GetObject("Gtk_Dialog").Handle) { + builder.Autoconnect(this); DefaultResponse = ResponseType.Cancel; - Response += OnResponse; + Response += Dialog_Response; } - private void OnResponse(object o, ResponseArgs args) + private void Dialog_Response(object o, ResponseArgs args) { Hide(); } diff --git a/Source/Templates/NetCore/GtkSharp.Template.CSharp/content/GtkSharp.Widget.CSharp/Gtk_Widget.cs b/Source/Templates/NetCore/GtkSharp.Template.CSharp/content/GtkSharp.Widget.CSharp/Gtk_Widget.cs index e64f3eb33..ca4edd24e 100755 --- a/Source/Templates/NetCore/GtkSharp.Template.CSharp/content/GtkSharp.Widget.CSharp/Gtk_Widget.cs +++ b/Source/Templates/NetCore/GtkSharp.Template.CSharp/content/GtkSharp.Widget.CSharp/Gtk_Widget.cs @@ -10,7 +10,7 @@ namespace GtkNamespace private Gtk_Widget(Builder builder) : base(builder.GetObject("Gtk_Widget").Handle) { - + builder.Autoconnect(this); } } } diff --git a/Source/Templates/NetCore/GtkSharp.Template.CSharp/content/GtkSharp.Window.CSharp/Gtk_Window.cs b/Source/Templates/NetCore/GtkSharp.Template.CSharp/content/GtkSharp.Window.CSharp/Gtk_Window.cs index 95a6ba5ac..e4b68797f 100755 --- a/Source/Templates/NetCore/GtkSharp.Template.CSharp/content/GtkSharp.Window.CSharp/Gtk_Window.cs +++ b/Source/Templates/NetCore/GtkSharp.Template.CSharp/content/GtkSharp.Window.CSharp/Gtk_Window.cs @@ -11,13 +11,6 @@ namespace GtkNamespace private Gtk_Window(Builder builder) : base(builder.GetObject("Gtk_Window").Handle) { builder.Autoconnect(this); - - DeleteEvent += OnDeleteEvent; - } - - private void OnDeleteEvent(object sender, DeleteEventArgs a) - { - Application.Quit(); } } } diff --git a/Source/Templates/NetCore/GtkSharp.Template.VBNet/GtkSharp.Template.VBNet.nuspec b/Source/Templates/NetCore/GtkSharp.Template.VBNet/GtkSharp.Template.VBNet.nuspec new file mode 100755 index 000000000..a1147b128 --- /dev/null +++ b/Source/Templates/NetCore/GtkSharp.Template.VBNet/GtkSharp.Template.VBNet.nuspec @@ -0,0 +1,19 @@ + + + + GtkSharp.Template.VBNet + 3.0.0 + Gtk templates for VBNet + A set of VB templates for your .Net Core Gtk Application. + A set of VB templates for your .Net Core Gtk Application. + GtkSharp Contributors + GtkSharp Contributors + https://github.com/GtkSharp/GtkSharp + false + + gtk gtksharp gtk-sharp app dotnet new template vbnet vb + + + + + \ No newline at end of file diff --git a/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Application.VBNet/.template.config/template.json b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Application.VBNet/.template.config/template.json new file mode 100755 index 000000000..8528df087 --- /dev/null +++ b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Application.VBNet/.template.config/template.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "GtkSharp Contributors", + "classifications": [ + "Gtk", + "GUI App" + ], + "name": "Gtk Application", + "identity": "GtkSharp.Application.VBNet", + "groupIdentity": "GtkSharp.Application", + "shortName": "gtkapp", + "tags": { + "language": "VB", + "type": "project" + }, + "sourceName": "GtkNamespace", + "preferNameDirectory": true +} \ No newline at end of file diff --git a/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Application.VBNet/GtkNamespace.vbproj b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Application.VBNet/GtkNamespace.vbproj new file mode 100755 index 000000000..0db25f31a --- /dev/null +++ b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Application.VBNet/GtkNamespace.vbproj @@ -0,0 +1,14 @@ + + + Exe + netcoreapp2.0 + + + + %(Filename)%(Extension) + + + + + + diff --git a/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Application.VBNet/MainWindow.glade b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Application.VBNet/MainWindow.glade new file mode 100755 index 000000000..a13c41b20 --- /dev/null +++ b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Application.VBNet/MainWindow.glade @@ -0,0 +1,46 @@ + + + + + False + Example Window + 480 + 240 + + + True + False + 4 + 4 + 4 + 4 + vertical + + + True + False + Hello World! + + + True + True + 0 + + + + + Click me! + True + False + True + + + False + True + 1 + + + + + + diff --git a/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Application.VBNet/MainWindow.vb b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Application.VBNet/MainWindow.vb new file mode 100755 index 000000000..f47a06021 --- /dev/null +++ b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Application.VBNet/MainWindow.vb @@ -0,0 +1,37 @@ +Imports System +Imports Gtk +Imports UI = Gtk.Builder.ObjectAttribute + +Namespace GtkNamespace + Public Class MainWindow + Inherits Window + + Private _counter = 0 + Private _label1 As Label + Private _button1 As Button + + Public Sub New (builder as Builder) + MyBase.New(builder.GetObject("MainWindow").Handle) + + builder.Autoconnect (Me) + + AddHandler MyBase.DeleteEvent, AddressOf Window_Delete + AddHandler _button1.Clicked, AddressOf Button1_Clicked + End Sub + + Public Sub New () + Me.New(new Builder("MainWindow.glade")) + End Sub + + Private Sub Window_Delete (ByVal sender As Object, ByVal a As DeleteEventArgs) + Application.Quit () + a.RetVal = true + End Sub + + Private Sub Button1_Clicked (ByVal sender As Object, ByVal a As EventArgs) + _counter += 1 + _label1.Text = "Hello World! This button has been clicked " + _counter.ToString() + " time(s)." + End Sub + + End Class +End Namespace diff --git a/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Application.VBNet/Program.vb b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Application.VBNet/Program.vb new file mode 100755 index 000000000..627f2b08a --- /dev/null +++ b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Application.VBNet/Program.vb @@ -0,0 +1,21 @@ +Imports System +Imports Gtk + +Namespace GtkNamespace + Public Class MainClass + + Public Shared Sub Main () + Application.Init () + + Dim app as new Application ("org.GtkNamespace.GtkNamespace", GLib.ApplicationFlags.None) + app.Register (GLib.Cancellable.Current) + + Dim win as new MainWindow () + app.AddWindow (win) + + win.Show () + Application.Run () + End Sub + + End Class +End Namespace diff --git a/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Dialog.VBNet/.template.config/template.json b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Dialog.VBNet/.template.config/template.json new file mode 100755 index 000000000..1adf4a1c0 --- /dev/null +++ b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Dialog.VBNet/.template.config/template.json @@ -0,0 +1,32 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "GtkSharp Contributors", + "classifications": [ + "Gtk", + "UI" + ], + "name": "Gtk Dialog", + "identity": "GtkSharp.Dialog.VBNet", + "groupIdentity": "GtkSharp.Dialog", + "shortName": "gtkdialog", + "tags": { + "language": "VB" + }, + "sourceName": "Gtk_Dialog", + "primaryOutputs": [ + { + "path": "Gtk_Dialog.vb" + }, + { + "path": "Gtk_Dialog.glade" + } + ], + "defaultName": "Gtk_Dialog", + "symbols": { + "namespace": { + "description": "Namespace for the generated files", + "replaces": "GtkNamespace", + "type": "parameter" + } + } +} \ No newline at end of file diff --git a/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Dialog.VBNet/Gtk_Dialog.glade b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Dialog.VBNet/Gtk_Dialog.glade new file mode 100755 index 000000000..8cc7c549a --- /dev/null +++ b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Dialog.VBNet/Gtk_Dialog.glade @@ -0,0 +1,51 @@ + + + + + False + 320 + 260 + dialog + + + False + vertical + 2 + + + False + end + + + + + + gtk-close + True + True + True + True + + + True + True + 1 + + + + + False + False + 0 + + + + + + + + + button1 + + + diff --git a/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Dialog.VBNet/Gtk_Dialog.vb b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Dialog.VBNet/Gtk_Dialog.vb new file mode 100755 index 000000000..05640a7fc --- /dev/null +++ b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Dialog.VBNet/Gtk_Dialog.vb @@ -0,0 +1,27 @@ +Imports System +Imports Gtk +Imports UI = Gtk.Builder.ObjectAttribute + +Namespace GtkNamespace + Public Class Gtk_Dialog + Inherits Dialog + + Public Sub New (builder as Builder) + MyBase.New (builder.GetObject("Gtk_Dialog").Handle) + + builder.Autoconnect (Me) + DefaultResponse = ResponseType.Cancel + + AddHandler MyBase.Response, AddressOf Dialog_OnResponse + End Sub + + Public Sub New () + Me.New (new Builder ("Gtk_Dialog.glade")) + End Sub + + Private Sub Dialog_OnResponse (ByVal sender As Object, ByVal args As ResponseArgs) + Hide () + End Sub + + End Class +End Namespace diff --git a/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Widget.VBNet/.template.config/template.json b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Widget.VBNet/.template.config/template.json new file mode 100755 index 000000000..995aa9aff --- /dev/null +++ b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Widget.VBNet/.template.config/template.json @@ -0,0 +1,32 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "GtkSharp Contributors", + "classifications": [ + "Gtk", + "UI" + ], + "name": "Gtk Widget", + "identity": "GtkSharp.Widget.VBNet", + "groupIdentity": "GtkSharp.Widget", + "shortName": "gtkwidget", + "tags": { + "language": "VB" + }, + "sourceName": "Gtk_Widget", + "primaryOutputs": [ + { + "path": "Gtk_Widget.vb" + }, + { + "path": "Gtk_Widget.glade" + } + ], + "defaultName": "Gtk_Widget", + "symbols": { + "namespace": { + "description": "Namespace for the generated files", + "replaces": "GtkNamespace", + "type": "parameter" + } + } +} \ No newline at end of file diff --git a/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Widget.VBNet/Gtk_Widget.glade b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Widget.VBNet/Gtk_Widget.glade new file mode 100755 index 000000000..7a1be14d1 --- /dev/null +++ b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Widget.VBNet/Gtk_Widget.glade @@ -0,0 +1,11 @@ + + + + + True + False + + + + + diff --git a/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Widget.VBNet/Gtk_Widget.vb b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Widget.VBNet/Gtk_Widget.vb new file mode 100755 index 000000000..49c8ba38c --- /dev/null +++ b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Widget.VBNet/Gtk_Widget.vb @@ -0,0 +1,20 @@ +Imports System +Imports Gtk +Imports UI = Gtk.Builder.ObjectAttribute + +Namespace GtkNamespace + Public Class Gtk_Widget + Inherits Box + + Public Sub New (builder as Builder) + MyBase.New (builder.GetObject("Gtk_Widget").Handle) + + builder.Autoconnect (Me) + End Sub + + Public Sub New () + Me.New (new Builder("Gtk_Widget.glade")) + End Sub + + End Class +End Namespace diff --git a/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Window.VBNet/.template.config/template.json b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Window.VBNet/.template.config/template.json new file mode 100755 index 000000000..e9e9aacea --- /dev/null +++ b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Window.VBNet/.template.config/template.json @@ -0,0 +1,32 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "GtkSharp Contributors", + "classifications": [ + "Gtk", + "UI" + ], + "name": "Gtk Window", + "identity": "GtkSharp.Window.VBNet", + "groupIdentity": "GtkSharp.Window", + "shortName": "gtkwindow", + "tags": { + "language": "VB" + }, + "sourceName": "Gtk_Window", + "primaryOutputs": [ + { + "path": "Gtk_Window.vb" + }, + { + "path": "Gtk_Window.glade" + } + ], + "defaultName": "Gtk_Window", + "symbols": { + "namespace": { + "description": "Namespace for the generated files", + "replaces": "GtkNamespace", + "type": "parameter" + } + } +} \ No newline at end of file diff --git a/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Window.VBNet/Gtk_Window.glade b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Window.VBNet/Gtk_Window.glade new file mode 100755 index 000000000..44e554e80 --- /dev/null +++ b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Window.VBNet/Gtk_Window.glade @@ -0,0 +1,11 @@ + + + + + False + Gtk_Window + + + + + diff --git a/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Window.VBNet/Gtk_Window.vb b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Window.VBNet/Gtk_Window.vb new file mode 100755 index 000000000..aaa3a2d5d --- /dev/null +++ b/Source/Templates/NetCore/GtkSharp.Template.VBNet/content/GtkSharp.Window.VBNet/Gtk_Window.vb @@ -0,0 +1,20 @@ +Imports System +Imports Gtk +Imports UI = Gtk.Builder.ObjectAttribute + +Namespace GtkNamespace + Public Class Gtk_Window + Inherits Window + + Public Sub New (builder as Builder) + MyBase.New (builder.GetObject("Gtk_Window").Handle) + + builder.Autoconnect (Me) + End Sub + + Public Sub New () + Me.New (new Builder ("Gtk_Window.glade")) + End Sub + + End Class +End Namespace diff --git a/build.cake b/build.cake index 41ae54ed5..3238869b3 100755 --- a/build.cake +++ b/build.cake @@ -123,6 +123,7 @@ Task("PackageTemplates") }; NuGetPack("Source/Templates/NetCore/GtkSharp.Template.CSharp/GtkSharp.Template.CSharp.nuspec", settings); + NuGetPack("Source/Templates/NetCore/GtkSharp.Template.VBNet/GtkSharp.Template.VBNet.nuspec", settings); }); // TASK TARGETS