[POS-commit] r175 - in Kiwi2: . Kiwi2/Widgets gazpacho-plugin

Gustavo Matheus Rahal gustavo at async.com.br
Tue Mar 22 17:50:50 BRT 2005


Author: gustavo
Date: 2005-03-22 17:50:49 -0300 (Tue, 22 Mar 2005)
New Revision: 175

Added:
   Kiwi2/Kiwi2/Widgets/CheckButton.py
Modified:
   Kiwi2/ChangeLog
   Kiwi2/Kiwi2/Widgets/__init__.py
   Kiwi2/gazpacho-plugin/kiwi2.xml
Log:
	* Kiwi2/Widgets/CheckButton.py: added Checkbutton kiwi widget
	* Kiwi2/Widgets/__init__.py: support for Checkbutton
	* kiwi2.xml: added checkbutton to gazpacho-plugin

Modified: Kiwi2/ChangeLog
===================================================================
--- Kiwi2/ChangeLog	2005-03-22 20:10:40 UTC (rev 174)
+++ Kiwi2/ChangeLog	2005-03-22 20:50:49 UTC (rev 175)
@@ -1,3 +1,9 @@
+2005-03-22 Gustavo Rahal <gustavo at async.com.br>
+
+	* Kiwi2/Widgets/CheckButton.py: added Checkbutton kiwi widget
+	* Kiwi2/Widgets/__init__.py: support for Checkbutton
+	* kiwi2.xml: added checkbutton to gazpacho-plugin
+
 2005-03-22  Johan Dahlin  <jdahlin at async.com.br>
 
 	* Kiwi2/Widgets/ComboBox.py

Added: Kiwi2/Kiwi2/Widgets/CheckButton.py
===================================================================
--- Kiwi2/Kiwi2/Widgets/CheckButton.py	2005-03-22 20:10:40 UTC (rev 174)
+++ Kiwi2/Kiwi2/Widgets/CheckButton.py	2005-03-22 20:50:49 UTC (rev 175)
@@ -0,0 +1,51 @@
+#!/usr/bin/env python
+#
+# Kiwi: a Framework and Enhanced Widgets for Python
+#
+# Copyright (C) 2003-2004 Async Open Source
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+# 
+# This library 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
+# Lesser General Public License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+# USA
+# 
+# Author(s): Christian Reis <kiko at async.com.br>
+#
+
+from Kiwi2.initgtk import gtk, gobject
+from Kiwi2.Widgets.WidgetProxy import WidgetProxyMixin, implementsIProxy
+from Kiwi2.utils import gsignal
+
+class CheckButton(gtk.CheckButton, WidgetProxyMixin):
+    implementsIProxy()
+    gsignal('toggled', 'override')
+    
+    def __init__(self):
+        gtk.CheckButton.__init__(self)
+        WidgetProxyMixin.__init__(self)
+        self.set_property("data-type", "bool")
+
+    def do_toggled(self):
+        self.emit('content-changed')
+        self.chain()
+        
+    def read(self):
+        return self.get_active()
+
+    def update(self, data):
+        # first, trigger some basic validation
+        WidgetProxyMixin.update(self, data)
+        
+        self.set_active(data)
+
+gobject.type_register(CheckButton)

Modified: Kiwi2/Kiwi2/Widgets/__init__.py
===================================================================
--- Kiwi2/Kiwi2/Widgets/__init__.py	2005-03-22 20:10:40 UTC (rev 174)
+++ Kiwi2/Kiwi2/Widgets/__init__.py	2005-03-22 20:50:49 UTC (rev 175)
@@ -38,3 +38,4 @@
 from Entry import Entry
 from Label import Label
 from ComboBox import ComboBox, ComboBoxEntry
+from CheckButton import CheckButton

Modified: Kiwi2/gazpacho-plugin/kiwi2.xml
===================================================================
--- Kiwi2/gazpacho-plugin/kiwi2.xml	2005-03-22 20:10:40 UTC (rev 174)
+++ Kiwi2/gazpacho-plugin/kiwi2.xml	2005-03-22 20:50:49 UTC (rev 175)
@@ -2,7 +2,7 @@
 <glade-catalog name="kiwi2"
                library="kiwi2"
                libglade-module="Kiwi2.Widgets"
