]> O.S.I.I.S - jp/crow.git/commitdiff
use RegisterForRedraw when applicable
authorjpbruyere <jp.bruyere@hotmail.com>
Mon, 1 Aug 2016 11:50:55 +0000 (13:50 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Mon, 1 Aug 2016 11:50:55 +0000 (13:50 +0200)
13 files changed:
Default.style
Tests/BasicTests.cs
src/GraphicObjects/Border.cs
src/GraphicObjects/GenericStack.cs
src/GraphicObjects/Grid.cs
src/GraphicObjects/Label.cs
src/GraphicObjects/NumericControl.cs
src/GraphicObjects/Scroller.cs
src/GraphicObjects/Slider.cs
src/GraphicObjects/TabView.cs
src/GraphicObjects/TextBox.cs
src/GraphicObjects/TextRun.cs
src/GraphicObjects/Trend.cs

index 77d281f126a019598572a5927f4c1440deffe2f1..0092f1942be6ad2c0093687d5e7480b9963e8d94 100644 (file)
@@ -37,4 +37,7 @@ Window {
        MinimumSize=50,50;
        Width = 150;
        Height = 150;
+}
+Border {
+       Foreground = White;
 }
\ No newline at end of file
index 231a5afa2ac4a9900fd481af3ef22257bcb8bf59..e75ed01d514a1ce001a86a6582ffcbb0e635fc90 100644 (file)
@@ -79,7 +79,7 @@ namespace Tests
                        this.KeyDown += KeyboardKeyDown1;
 
                        testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
-                       //testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Unsorted", "*.crow")).ToArray ();
+                       testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Unsorted", "*.crow")).ToArray ();
                        testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray ();
                        //testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/basicTests", "*.crow")).ToArray ();
                        testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray ();
@@ -101,16 +101,24 @@ namespace Tests
                                TestList.Add ("new string");
                                NotifyValueChanged ("TestList", TestList);
                                return;
-                       } else if (e.Key == OpenTK.Input.Key.F2) {
+                       } else if (e.Key == OpenTK.Input.Key.F4) {
                                GraphicObject w = CrowInterface.LoadInterface ("Interfaces/Divers/testWindow.goml");
                                w.DataSource = this;
                                return;
-                       } else if (e.Key != OpenTK.Input.Key.F3)
+                       } else if (e.Key == OpenTK.Input.Key.F2)
+                               idx--;
+                       else if (e.Key == OpenTK.Input.Key.F3)
+                               idx++;
+                       else
                                return;
+               
                        CrowInterface.ClearInterface ();
-                       idx++;
+
                        if (idx == testFiles.Length)
                                idx = 0;
+                       else if (idx < 0)
+                               idx = testFiles.Length - 1;
+                       
                        this.Title = testFiles [idx] + ". Press <F3> to cycle examples.";
                        GraphicObject obj = CrowInterface.LoadInterface(testFiles[idx]);
                        obj.DataSource = this;
index c635572677fd86447a426acf331adb3c445b5625..6c1ed6a199d10ac74c022ca84e1b4981c568c11b 100644 (file)
@@ -24,11 +24,6 @@ namespace Crow
                                RegisterForGraphicUpdate ();
                        }
                }
-               [XmlAttributeAttribute()][DefaultValue("White")]
-               public override Fill Foreground {
-                       get { return base.Foreground;}
-                       set {base.Foreground = value;}
-               }
                #endregion
 
                #region GraphicObject override
index c0cd774785ddb6030a57a03a6c11eca6c3f9ada2..efa98d1a5d532761d3be0889394efd4e33b929c6 100644 (file)
@@ -100,7 +100,7 @@ namespace Crow
 
                                //if no layouting remains in queue for item, registre for redraw
                                if (RegisteredLayoutings == LayoutingType.None && bmp == null)
-                                       RegisterForGraphicUpdate ();
+                                       Interface.CurrentInterface.EnqueueForRepaint (this);
 
                                return true;
                        }
index 92b4f906366720be1a8f35ec675733518e9d66ba..525827e0f8b217e9325ff5d07aa22ad593f9be91 100644 (file)
@@ -136,7 +136,7 @@ namespace Crow
 
                                //if no layouting remains in queue for item, registre for redraw
                                if (RegisteredLayoutings == LayoutingType.None && bmp == null)
-                                       this.RegisterForGraphicUpdate ();
+                                       Interface.CurrentInterface.EnqueueForRepaint (this);
                                
                                return true;
                        }
index 6b90b149df04753fbdd7341d169daa742ecb23a4..a334323222b66557bb126c9ae1d063c95146420f 100644 (file)
@@ -101,7 +101,7 @@ namespace Crow
                                if (value == _textAlignment)
                                        return;
                                _textAlignment = value; 
-                               RegisterForRedraw ();
+                               RegisterForGraphicUpdate ();
                                NotifyValueChanged ("TextAlignment", _textAlignment);
                        }
         }
@@ -147,7 +147,7 @@ namespace Crow
                                lines = getLines;
 
                                NotifyValueChanged ("Text", _text);
