From: Jean-Philippe Bruyère Date: Tue, 2 Jun 2020 12:22:07 +0000 (+0200) Subject: add style as parameter to widget ctor X-Git-Tag: v0.9.5-beta~113^2~19 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=d24de9fd3ec73108802816e8d894ae25984df8ac;p=jp%2Fcrow.git add style as parameter to widget ctor --- diff --git a/Crow.sln b/Crow.sln index df52304f..933c8e32 100644 --- a/Crow.sln +++ b/Crow.sln @@ -12,7 +12,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Crow", "Crow\Crow.csproj", EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}" ProjectSection(SolutionItems) = preProject - Samples\Directory.Build.props = Samples\Directory.Build.props + Samples\Directory.Build.props = Samples\Directory.Build.props EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloWorld", "Samples\HelloWorld\HelloWorld.csproj", "{F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A}" diff --git a/Crow/Crow.csproj b/Crow/Crow.csproj index 587ca78c..49373244 100644 --- a/Crow/Crow.csproj +++ b/Crow/Crow.csproj @@ -25,14 +25,14 @@ True true $(NoWarn);1591;1587;1570;1572;1573;1574 - _DESIGN_MODE + DESIGN_MODE false false App.config full - DEBUG;TRACE;MEASURE_TIME;_DEBUG_DISPOSE;_DEBUG_BINDING;_DEBUG_CLIP_RECTANGLE;_DEBUG_FOCUS;DEBUG_DRAGNDROP;_DEBUG_LOG + $(DefineConstants);DEBUG;TRACE;MEASURE_TIME;_DEBUG_DISPOSE;_DEBUG_BINDING;_DEBUG_CLIP_RECTANGLE;_DEBUG_FOCUS;DEBUG_DRAGNDROP;_DEBUG_LOG true @@ -58,6 +58,7 @@ Crow.Cursors.%(Filename) + diff --git a/Crow/Default.style b/Crow/Default.style index 8c443443..9309503d 100644 --- a/Crow/Default.style +++ b/Crow/Default.style @@ -1,4 +1,11 @@ ControlBackground = "Transparent"; +ControlBorderColor = "DimGrey"; +ControlBorderWidth = "1"; +ControlCaptionColor = "LightGrey"; +ControlCaptionHoverColor = "White"; + +IconSize = "12"; +IconMargin = "1"; Button, CheckBox, RadioButton, ComboBox, Expandable, MessageBox, Popper, Slider, Spinner, TextBox { @@ -19,26 +26,26 @@ Control { Spacing="3"; } ControlBorder { - BorderWidth = "1"; - Foreground = "DimGrey"; + BorderWidth = "${ControlBorderWidth}"; + Foreground = "${ControlBorderColor}"; Background = "${ControlBackground}"; CornerRadius = "0"; } ControlCaption { - Foreground = "LightGrey"; - MouseEnter = "{Foreground=White}"; - MouseLeave = "{Foreground=LightGrey}"; + Foreground = "${ControlCaptionColor}"; + MouseEnter = "{Foreground=${ControlCaptionHoverColor}}"; + MouseLeave = "{Foreground=${ControlCaptionColor}}"; } ControlEditableText { Foreground = "LightGrey"; Background = "Transparent"; - MinimumSize = "80,10"; + MinimumSize = "40,10"; Margin = "1"; } Icon { - Margin = "1"; - Width = "12"; - Height = "12"; + Margin = "${IconMargin}"; + Width = "${IconSize}"; + Height = "${IconSize}"; } Wrapper { Orientation = "Vertical"; @@ -56,7 +63,7 @@ TextBox { Background = "White"; Foreground = "Black"; Selectable = "True"; - Text = "TextBox"; + //Text = "TextBox"; Margin = "1"; MouseCursor = "IBeam"; } diff --git a/Crow/Properties/AssemblyInfo.cs b/Crow/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..d8646524 --- /dev/null +++ b/Crow/Properties/AssemblyInfo.cs @@ -0,0 +1,5 @@ +// Copyright (c) 2013-2020 Jean-Philippe Bruyère +// +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) +[assembly: Crow.Crow ] + diff --git a/Crow/Templates/Expandable.template b/Crow/Templates/Expandable.template index 36137e26..ac52ae34 100644 --- a/Crow/Templates/Expandable.template +++ b/Crow/Templates/Expandable.template @@ -1,5 +1,5 @@  - + // -// Author: -// Jean-Philippe Bruyère -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; -using System.Xml.Serialization; using System.ComponentModel; -using System.Diagnostics; using Crow.Cairo; namespace Crow @@ -47,8 +22,8 @@ namespace Crow public class Border : Container { #region CTOR - protected Border () : base(){} - public Border (Interface iface) : base(iface){} + protected Border () {} + public Border (Interface iface, string style = null) : base (iface, style) { } #endregion #region private fields @@ -61,8 +36,7 @@ namespace Crow #region public properties /// /// use to define the colors of the 3d border - /// - + /// public virtual Fill RaisedColor { get { return raisedColor; } set { @@ -75,8 +49,7 @@ namespace Crow } /// /// use to define the colors of the 3d border - /// - + /// public virtual Fill SunkenColor { get { return sunkenColor; } set { @@ -133,8 +106,7 @@ namespace Crow gr.Save (); if (ClipToClientRect) { - //clip to client zone - CairoHelpers.CairoRectangle (gr, ClientRectangle,Math.Max(0.0, CornerRadius-Margin)); + CairoHelpers.CairoRectangle (gr, ClientRectangle, Math.Max (0.0, CornerRadius - Margin)); gr.Clip (); } diff --git a/Crow/src/Widgets/Button.cs b/Crow/src/Widgets/Button.cs index 8b15c2ea..6d997a23 100644 --- a/Crow/src/Widgets/Button.cs +++ b/Crow/src/Widgets/Button.cs @@ -1,39 +1,8 @@ -// -// Button.cs +// Copyright (c) 2013-2020 Jean-Philippe Bruyère // -// Author: -// Jean-Philippe Bruyère -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -//using OpenTK.Graphics.OpenGL; - -using System.Diagnostics; - -using System.Xml.Serialization; -using Crow.Cairo; using System.ComponentModel; namespace Crow @@ -41,11 +10,11 @@ namespace Crow /// /// templated button control /// - public class Button : TemplatedContainer + public class Button : TemplatedContainer { #region CTOR - protected Button() : base() {} - public Button (Interface iface) : base(iface){} + protected Button() {} + public Button (Interface iface, string style = null) : base (iface, style) { } #endregion string image; diff --git a/Crow/src/Widgets/CheckBox.cs b/Crow/src/Widgets/CheckBox.cs index 7a6e5d45..50215241 100644 --- a/Crow/src/Widgets/CheckBox.cs +++ b/Crow/src/Widgets/CheckBox.cs @@ -14,8 +14,8 @@ namespace Crow public class CheckBox : TemplatedControl { #region CTOR - protected CheckBox() : base(){} - public CheckBox (Interface iface) : base(iface){} + protected CheckBox() {} + public CheckBox (Interface iface, string style = null) : base (iface, style) { } #endregion bool isChecked; diff --git a/Crow/src/Widgets/ColorPicker.cs b/Crow/src/Widgets/ColorPicker.cs index 9b3bfb75..c62659a0 100644 --- a/Crow/src/Widgets/ColorPicker.cs +++ b/Crow/src/Widgets/ColorPicker.cs @@ -16,8 +16,8 @@ namespace Crow public class ColorPicker : TemplatedControl { #region CTOR - protected ColorPicker() : base(){} - public ColorPicker (Interface iface) : base(iface){} + protected ColorPicker() {} + public ColorPicker (Interface iface, string style = null) : base (iface, style) { } #endregion Color currentColor; diff --git a/Crow/src/Widgets/ColorSelector.cs b/Crow/src/Widgets/ColorSelector.cs index 83949df5..aa6a1aa9 100644 --- a/Crow/src/Widgets/ColorSelector.cs +++ b/Crow/src/Widgets/ColorSelector.cs @@ -14,8 +14,8 @@ namespace Crow public class ColorSelector : Widget { #region CTOR - protected ColorSelector() : base(){} - public ColorSelector (Interface iface) : base(iface){} + protected ColorSelector() {} + public ColorSelector (Interface iface, string style = null) : base(iface, style){ } #endregion protected Point mousePos; diff --git a/Crow/src/Widgets/ColorSlider.cs b/Crow/src/Widgets/ColorSlider.cs index 013a0e63..fe2b78dc 100644 --- a/Crow/src/Widgets/ColorSlider.cs +++ b/Crow/src/Widgets/ColorSlider.cs @@ -16,8 +16,8 @@ namespace Crow public class ColorSlider : Widget { #region CTOR - protected ColorSlider() : base(){} - public ColorSlider (Interface iface) : base(iface){} + protected ColorSlider() {} + public ColorSlider (Interface iface, string style = null) : base (iface, style) { } #endregion protected Point mousePos;//store local mouse pos sync with currentValue diff --git a/Crow/src/Widgets/ComboBox.cs b/Crow/src/Widgets/ComboBox.cs index 08e844c4..cf706318 100644 --- a/Crow/src/Widgets/ComboBox.cs +++ b/Crow/src/Widgets/ComboBox.cs @@ -2,9 +2,6 @@ // // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) -using System; -using System.Xml.Serialization; - namespace Crow { /// @@ -13,8 +10,8 @@ namespace Crow public class ComboBox : ListBox { #region CTOR - protected ComboBox() : base(){} - public ComboBox (Interface iface) : base(iface){} + protected ComboBox() {} + public ComboBox (Interface iface, string style = null) : base (iface, style) { } #endregion Size minimumPopupSize = "10,10"; diff --git a/Crow/src/Widgets/Container.cs b/Crow/src/Widgets/Container.cs index 07ccfa9b..6b16e5a3 100644 --- a/Crow/src/Widgets/Container.cs +++ b/Crow/src/Widgets/Container.cs @@ -2,19 +2,12 @@ // // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) -using System; -using System.Xml.Serialization; -using System.Reflection; -using System.ComponentModel; -using System.Linq; -using System.Threading; - namespace Crow { /// /// simple container accepting one child /// - public class Container : PrivateContainer + public class Container : PrivateContainer { #if DESIGN_MODE public override void getIML (System.Xml.XmlDocument doc, System.Xml.XmlNode parentElem) @@ -29,8 +22,8 @@ namespace Crow #endif #region CTOR - protected Container() : base(){} - public Container (Interface iface) : base(iface){} + protected Container() {} + public Container (Interface iface, string style = null) : base (iface, style) { } #endregion [XmlIgnore]public Widget Child { diff --git a/Crow/src/Widgets/DataSourceChangeEventArgs.cs b/Crow/src/Widgets/DataSourceChangeEventArgs.cs index a2519356..47c40029 100644 --- a/Crow/src/Widgets/DataSourceChangeEventArgs.cs +++ b/Crow/src/Widgets/DataSourceChangeEventArgs.cs @@ -1,32 +1,14 @@ -// -// DataSourceChangeEventArgs.cs +// Copyright (c) 2013-2020 Jean-Philippe Bruyère // -// Author: -// Jean-Philippe Bruyère -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) + using System; namespace Crow { + /// + /// Raised when the current data source of a widget has changed. + /// public class DataSourceChangeEventArgs : EventArgs { public object OldDataSource; diff --git a/Crow/src/Widgets/DirectoryView.cs b/Crow/src/Widgets/DirectoryView.cs index ae24e9f5..c664f517 100644 --- a/Crow/src/Widgets/DirectoryView.cs +++ b/Crow/src/Widgets/DirectoryView.cs @@ -1,34 +1,11 @@ -// -// DirectoryView.cs +// Copyright (c) 2013-2020 Jean-Philippe Bruyère // -// Author: -// Jean-Philippe Bruyère -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; -using System.Xml.Serialization; +using System.Collections.Generic; using System.ComponentModel; using System.IO; -using System.Collections.Generic; using System.Linq; namespace Crow @@ -39,8 +16,8 @@ namespace Crow public class DirectoryView : TemplatedControl { #region CTOR - protected DirectoryView() : base(){} - public DirectoryView (Interface iface) : base(iface){} + protected DirectoryView() {} + public DirectoryView (Interface iface, string style = null) : base (iface, style) { } #endregion #region events diff --git a/Crow/src/Widgets/DockStack.cs b/Crow/src/Widgets/DockStack.cs index 50e87b1c..81aa5e74 100644 --- a/Crow/src/Widgets/DockStack.cs +++ b/Crow/src/Widgets/DockStack.cs @@ -1,33 +1,9 @@ -// -// DockStack.cs +// Copyright (c) 2013-2020 Jean-Philippe Bruyère // -// Author: -// Jean-Philippe Bruyère -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) + using System; -using Crow.IML; -using System.Linq; using System.Text; -using System.IO; using FastEnumUtility; namespace Crow @@ -37,7 +13,7 @@ namespace Crow { #region CTor public DockStack () {} - public DockStack (Interface iface) : base (iface) {} + public DockStack (Interface iface, string style = null) : base (iface, style) { } #endregion /*static int color = 10; diff --git a/Crow/src/Widgets/GenericStack.cs b/Crow/src/Widgets/GenericStack.cs index eeec15c6..a0fb4d0c 100644 --- a/Crow/src/Widgets/GenericStack.cs +++ b/Crow/src/Widgets/GenericStack.cs @@ -2,10 +2,8 @@ // // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) -using System.ComponentModel; -using System.Diagnostics; -using System.Xml.Serialization; using System; +using System.ComponentModel; using System.Linq; namespace Crow @@ -16,12 +14,12 @@ namespace Crow public class GenericStack : Group { #region CTOR - protected GenericStack() : base(){} - public GenericStack(Interface iface) : base(iface){} + protected GenericStack() {} + public GenericStack(Interface iface, string style = null) : base (iface, style) { } #endregion #region Private fields - int _spacing; + int _spacing; Orientation _orientation; #endregion diff --git a/Crow/src/Widgets/GraduatedSlider.cs b/Crow/src/Widgets/GraduatedSlider.cs index 71bbff11..938e0054 100644 --- a/Crow/src/Widgets/GraduatedSlider.cs +++ b/Crow/src/Widgets/GraduatedSlider.cs @@ -1,35 +1,8 @@ -// -// GraduatedSlider.cs +// Copyright (c) 2013-2020 Jean-Philippe Bruyère // -// Author: -// Jean-Philippe Bruyère -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using Crow.Cairo; -using System.Xml.Serialization; namespace Crow { @@ -37,9 +10,8 @@ namespace Crow public class GraduatedSlider : Slider { #region CTOR - protected GraduatedSlider() : base(){} - public GraduatedSlider(Interface iface) : base(iface) - {} + protected GraduatedSlider() {} + public GraduatedSlider(Interface iface, string style = null) : base (iface, style) { } // public GraduatedSlider(double minimum, double maximum, double step) // : base() // { diff --git a/Crow/src/Widgets/Group.cs b/Crow/src/Widgets/Group.cs index 365679b2..bba4bea9 100644 --- a/Crow/src/Widgets/Group.cs +++ b/Crow/src/Widgets/Group.cs @@ -42,8 +42,8 @@ namespace Crow protected ReaderWriterLockSlim childrenRWLock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion); #region CTOR - public Group () : base() {} - public Group(Interface iface) : base(iface){} + public Group () {} + public Group(Interface iface, string style = null) : base (iface, style) { } #endregion #region EVENT HANDLERS diff --git a/Crow/src/Widgets/Label.cs b/Crow/src/Widgets/Label.cs index eef5cbd9..860c16ca 100644 --- a/Crow/src/Widgets/Label.cs +++ b/Crow/src/Widgets/Label.cs @@ -13,17 +13,8 @@ namespace Crow { public class Label : Widget { #region CTOR - protected Label () : base(){} - - public Label(Interface iface) : base(iface) - { - - } -// public Label(string _text) -// : base() -// { -// Text = _text; -// } + protected Label () {} + public Label(Interface iface, string style = null) : base (iface, style) { } #endregion public event EventHandler TextChanged; diff --git a/Crow/src/Widgets/ListBox.cs b/Crow/src/Widgets/ListBox.cs index f605fa55..c51f9ba1 100644 --- a/Crow/src/Widgets/ListBox.cs +++ b/Crow/src/Widgets/ListBox.cs @@ -1,50 +1,15 @@ -// -// ListBox.cs +// Copyright (c) 2013-2020 Jean-Philippe Bruyère // -// Author: -// Jean-Philippe Bruyère -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; -using System.Collections; -using System.Xml.Serialization; -using System.ComponentModel; -using System.IO; -using System.Diagnostics; -using System.Xml; -using System.Collections.Generic; -using System.Threading; +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) namespace Crow { public class ListBox : TemplatedGroup { #region CTOR - protected ListBox () : base(){} - public ListBox (Interface iface) : base(iface) {} + protected ListBox () {} + public ListBox (Interface iface, string style = null) : base (iface, style) { } #endregion - - - } } diff --git a/Crow/src/Widgets/NumericControl.cs b/Crow/src/Widgets/NumericControl.cs index ec63fe8d..9359d648 100644 --- a/Crow/src/Widgets/NumericControl.cs +++ b/Crow/src/Widgets/NumericControl.cs @@ -33,10 +33,8 @@ namespace Crow public abstract class NumericControl : TemplatedControl { #region CTOR - protected NumericControl () : base(){} - public NumericControl (Interface iface) : base(iface) - { - } + protected NumericControl () {} + public NumericControl (Interface iface, string style = null) : base (iface, style) { } // public NumericControl(double minimum, double maximum, double step) // : base() // { diff --git a/Crow/src/Widgets/Popper.cs b/Crow/src/Widgets/Popper.cs index 78d35d8f..fc5ff0da 100644 --- a/Crow/src/Widgets/Popper.cs +++ b/Crow/src/Widgets/Popper.cs @@ -3,16 +3,15 @@ // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; -using System.Xml.Serialization; using System.ComponentModel; namespace Crow { - public class Popper : TemplatedContainer + public class Popper : TemplatedContainer { #region CTOR - protected Popper () : base(){} - public Popper (Interface iface) : base(iface){} + protected Popper () {} + public Popper (Interface iface, string style = null) : base (iface, style) { } #endregion bool _isPopped, _canPop; diff --git a/Crow/src/Widgets/PrivateContainer.cs b/Crow/src/Widgets/PrivateContainer.cs index 351ea202..ee74784e 100644 --- a/Crow/src/Widgets/PrivateContainer.cs +++ b/Crow/src/Widgets/PrivateContainer.cs @@ -2,9 +2,6 @@ // // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) -using System; -using System.Xml.Serialization; -using System.ComponentModel; using Crow.Cairo; namespace Crow @@ -20,8 +17,8 @@ namespace Crow public class PrivateContainer : Widget { #region CTOR - protected PrivateContainer () : base(){} - public PrivateContainer (Interface iface) : base(iface){} + protected PrivateContainer () {} + public PrivateContainer (Interface iface, string style = null) : base (iface, style) { } #endregion #if DESIGN_MODE diff --git a/Crow/src/Widgets/ProgressBar.cs b/Crow/src/Widgets/ProgressBar.cs index 20fadadc..816b9352 100644 --- a/Crow/src/Widgets/ProgressBar.cs +++ b/Crow/src/Widgets/ProgressBar.cs @@ -1,51 +1,20 @@ -// -// ProgressBar.cs +// Copyright (c) 2013-2020 Jean-Philippe Bruyère // -// Author: -// Jean-Philippe Bruyère -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using Crow.Cairo; -using System.Diagnostics; -using System.Xml.Serialization; -using System.ComponentModel; namespace Crow { - public class ProgressBar : NumericControl { #region CTOR - protected ProgressBar () : base(){} - public ProgressBar(Interface iface) : base(iface){} + protected ProgressBar () {} + public ProgressBar(Interface iface, string style = null) : base (iface, style) { } #endregion protected override void loadTemplate (Widget template) - { - + { } #region GraphicObject overrides diff --git a/Crow/src/Widgets/RadioButton.cs b/Crow/src/Widgets/RadioButton.cs index ef2c6e93..220e56e8 100644 --- a/Crow/src/Widgets/RadioButton.cs +++ b/Crow/src/Widgets/RadioButton.cs @@ -16,8 +16,8 @@ namespace Crow bool isChecked; #region CTOR - protected RadioButton () : base () { } - public RadioButton (Interface iface) : base (iface) { } + protected RadioButton () { } + public RadioButton (Interface iface, string style = null) : base (iface, style) { } #endregion public event EventHandler Checked; diff --git a/Crow/src/Widgets/SaturationValueSelector.cs b/Crow/src/Widgets/SaturationValueSelector.cs index d202503f..09c194cd 100644 --- a/Crow/src/Widgets/SaturationValueSelector.cs +++ b/Crow/src/Widgets/SaturationValueSelector.cs @@ -1,42 +1,19 @@ -// -// SaturationValueSelector.cs +// Copyright (c) 2013-2020 Jean-Philippe Bruyère // -// Author: -// Jean-Philippe Bruyère -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; using Crow.Cairo; -using System.Xml.Serialization; namespace Crow { [DesignIgnore] public class SaturationValueSelector : ColorSelector { - public SaturationValueSelector () : base(){} - public SaturationValueSelector (Interface iface) : base(iface) - { - } + #region CTOR + public SaturationValueSelector () {} + public SaturationValueSelector (Interface iface, string style = null) : base (iface, style) { } + #endregion double v, s; diff --git a/Crow/src/Widgets/Scalable.cs b/Crow/src/Widgets/Scalable.cs index adb17184..e38aded0 100644 --- a/Crow/src/Widgets/Scalable.cs +++ b/Crow/src/Widgets/Scalable.cs @@ -6,11 +6,14 @@ using System.ComponentModel; namespace Crow { + /// + /// Base class for controling scalable content behaviour. + /// public abstract class Scalable : Widget { #region CTOR - protected Scalable () : base () { } - public Scalable (Interface iface) : base (iface) { } + protected Scalable () { } + public Scalable (Interface iface, string style = null) : base (iface, style) { } #endregion protected bool scaled, keepProps; diff --git a/Crow/src/Widgets/ScrollBar.cs b/Crow/src/Widgets/ScrollBar.cs index 08ee5e09..612a3e63 100644 --- a/Crow/src/Widgets/ScrollBar.cs +++ b/Crow/src/Widgets/ScrollBar.cs @@ -1,31 +1,8 @@ -// -// ScrollBar.cs +// Copyright (c) 2013-2020 Jean-Philippe Bruyère // -// Author: -// Jean-Philippe Bruyère -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; -using System.Xml.Serialization; using System.ComponentModel; namespace Crow @@ -41,8 +18,8 @@ namespace Crow int _cursorSize; #region CTOR - protected ScrollBar () : base(){} - public ScrollBar(Interface iface) : base(iface) {} + protected ScrollBar () {} + public ScrollBar(Interface iface, string style = null) : base (iface, style) { } #endregion [DefaultValue(Orientation.Vertical)] diff --git a/Crow/src/Widgets/Scroller.cs b/Crow/src/Widgets/Scroller.cs index be3aeac2..33695df0 100644 --- a/Crow/src/Widgets/Scroller.cs +++ b/Crow/src/Widgets/Scroller.cs @@ -15,8 +15,8 @@ namespace Crow public class Scroller : Container { #region CTOR - protected Scroller () : base(){} - public Scroller (Interface iface) : base(iface){} + protected Scroller () {} + public Scroller (Interface iface, string style = null) : base (iface, style) { } #endregion //public event EventHandler Scrolled; diff --git a/Crow/src/Widgets/ScrollingObject.cs b/Crow/src/Widgets/ScrollingObject.cs index ea09c2cd..8f0c81a4 100644 --- a/Crow/src/Widgets/ScrollingObject.cs +++ b/Crow/src/Widgets/ScrollingObject.cs @@ -1,34 +1,9 @@ -// -// ScrollingObject.cs +// Copyright (c) 2013-2020 Jean-Philippe Bruyère // -// Author: -// Jean-Philippe Bruyère -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; -using System.Xml.Serialization; using System.ComponentModel; -using System.Collections; -using Crow.Cairo; using Glfw; namespace Crow @@ -40,8 +15,8 @@ namespace Crow public class ScrollingObject : Widget { #region CTOR - protected ScrollingObject ():base(){} - public ScrollingObject (Interface iface):base(iface){} + protected ScrollingObject () {} + public ScrollingObject (Interface iface, string style = null) : base (iface, style) { } #endregion int scrollX, scrollY, maxScrollX, maxScrollY, mouseWheelSpeed; diff --git a/Crow/src/Widgets/Shape.cs b/Crow/src/Widgets/Shape.cs index d8b17943..853b4abd 100644 --- a/Crow/src/Widgets/Shape.cs +++ b/Crow/src/Widgets/Shape.cs @@ -137,8 +137,8 @@ namespace Crow public class Shape : Scalable { #region CTOR - protected Shape () : base () { } - public Shape (Interface iface) : base (iface) { } + protected Shape () { } + public Shape (Interface iface, string style = null) : base (iface, style) { } #endregion string path; diff --git a/Crow/src/Widgets/Slider.cs b/Crow/src/Widgets/Slider.cs index 54ad33fa..73518ecb 100644 --- a/Crow/src/Widgets/Slider.cs +++ b/Crow/src/Widgets/Slider.cs @@ -15,9 +15,8 @@ namespace Crow public class Slider : NumericControl { #region CTOR - protected Slider() : base(){} - public Slider(Interface iface) : base(iface) - {} + protected Slider() {} + public Slider(Interface iface, string style = null) : base (iface, style) { } // public Slider(double minimum, double maximum, double step) // : base(minimum,maximum,step) // { diff --git a/Crow/src/Widgets/Spinner.cs b/Crow/src/Widgets/Spinner.cs index d9fd51f6..c1cfdbbb 100644 --- a/Crow/src/Widgets/Spinner.cs +++ b/Crow/src/Widgets/Spinner.cs @@ -11,10 +11,8 @@ namespace Crow public class Spinner : NumericControl { #region CTOR - protected Spinner() : base(){} - public Spinner (Interface iface) : base(iface) - { - } + protected Spinner() {} + public Spinner (Interface iface, string style = null) : base (iface, style) { } #endregion public override void onMouseClick (object sender, MouseButtonEventArgs e) diff --git a/Crow/src/Widgets/Splitter.cs b/Crow/src/Widgets/Splitter.cs index 40801160..f2c0a084 100644 --- a/Crow/src/Widgets/Splitter.cs +++ b/Crow/src/Widgets/Splitter.cs @@ -1,31 +1,8 @@ -// -// Splitter.cs +// Copyright (c) 2013-2020 Jean-Philippe Bruyère // -// Author: -// Jean-Philippe Bruyère -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; -using System.Xml.Serialization; using System.ComponentModel; namespace Crow @@ -37,8 +14,8 @@ namespace Crow public class Splitter : Widget { #region CTOR - protected Splitter() : base(){} - public Splitter (Interface iface) : base(iface){} + protected Splitter() {} + public Splitter (Interface iface, string style = null) : base (iface, style) { } #endregion int thickness; diff --git a/Crow/src/Widgets/TabItem.cs b/Crow/src/Widgets/TabItem.cs index df06cc92..c57807c8 100644 --- a/Crow/src/Widgets/TabItem.cs +++ b/Crow/src/Widgets/TabItem.cs @@ -12,8 +12,8 @@ namespace Crow public class TabItem : TemplatedContainer { #region CTOR - protected TabItem() : base(){} - public TabItem (Interface iface) : base(iface){} + protected TabItem() {} + public TabItem (Interface iface, string style = null) : base (iface, style) { } #endregion public event EventHandler QueryClose; diff --git a/Crow/src/Widgets/TabView.cs b/Crow/src/Widgets/TabView.cs index d48cbfc0..8699d316 100644 --- a/Crow/src/Widgets/TabView.cs +++ b/Crow/src/Widgets/TabView.cs @@ -12,8 +12,8 @@ namespace Crow public class TabView : Group { #region CTOR - public TabView() : base(){} - public TabView (Interface iface) : base(iface){} + public TabView() {} + public TabView (Interface iface, string style = null) : base (iface, style) { } #endregion #region Private fields diff --git a/Crow/src/Widgets/Table.cs b/Crow/src/Widgets/Table.cs index bc148210..10f6376f 100644 --- a/Crow/src/Widgets/Table.cs +++ b/Crow/src/Widgets/Table.cs @@ -49,8 +49,10 @@ namespace Crow public class Table : TemplatedGroup { - public Table () : base () {} - public Table (Interface iFace) : base (iFace) { } + #region CTOR + public Table () {} + public Table (Interface iface, string style = null) : base (iface, style) { } + #endregion public ObservableList Columns = new ObservableList (); } diff --git a/Crow/src/Widgets/TemplatedContainer.cs b/Crow/src/Widgets/TemplatedContainer.cs index 0acd8765..31039f45 100644 --- a/Crow/src/Widgets/TemplatedContainer.cs +++ b/Crow/src/Widgets/TemplatedContainer.cs @@ -2,11 +2,6 @@ // // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) -using System; -using System.Xml.Serialization; -using System.Xml; -using System.Reflection; - namespace Crow { /// @@ -16,7 +11,7 @@ namespace Crow /// public class TemplatedContainer : TemplatedControl { - #if DESIGN_MODE +#if DESIGN_MODE public override void getIML (System.Xml.XmlDocument doc, System.Xml.XmlNode parentElem) { if (this.design_isTGItem) @@ -26,11 +21,11 @@ namespace Crow return; Content.getIML (doc, parentElem.LastChild); } - #endif +#endif - #region CTOR - protected TemplatedContainer() : base(){} - public TemplatedContainer (Interface iface) : base(iface){} +#region CTOR + protected TemplatedContainer() {} + public TemplatedContainer (Interface iface, string style = null) : base (iface, style) { } #endregion protected Container _contentContainer; @@ -57,7 +52,7 @@ namespace Crow _contentContainer = this.child.FindByName ("Content") as Container; } - #region GraphicObject overrides +#region GraphicObject overrides public override Widget FindByName (string nameToFind) { if (Name == nameToFind) @@ -73,7 +68,7 @@ namespace Crow return true; return base.Contains (goToFind); } - #endregion +#endregion } } diff --git a/Crow/src/Widgets/TemplatedControl.cs b/Crow/src/Widgets/TemplatedControl.cs index 32796c8a..896ecdce 100644 --- a/Crow/src/Widgets/TemplatedControl.cs +++ b/Crow/src/Widgets/TemplatedControl.cs @@ -32,8 +32,8 @@ namespace Crow #endif #region CTOR - protected TemplatedControl() : base(){} - public TemplatedControl (Interface iface) : base(iface){} + protected TemplatedControl() {} + protected TemplatedControl (Interface iface, string style = null) : base (iface, style) { } #endregion string _template = "NOT_SET"; diff --git a/Crow/src/Widgets/TemplatedGroup.cs b/Crow/src/Widgets/TemplatedGroup.cs index 478c99b5..72cd452c 100644 --- a/Crow/src/Widgets/TemplatedGroup.cs +++ b/Crow/src/Widgets/TemplatedGroup.cs @@ -32,8 +32,8 @@ namespace Crow { #endif #region CTOR - protected TemplatedGroup() : base(){} - public TemplatedGroup (Interface iface) : base(iface){} + protected TemplatedGroup() {} + protected TemplatedGroup (Interface iface, string style = null) : base (iface, style) { } #endregion protected Group items; diff --git a/Crow/src/Widgets/TestCairoPatch.cs b/Crow/src/Widgets/TestCairoPatch.cs index f8294a3b..99230a05 100644 --- a/Crow/src/Widgets/TestCairoPatch.cs +++ b/Crow/src/Widgets/TestCairoPatch.cs @@ -1,28 +1,7 @@ -// -// TestCairoPatch.cs +// Copyright (c) 2013-2020 Jean-Philippe Bruyère // -// Author: -// jp <> -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) + using System; using Crow.Cairo; diff --git a/Crow/src/Widgets/TextBox.cs b/Crow/src/Widgets/TextBox.cs index e3830cd0..3f166d42 100644 --- a/Crow/src/Widgets/TextBox.cs +++ b/Crow/src/Widgets/TextBox.cs @@ -1,43 +1,17 @@ -// -// TextBox.cs +// Copyright (c) 2013-2020 Jean-Philippe Bruyère // -// Author: -// Jean-Philippe Bruyère -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) -using System; using Crow.Cairo; -using System.Diagnostics; -using System.Xml.Serialization; using Glfw; namespace Crow { - public class TextBox : Label + public class TextBox : Label { #region CTOR - protected TextBox() : base(){} - public TextBox(Interface iface) : base(iface) - { } + protected TextBox() {} + public TextBox(Interface iface, string style = null) : base (iface, style) { } // public TextBox(string _initialValue) // : base(_initialValue) // { diff --git a/Crow/src/Widgets/TextRun.cs b/Crow/src/Widgets/TextRun.cs index 054d2c2a..09720baf 100644 --- a/Crow/src/Widgets/TextRun.cs +++ b/Crow/src/Widgets/TextRun.cs @@ -1,38 +1,13 @@ -// -// TextRun.cs +// Copyright (c) 2013-2020 Jean-Philippe Bruyère // -// Author: -// Jean-Philippe Bruyère -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; -using System.Text; -using System.Diagnostics; -using Crow.Cairo; using System.Text.RegularExpressions; -using System.Xml.Serialization; -using System.ComponentModel; +using Crow.Cairo; namespace Crow { @@ -40,8 +15,8 @@ namespace Crow public class TextRun : Widget { #region CTOR - protected TextRun () : base(){} - public TextRun (Interface iface) : base (iface){} + protected TextRun () {} + public TextRun (Interface iface, string style = null) : base (iface, style) { } #endregion //TODO:change protected to private diff --git a/Crow/src/Widgets/TreeView.cs b/Crow/src/Widgets/TreeView.cs index af86ab7d..87d22006 100644 --- a/Crow/src/Widgets/TreeView.cs +++ b/Crow/src/Widgets/TreeView.cs @@ -1,32 +1,8 @@ -// -// TreeView.cs +// Copyright (c) 2013-2020 Jean-Philippe Bruyère // -// Author: -// Jean-Philippe Bruyère -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; -using System.Xml.Serialization; -using System.Diagnostics; using System.ComponentModel; namespace Crow @@ -39,10 +15,8 @@ namespace Crow bool isRoot; #region CTOR - protected TreeView() : base(){} - public TreeView (Interface iface) : base(iface) - { - } + protected TreeView() {} + public TreeView (Interface iface, string style = null) : base (iface, style) { } #endregion [DefaultValue(false)] diff --git a/Crow/src/Widgets/Trend.cs b/Crow/src/Widgets/Trend.cs index b62fd2f2..414ee82a 100644 --- a/Crow/src/Widgets/Trend.cs +++ b/Crow/src/Widgets/Trend.cs @@ -1,32 +1,8 @@ -// -// Trend.cs +// Copyright (c) 2013-2020 Jean-Philippe Bruyère // -// Author: -// Jean-Philippe Bruyère -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) + using System.Collections.Generic; -using System.Xml.Serialization; using System.ComponentModel; using Crow.Cairo; @@ -41,20 +17,19 @@ namespace Crow List values = new List(); #endregion + #region CTOR + protected Trend () {} + public Trend (Interface iface, string style = null) : base (iface, style) { } + #endregion - - public virtual void AddValue(double _value) + public virtual void AddValue (double _value) { values.Add (_value); while (values.Count > nbValues) values.RemoveAt (0); RegisterForRedraw (); } - #region CTOR - protected Trend () : base() - { - } - #endregion + [XmlIgnore]public virtual int NewValue { set { AddValue (value); diff --git a/Crow/src/Widgets/VerticalStack.cs b/Crow/src/Widgets/VerticalStack.cs index cf0a251a..a0574ce2 100644 --- a/Crow/src/Widgets/VerticalStack.cs +++ b/Crow/src/Widgets/VerticalStack.cs @@ -1,54 +1,22 @@ -// -// VerticalStack.cs +// Copyright (c) 2013-2020 Jean-Philippe Bruyère // -// Author: -// Jean-Philippe Bruyère -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) namespace Crow { /// /// group control stacking its children vertically /// - public class VerticalStack : GenericStack - { + public class VerticalStack : GenericStack + { #region CTOR - protected VerticalStack() : base(){} - public VerticalStack(Interface iface) : base(iface) - { - } + protected VerticalStack () { } + public VerticalStack (Interface iface, string style = null) : base (iface, style) { } #endregion - [XmlIgnore] - public override Orientation Orientation - { - get { return Orientation.Vertical; } - } - - - } + [XmlIgnore] + public override Orientation Orientation { + get => Orientation.Vertical; + } + } } diff --git a/Crow/src/Widgets/Widget.cs b/Crow/src/Widgets/Widget.cs index d2cf5bcb..b103ac56 100644 --- a/Crow/src/Widgets/Widget.cs +++ b/Crow/src/Widgets/Widget.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; using System.ComponentModel; -using System.Xml.Serialization; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; @@ -238,8 +237,9 @@ namespace Crow /// compiler will not create it automatically because of the presence of the other one. /// /// Iface. - public Widget (Interface iface) : this() + public Widget (Interface iface, string style = null) : this() { + this.style = style; IFace = iface; Initialize (); } diff --git a/Crow/src/Widgets/Window.cs b/Crow/src/Widgets/Window.cs index 21d5cf82..ddf730ad 100644 --- a/Crow/src/Widgets/Window.cs +++ b/Crow/src/Widgets/Window.cs @@ -3,9 +3,7 @@ // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; -using System.Xml.Serialization; using System.ComponentModel; -using System.Diagnostics; using Glfw; namespace Crow @@ -47,8 +45,8 @@ namespace Crow #endregion #region CTOR - protected Window() : base(){} - public Window (Interface iface) : base(iface){} + protected Window() {} + public Window (Interface iface, string style = null) : base (iface, style) { } #endregion #region TemplatedContainer overrides diff --git a/Crow/src/Widgets/Wrapper.cs b/Crow/src/Widgets/Wrapper.cs index a170e390..7170d1ed 100644 --- a/Crow/src/Widgets/Wrapper.cs +++ b/Crow/src/Widgets/Wrapper.cs @@ -1,30 +1,6 @@ -// -// Wrapper.cs +// Copyright (c) 2013-2020 Jean-Philippe Bruyère // -// Author: -// Jean-Philippe Bruyère -// -// Copyright (c) 2013-2017 Jean-Philippe Bruyère -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) namespace Crow { @@ -35,8 +11,8 @@ namespace Crow public class Wrapper : GenericStack { #region CTOR - protected Wrapper() : base(){} - public Wrapper (Interface iface) : base(iface){} + protected Wrapper() {} + public Wrapper (Interface iface, string style = null) : base (iface, style) { } #endregion #region Group Overrides diff --git a/Crow/src/styling/StyleReader.cs b/Crow/src/styling/StyleReader.cs index f7ccf224..d4e56de9 100644 --- a/Crow/src/styling/StyleReader.cs +++ b/Crow/src/styling/StyleReader.cs @@ -159,7 +159,7 @@ namespace Crow iFace.Styling [tc] = new Style (); iFace.Styling [tc] [currentProperty] = token; #if DESIGN_MODE - styling [tc].Locations[currentProperty] = new FileLocation(resId, line, column - token.Length - 1, token.Length); + iFace.Styling [tc].Locations[currentProperty] = new FileLocation(resId, line, column - token.Length - 1, token.Length); #endif } curState = States.members; diff --git a/Samples/BasicTests/BasicTests.cs b/Samples/BasicTests/BasicTests.cs index 1a9340d5..e32b6080 100644 --- a/Samples/BasicTests/BasicTests.cs +++ b/Samples/BasicTests/BasicTests.cs @@ -37,7 +37,7 @@ namespace tests //testFiles = new string [] { @"Interfaces/TemplatedGroup/3.crow" }; //testFiles = new string [] { @"Interfaces/Divers/testShape.crow" }; //testFiles = new string [] { @"Interfaces/TemplatedControl/testEnumSelector.crow" }; - testFiles = new string [] { @"Interfaces/TemplatedControl/testSpinner.crow" }; + testFiles = new string [] { @"Interfaces/Divers/all.crow" }; //testFiles = new string [] { @"Interfaces/Divers/colorPicker2.crow" }; testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray (); diff --git a/Samples/Directory.Build.props b/Samples/Directory.Build.props index d2f140e7..1a85bb22 100644 --- a/Samples/Directory.Build.props +++ b/Samples/Directory.Build.props @@ -1,6 +1,6 @@ - netcoreapp3.1 + net472 Exe $(MSBuildThisFileDirectory) @@ -16,7 +16,6 @@ $(SolutionDir)Samples\ - diff --git a/Samples/HelloWorld/ui/helloworld.crow b/Samples/HelloWorld/ui/helloworld.crow index 73ccdffd..b3facb0e 100644 --- a/Samples/HelloWorld/ui/helloworld.crow +++ b/Samples/HelloWorld/ui/helloworld.crow @@ -1,2 +1,2 @@  -