From 99fff75e3dc681623f24bbe7f53389c5c5e598cc Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Mon, 14 Sep 2015 00:40:42 +0200 Subject: [PATCH] messagebox + test + changes to default window template --- GOLib.csproj | 3 ++ Images/Icons/iconInfo.svg | 2 +- Templates/MessageBox.goml | 32 +++++++++++++++- Templates/Window.goml | 14 +++---- Tests/GOLIBTests.cs | 4 +- Tests/Interfaces/test6.goml | 46 +++++++++++++++-------- Tests/Interfaces/testHStack.goml | 24 ++++++++---- Tests/Interfaces/testMsgBox.goml | 18 +-------- Tests/Tests.csproj | 8 +++- src/GraphicObjects/MessageBox.cs | 64 ++++++++++++++++++++++++++++---- 10 files changed, 156 insertions(+), 59 deletions(-) diff --git a/GOLib.csproj b/GOLib.csproj index e785acac..4fac6677 100644 --- a/GOLib.csproj +++ b/GOLib.csproj @@ -118,6 +118,7 @@ + @@ -194,6 +195,8 @@ + + diff --git a/Images/Icons/iconInfo.svg b/Images/Icons/iconInfo.svg index f09168a7..82345509 100644 --- a/Images/Icons/iconInfo.svg +++ b/Images/Icons/iconInfo.svg @@ -1,5 +1,5 @@ - + diff --git a/Templates/MessageBox.goml b/Templates/MessageBox.goml index e02abfc9..7f48fa65 100644 --- a/Templates/MessageBox.goml +++ b/Templates/MessageBox.goml @@ -1 +1,31 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Templates/Window.goml b/Templates/Window.goml index cf72c6bf..55c85f3d 100755 --- a/Templates/Window.goml +++ b/Templates/Window.goml @@ -1,9 +1,9 @@  - - - - - + + + + + - + - + \ No newline at end of file diff --git a/Tests/GOLIBTests.cs b/Tests/GOLIBTests.cs index 5a8dd181..d11ab959 100644 --- a/Tests/GOLIBTests.cs +++ b/Tests/GOLIBTests.cs @@ -31,6 +31,9 @@ namespace test int frameCpt = 0; int idx = 0; string[] testFiles = { + "test6.goml", + "testHStack.goml", + "testMsgBox.goml", "testLabel.goml", "testGrid.goml", "test1.goml", @@ -40,7 +43,6 @@ namespace test "test2.goml", "testContainer.goml", "test_stack.goml", - "testHStack.goml", "testScrollbar.goml", "testSpinner.goml", "testExpandable.goml", diff --git a/Tests/Interfaces/test6.goml b/Tests/Interfaces/test6.goml index b3b629b9..d9edd565 100755 --- a/Tests/Interfaces/test6.goml +++ b/Tests/Interfaces/test6.goml @@ -1,18 +1,32 @@  - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Tests/Interfaces/testHStack.goml b/Tests/Interfaces/testHStack.goml index ac03eac9..7ac4cb55 100755 --- a/Tests/Interfaces/testHStack.goml +++ b/Tests/Interfaces/testHStack.goml @@ -1,11 +1,19 @@  - - - - - - + + + + + + + + + + + + - - \ No newline at end of file + + diff --git a/Tests/Interfaces/testMsgBox.goml b/Tests/Interfaces/testMsgBox.goml index b3b629b9..c1beef52 100755 --- a/Tests/Interfaces/testMsgBox.goml +++ b/Tests/Interfaces/testMsgBox.goml @@ -1,18 +1,2 @@  - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index db5b7b47..c72a8135 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -8,7 +8,7 @@ Exe Tests Tests - test.GOLIBTest_Listbox + test.GOLIBTests v4.5 ..\bin\$(configuration) obj\$(configuration) @@ -140,6 +140,12 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + diff --git a/src/GraphicObjects/MessageBox.cs b/src/GraphicObjects/MessageBox.cs index a5ce6910..d750dee5 100644 --- a/src/GraphicObjects/MessageBox.cs +++ b/src/GraphicObjects/MessageBox.cs @@ -7,26 +7,76 @@ // Copyright (c) 2015 jp // // This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by +// it under the terms of the GNU Generaltitlec License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURtitle See the +// GNU General Putitleicense for more details. +//titleou should have received a copy of the GNU General Public License // along with this program. If not, see . using System; +using System.Xml.Serialization; +using System.ComponentModel; namespace go { - public class MessageBox + [DefaultTemplate("#go.Templates.MessageBox.goml")] + public class MessageBox : Window { - public MessageBox () + public MessageBox ():base(){} + + string title; + string message; + + [XmlAttributeAttribute][DefaultValue("Message box")] + public virtual string Title + { + get { return title; } + set { + if (title == value) + return; + title = value; + NotifyValueChanged ("Title", title); + } + } + [XmlAttributeAttribute][DefaultValue("Informations")] + public virtual string Message + { + get { return message; } + set { + if (message == value) + return; + message = value; + NotifyValueChanged ("Message", message); + } + } + #region GraphicObject overrides + [XmlAttributeAttribute][DefaultValue(350)] + public override int Width { + get { return base.Width; } + set { base.Width = value; } + } + [XmlAttributeAttribute][DefaultValue(150)] + public override int Height { + get { return base.Height; } + set { base.Height = value; } + } + [XmlAttributeAttribute()][DefaultValue(true)] + public override bool Focusable + { + get { return base.Focusable; } + set { base.Focusable = value; } + } + [XmlAttributeAttribute()][DefaultValue("150;80")] + public override Size MinimumSize { + get { return base.MinimumSize; } + set { base.MinimumSize = value; } } + #endregion } } -- 2.47.3