-                               this.RegisterForGraphicUpdate ();
+                               RegisterForGraphicUpdate ();
             }
         }
                [XmlAttributeAttribute][DefaultValue(false)]
@@ -596,7 +596,7 @@ namespace Crow
 
                        SelBegin = new Point(0,0);
                        SelRelease = new Point (lines.LastOrDefault ().Length, lines.Count-1);
-                       RegisterForGraphicUpdate ();
+                       RegisterForRedraw ();
                }
                public override void onUnfocused (object sender, EventArgs e)
                {
@@ -604,7 +604,7 @@ namespace Crow
 
                        SelBegin = -1;
                        SelRelease = -1;
-                       RegisterForGraphicUpdate ();
+                       RegisterForRedraw ();
                }
                public override void onMouseMove (object sender, MouseMoveEventArgs e)
                {
@@ -615,7 +615,7 @@ namespace Crow
 
                        updatemouseLocalPos (e.Position);
 
-                       RegisterForGraphicUpdate();
+                       RegisterForRedraw();
                }
                public override void onMouseDown (object sender, MouseButtonEventArgs e)
                {                       
@@ -624,7 +624,7 @@ namespace Crow
                                SelBegin = -1;
                                SelRelease = -1;
                                SelectionInProgress = true;
-                               RegisterForGraphicUpdate();//TODO:should put it in properties
+                               RegisterForRedraw();//TODO:should put it in properties
                        }          
 
                        //done at the end to set 'hasFocus' value after testing it
@@ -639,7 +639,7 @@ namespace Crow
                        
                        updatemouseLocalPos (e.Position);
                        SelectionInProgress = false;
-                       RegisterForGraphicUpdate ();
+                       RegisterForRedraw ();
                }
                #endregion
 
index 0f74eb2dd66280f6890c49d1be6aa3e2ce576ac4..b1b097c6e0682a283b4d2c6a8f106bdf03f495f5 100644 (file)
@@ -30,7 +30,7 @@ namespace Crow
 
                                minValue = value;
                                NotifyValueChanged ("Minimum", minValue);
-                               RegisterForGraphicUpdate ();
+                               RegisterForRedraw ();
                        }
                }
                [XmlAttributeAttribute()][DefaultValue(100.0)]
@@ -43,7 +43,7 @@ namespace Crow
 
                                maxValue = value;
                                NotifyValueChanged ("Maximum", maxValue);
-                               RegisterForGraphicUpdate ();
+                               RegisterForRedraw ();
                        }
                }
                [XmlAttributeAttribute()][DefaultValue(1.0)]
@@ -56,7 +56,7 @@ namespace Crow
 
                                smallStep = value;
                                NotifyValueChanged ("SmallIncrement", smallStep);
-                               RegisterForGraphicUpdate ();
+                               RegisterForRedraw ();
                        }
                }
                [XmlAttributeAttribute()][DefaultValue(5.0)]
@@ -69,7 +69,7 @@ namespace Crow
 
                                bigStep = value;
                                NotifyValueChanged ("LargeIncrement", bigStep);
-                               RegisterForGraphicUpdate ();
+                               RegisterForRedraw ();
                        }
                }
                [XmlAttributeAttribute()][DefaultValue(0.0)]
index 22b36fd2d2bde0b6c35fa52cba189fbc92054c6c..0d57cdb38cfcc81770f0a207af6354d3ca0ae327 100644 (file)
@@ -70,7 +70,7 @@ namespace Crow
                                else
                                        _scrollX = value;
                                NotifyValueChanged("ScrollX", _scrollX);
-                               RegisterForGraphicUpdate ();
+                               RegisterForRedraw ();
                                Scrolled.Raise (this, new ScrollingEventArgs (Orientation.Horizontal));
                        }
                }                       
@@ -89,7 +89,7 @@ namespace Crow
                                else
                                        _scrollY = value;
                                NotifyValueChanged("ScrollY", _scrollY);
-                               RegisterForGraphicUpdate ();
+                               RegisterForRedraw ();
                                Scrolled.Raise (this, new ScrollingEventArgs (Orientation.Vertical));
                        }
                }
index bce7497154e3f7b69c7577ef46469b6e6de3f9f7..526c275923727cce0f4c0b04f0617ccc3239ec1e 100644 (file)
@@ -65,7 +65,7 @@ namespace Crow
                                if (_cursorColor == value)
                                        return;
                                _cursorColor = value;
-                               RegisterForGraphicUpdate ();
+                               RegisterForRedraw ();
                                NotifyValueChanged ("CursorColor", _cursorColor);
                        }
                }
@@ -76,7 +76,6 @@ namespace Crow
                                if (_cursorSize == value)
                                        return;
                                _cursorSize = value;
-                               RegisterForLayouting (LayoutingType.Sizing);
                                RegisterForGraphicUpdate ();
                                NotifyValueChanged ("CursorSize", _cursorSize);
                        }
