]> O.S.I.I.S - jp/crow.git/commitdiff
several changes to merge later
authorjp <jp_bruyere@hotmail.com>
Fri, 1 Apr 2016 07:33:01 +0000 (09:33 +0200)
committerjp <jp_bruyere@hotmail.com>
Fri, 1 Apr 2016 07:33:01 +0000 (09:33 +0200)
OTKCrow/OpenTKGameWindow.cs
Templates/Button.crow
src/GraphicObjects/Label.cs
src/GraphicObjects/Window.cs
src/Interface.cs

index b11c2ce0d598ff97f94f1f7b402adc83f80cbf5b..a073d6958551c3504b191fa23fb723834c59ba49 100644 (file)
@@ -198,8 +198,12 @@ namespace Crow
                void OpenGLDraw()
                {
                        GL.GetInteger (GetPName.Viewport, viewport);
-                       GL.Viewport (0, 0, ClientRectangle.Width, ClientRectangle.Height);
+                       bool blend = GL.GetBoolean (GetPName.Blend);
 
+                       GL.Enable (EnableCap.Blend);
+                       GL.Viewport (0, 0, ClientRectangle.Width, ClientRectangle.Height);
+                       GL.DepthMask (false);
+                       GL.Disable (EnableCap.DepthTest);
                        shader.Enable ();
                        lock (CrowInterface.RenderMutex) {
                                if (CrowInterface.IsDirty) {
@@ -215,7 +219,12 @@ namespace Crow
                        GL.BindTexture(TextureTarget.Texture2D, 0);
 
                        shader.Disable ();
+                       if (!blend)
+                               GL.Disable (EnableCap.Blend);
                        GL.Viewport (viewport [0], viewport [1], viewport [2], viewport [3]);
+
+                       GL.DepthMask (true);
+                       GL.Enable (EnableCap.DepthTest);
                }
                #endregion
 
index 76d5dd8e7946450129e65eac142f4fe8e488d7c8..7d128f7544b714151c2ba569ab6257d1b6530c9f 100755 (executable)
@@ -2,10 +2,10 @@
 <Border Background="{../Background}" MinimumSize="50;20" Height="{../HeightPolicy}" Width="{../WidthPolicy}"
                Foreground="Transparent" CornerRadius="{../CornerRadius}" BorderWidth="1" 
        MouseEnter="{Foreground=vgradient|0:White|0,2:Gray|0,9:Gray|1:Black;caption.Foreground=White}"
-       MouseLeave="{Foreground=Transparent;caption.Foreground=DimGray}"
+       MouseLeave="{Foreground=Transparent;caption.Foreground=LightGray}"
        MouseDown="{Foreground=vgradient|0:Black|0,05:Gray|0,85:Gray|1:White}"
        MouseUp="{Foreground=vgradient|0:White|0,2:Gray|0,9:Gray|1:Black}"                  
        >
 <!--   <Image Height="0" Width="0" Margin="0" Path="{../../Image}" SvgSub="{../../SvgSub}"/>-->
-       <Label Font="{../../Font}" Name="caption" Margin="5" Foreground="DimGray" Text="{../../Caption}"/>
+       <Label Font="{../../Font}" Name="caption" Margin="5" Foreground="LightGray" Text="{../../Caption}"/>
 </Border>
\ No newline at end of file
index ebc18f767c294edebb6ca168e3c1d7a47f204a84..64c37ff8f3bd9f8f27e9b8ae8a08c4cff88f9b95 100644 (file)
@@ -119,7 +119,7 @@ namespace Crow
                        }
             set
             {
-                if (_text == value)
+                               if (string.Equals (value, _text, StringComparison.Ordinal))
                     return;
                                                                        
                 _text = value;
index 429d42696240bffce80c1b374d732d35a9e2e4c3..94fe40d33063613f306ee5309b4f93074461e9dc 100644 (file)
@@ -28,21 +28,14 @@ namespace Crow
                Container _contentContainer;
                Direction currentDirection = Direction.None;
 
+               public event EventHandler Closing;
+
                #region CTOR
                public Window () : base() {
                        
                }
                #endregion
 
-               #region GraphicObject overrides
-               [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true
-               public override bool Focusable
-               {
-                       get { return base.Focusable; }
-                       set { base.Focusable = value; }
-               }
-               #endregion
-
                public override GraphicObject Content {
                        get {
                                return _contentContainer == null ? null : _contentContainer.Child;
@@ -221,10 +214,13 @@ namespace Crow
 
                protected void butQuitPress (object sender, MouseButtonEventArgs e)
                {
-                       ILayoutable parent = (sender as GraphicObject).Parent;
-                       while(!(parent is Window))
-                               parent = parent.Parent;
-                       Interface.CurrentInterface.DeleteWidget (parent as GraphicObject);
+                       close ();
+               }
+
+               void close(){
+                       Closing.Raise (this, null);
+
+                       Interface.CurrentInterface.DeleteWidget (this);
                }
 
                public override void ResolveBindings ()
index 4cb94e76d2fb492aed3465d819e0bb907f5ae28a..0554858711d04d20eee5047d7e91f831e1eb107a 100644 (file)
@@ -224,6 +224,7 @@ namespace Crow
                        lock (UpdateMutex) {
                                GraphicObject tmp = Interface.Load (path, this);
                                AddWidget (tmp);
+
                                return tmp;
                        }
                }
@@ -457,7 +458,6 @@ namespace Crow
                {
                        g.Parent = this;
                        GraphicObjects.Insert (0, g);
-
                        g.RegisterForLayouting (LayoutingType.Sizing);
                }
                public void DeleteWidget(GraphicObject g)