[banshee: 28/61] Add a ReadOnly property to ColumnCellRating



commit 772d75879671eb817101fe2122c8757ede37c8fb
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Mon Oct 12 17:40:39 2009 -0700

    Add a ReadOnly property to ColumnCellRating

 .../Hyena.Gui/Hyena.Data.Gui/ColumnCellRating.cs   |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellRating.cs b/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellRating.cs
index 802c6c8..4675c69 100644
--- a/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellRating.cs
+++ b/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellRating.cs
@@ -67,6 +67,10 @@ namespace Hyena.Data.Gui
         
         public bool ButtonEvent (int x, int y, bool pressed, Gdk.EventButton evnt)
         {
+            if (ReadOnly) {
+                return false;
+            }
+
             if (pressed) {
                 last_pressed_bound = BoundObjectParent;
                 return false;
@@ -82,6 +86,10 @@ namespace Hyena.Data.Gui
         
         public bool MotionEvent (int x, int y, Gdk.EventMotion evnt)
         {
+            if (ReadOnly) {
+                return false;
+            }
+
             int value = RatingFromPosition (x);
         
             if (hover_bound == BoundObjectParent && value == hover_value) {
@@ -144,5 +152,7 @@ namespace Hyena.Data.Gui
             get { return renderer.Ypad; }
             set { renderer.Ypad = value; }
         }
+
+        public bool ReadOnly { get; set; }
     }
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]