index d5a07e58fcc9454c9d3113729a9b3ee220135afd..d616ffc6a25256be8a7c1acf7b3592650de1c2b7 100644 (file)
@@ -78,7 +78,7 @@ namespace Crow
                                        (Children [selectedTab] as TabItem).IsSelected = true;
 
                                NotifyValueChanged ("SelectedTab", selectedTab);
-                               RegisterForGraphicUpdate ();
+                               RegisterForRedraw ();
                        }
                }
                [XmlAttributeAttribute()][DefaultValue(22)]
@@ -148,7 +148,7 @@ namespace Crow
 
                                //if no layouting remains in queue for item, registre for redraw
                                if (RegisteredLayoutings == LayoutingType.None && bmp == null)
-                                       RegisterForGraphicUpdate ();
+                                       Interface.CurrentInterface.EnqueueForRepaint (this);
 
                                return true;
                        }
index fc02f0d63135dbba96bd26c28b224a65490a75dd..5c3772b7fc22a52461ee0339cdd59e1fd9e3ebaa 100644 (file)
@@ -49,7 +49,7 @@ namespace Crow
             set
             {
                 base.HasFocus = value;
-                RegisterForGraphicUpdate();
+                RegisterForRedraw();
             }
         }
 
@@ -210,10 +210,6 @@ namespace Crow
                        default:
                                break;
                        }
-                       if (Width < 0)
-                               RegisterForLayouting (LayoutingType.Width);
-                       if (Height < 0)
-                               RegisterForLayouting (LayoutingType.Height);
                        RegisterForGraphicUpdate();
                }
                public override void onKeyPress (object sender, KeyPressEventArgs e)
@@ -225,10 +221,6 @@ namespace Crow
                        SelRelease = -1;
                        SelBegin = new Point(CurrentColumn, SelBegin.Y);
 
-                       if (Width < 0)
-                               RegisterForLayouting (LayoutingType.Width);
-                       if (Height < 0)
-                               RegisterForLayouting (LayoutingType.Height);
                        RegisterForGraphicUpdate();
                }
         #endregion
index 35b46f18da79d662877f9cfa04136a265ba31d66..6b6f7999240c5566a8c3f5cf7a57c9c145cacd6a 100644 (file)
@@ -55,7 +55,7 @@ namespace Crow
                                if (horizontalStretch == value)
                                        return;
                                horizontalStretch = value;
-                               RegisterForGraphicUpdate ();
+                               RegisterForRedraw ();
                                NotifyValueChanged ("HorizontalStretch", horizontalStretch);
                        }
                }
@@ -67,8 +67,8 @@ namespace Crow
                                if (verticalStretch == value)
                                        return;
                                verticalStretch = value;
+                               RegisterForRedraw ();
                                NotifyValueChanged ("VerticalStretch", verticalStretch);
-
                        }
                }
                [XmlAttributeAttribute ()]
@@ -83,8 +83,6 @@ namespace Crow
                                        return;
 
                                RegisterForGraphicUpdate ();
-                               this.RegisterForLayouting (LayoutingType.Sizing);
-
 
                                _text = value;
 
index e9ff4c0621f0e9d7eb6aacf304ff9e4098389620..fef1e48fb8b9a1a309e5cbe11bf386111e5d1731 100644 (file)
@@ -41,7 +41,7 @@ namespace Crow
                        values.Add (_value);
                        while (values.Count > nbValues)
                                values.RemoveAt (0);
-                       RegisterForGraphicUpdate ();
+                       RegisterForRedraw ();
                }
 
                public Trend ()
@@ -61,7 +61,7 @@ namespace Crow
 
                                nbValues = value;
                                NotifyValueChanged ("NbValues", minValue);
-                               RegisterForGraphicUpdate ();
+                               RegisterForRedraw ();
                        }
                }
                [XmlAttributeAttribute()][DefaultValue(0.0)]
@@ -73,7 +73,7 @@ namespace Crow
 
                                minValue = value;
                                NotifyValueChanged ("Minimum", minValue);
-                               RegisterForGraphicUpdate ();
+                               RegisterForRedraw ();
                        }
                }
                [XmlAttributeAttribute()][DefaultValue(100.0)]
@@ -86,7 +86,7 @@ namespace Crow
 
                                maxValue = value;
                                NotifyValueChanged ("Maximum", maxValue);
-                               RegisterForGraphicUpdate ();
+                               RegisterForRedraw ();
                        }
                }
                [XmlAttributeAttribute()][DefaultValue(20.0)]
@@ -119,7 +119,7 @@ namespace Crow
                                        return;
                                lowThresholdFill = value;
                                NotifyValueChanged ("LowThresholdFill", lowThresholdFill);
-                               RegisterForGraphicUpdate ();
+                               RegisterForRedraw ();
                        }
                }
                [XmlAttributeAttribute()][DefaultValue("DarkGreen")]
@@ -130,7 +130,7 @@ namespace Crow
                                        return;
                                highThresholdFill = value;
                                NotifyValueChanged ("HighThresholdFill", highThresholdFill);
-                               RegisterForGraphicUpdate ();
+                               RegisterForRedraw ();
                        }
                }
                protected override void onDraw (Cairo.Context gr)