-               resource-path="/home/lgs/Kiwi2/gazpacho-plugin">
+               resource-path="/home/gustavo/devel/Kiwi2/gazpacho-plugin">
   <glade-widget-classes>
     <glade-widget-class name="Kiwi2+Widgets+List+List"
                         generic-name="kiwilist"
@@ -22,6 +22,7 @@
         </property>
       </properties>
     </glade-widget-class>
+
     <glade-widget-class name="Kiwi2+Widgets+Entry+Entry"
                         generic-name="kiwientry"
                         title="Kiwi Entry" >
@@ -40,7 +41,7 @@
           </editor>
 
         </property>
-	<property id="model-attribute"
+	    <property id="model-attribute"
                   name="Model Attribute"
                   translatable="False" />
 
@@ -65,7 +66,7 @@
           </editor>
 
         </property>
-	<property id="model-attribute"
+	    <property id="model-attribute"
                   name="Model Attribute"
                   translatable="False" />
 
@@ -79,6 +80,23 @@
         <!-- These properties are buggie in GTK+ 2.4 -->
         <property id="column-span-column" disabled="True" />
         <property id="row-span-column" disabled="True" />
+    	<property id="model-attribute"
+                  name="Model Attribute"
+                  translatable="False" />
+        <property id="data-type"
+                  name="Data Type"
+                  translatable="False"
+                  adaptor-class="DataTypeAdaptor">
+          <type>String</type>
+          <function name="get" type="ignore"/>
+          <function name="set" type="override"/>
+          <editor>
+            <function name="create" type="override"/>
+            <function name="update" type="override"/>
+          </editor>
+
+        </property>
+
       </properties>
     </glade-widget-class>
 
@@ -89,19 +107,55 @@
         <!-- These properties are buggie in GTK+ 2.4 -->
         <property id="column-span-column" disabled="True" />
         <property id="row-span-column" disabled="True" />
+    	<property id="model-attribute"
+                  name="Model Attribute"
+                  translatable="False" />
+        <property id="data-type"
+                  name="Data Type"
+                  translatable="False"
+                  adaptor-class="DataTypeAdaptor">
+          <type>String</type>
+          <function name="get" type="ignore"/>
+          <function name="set" type="override"/>
+          <editor>
+            <function name="create" type="override"/>
+            <function name="update" type="override"/>
+          </editor>
 
+        </property>
         <property id="text-column" disabled="True" />
       </properties>
     </glade-widget-class>
 
-  </glade-widget-classes>
+  <glade-widget-class name="Kiwi2+Widgets+CheckButton+CheckButton"
+                        generic-name="kiwicheckbutton"
+                        title="Kiwi Check Button">
+      <properties>
 
+        <property id="data-type"
+                  name="Data Type"
+                  translatable="False"
+                  default="bool"
+                  editable="False">
+        </property>
+    	<property id="model-attribute"
+                  name="Model Attribute"
+                  translatable="False" />
+
+        
+     </properties>
+    </glade-widget-class>
+
+</glade-widget-classes>
+
   <glade-widget-group name="kiwi2" title="Kiwi Widgets">
     <glade-widget-class-ref name="Kiwi2+Widgets+Entry+Entry"/>
     <glade-widget-class-ref name="Kiwi2+Widgets+Label+Label"/>
     <glade-widget-class-ref name="Kiwi2+Widgets+ComboBox+ComboBox"/>
     <glade-widget-class-ref name="Kiwi2+Widgets+ComboBox+ComboBoxEntry"/>
     <glade-widget-class-ref name="Kiwi2+Widgets+List+List"/>
+    <glade-widget-class-ref name="Kiwi2+Widgets+CheckButton+CheckButton"/>
+
   </glade-widget-group>
   
 </glade-catalog>



More information about the POS-commit mailing list