Validatedmaskedentry works somewhat, but no icon to be seen.

ComboxEntry needs focus to work


svn: r19885
This commit is contained in:
Benny Malengier 2012-06-20 00:17:39 +00:00
parent 9929a355ab
commit 6dd1c0e3c2
16 changed files with 379 additions and 242 deletions

View File

@ -139,17 +139,15 @@ class StandardCustomSelector(object):
# create combo box entry
if cbe:
assert cbe.get_has_entry()
self.selector = cbe
self.selector.set_model(self.store)
renderer = Gtk.CellRendererText()
self.selector.pack_start(renderer, True)
self.selector.add_attribute(renderer, 'text', 1)
else:
self.selector = Gtk.ComboBox(has_entry=True)
self.selector.set_model(self.store)
renderer = Gtk.CellRendererText()
self.selector.pack_start(renderer, True)
self.selector.add_attribute(renderer, 'text', 1)
self.selector.set_model(self.store)
self.selector.set_entry_text_column(1)
#renderer = Gtk.CellRendererText()
#self.selector.pack_start(renderer, True)
#self.selector.add_attribute(renderer, 'text', 1)
if self.active_key is not None:
self.selector.set_active(self.active_index)

View File

@ -106,7 +106,8 @@ Note: several predefined attributes refer to values present in the GEDCOM standa
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry" id="attr_menu-entry">
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="overwrite_mode">True</property>
</object>
</child>
</object>

View File

@ -42,7 +42,8 @@
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry" id="mrel-entry">
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="overwrite_mode">True</property>
</object>
</child>
</object>

View File

@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<!-- interface-naming-policy toplevel-contextual -->
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">31</property>
<property name="step_increment">1</property>
@ -25,23 +23,100 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkListStore" id="calendar_model">
<columns>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkDialog" id="dateedit">
<property name="can_focus">False</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkVBox" id="vbox86">
<object class="GtkBox" id="vbox86">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="hbuttonbox36">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button174">
<property name="label">gtk-help</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button175">
<property name="label">gtk-cancel</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button176">
<property name="label">gtk-ok</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox87">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkVBox" id="vbox88">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkHBox" id="hbox95">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="label404">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Calenda_r:</property>
<property name="use_underline">True</property>
@ -49,6 +124,7 @@
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">6</property>
<property name="position">0</property>
</packing>
@ -56,6 +132,7 @@
<child>
<object class="GtkComboBox" id="calendar_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="model">calendar_model</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext1"/>
@ -65,6 +142,8 @@
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="padding">6</property>
<property name="position">1</property>
</packing>
@ -72,6 +151,7 @@
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">6</property>
<property name="position">0</property>
</packing>
@ -79,9 +159,11 @@
<child>
<object class="GtkHBox" id="hbox145">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="label718">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
@ -93,11 +175,14 @@
<child>
<object class="GtkCheckButton" id="dualdated">
<property name="label" translatable="yes">Dua_l dated</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Old Style/New Style</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0.5</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@ -109,6 +194,7 @@
<child>
<object class="GtkLabel" id="label717">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Ne_w year begins: </property>
<property name="use_underline">True</property>
@ -116,6 +202,8 @@
<property name="mnemonic_widget">newyear</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
@ -126,11 +214,15 @@
<accelerator key="w" signal="grab_focus" modifiers="GDK_MOD1_MASK"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="padding">6</property>
<property name="position">1</property>
</packing>
@ -138,13 +230,33 @@
<child>
<object class="GtkTable" id="table48">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="n_rows">5</property>
<property name="n_columns">8</property>
<property name="column_spacing">6</property>
<property name="row_spacing">6</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkLabel" id="label413">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="xpad">6</property>
<property name="label" translatable="yes">&lt;b&gt;Q_uality&lt;/b&gt;</property>
@ -161,7 +273,7 @@
<child>
<object class="GtkComboBoxText" id="quality_box">
<property name="visible">True</property>
<property name="model">quality_model</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext2"/>
<attributes>
@ -183,6 +295,7 @@
<child>
<object class="GtkLabel" id="label414">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="xpad">6</property>
<property name="label" translatable="yes">&lt;b&gt;_Type&lt;/b&gt;</property>
@ -200,7 +313,7 @@
<child>
<object class="GtkComboBoxText" id="type_box">
<property name="visible">True</property>
<property name="model">type_model</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext3"/>
<attributes>
@ -222,6 +335,7 @@
<child>
<object class="GtkLabel" id="label411">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="xpad">6</property>
<property name="label" translatable="yes">&lt;b&gt;Date&lt;/b&gt;</property>
@ -238,6 +352,7 @@
<child>
<object class="GtkLabel" id="label410">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Day</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">start_day</property>
@ -254,6 +369,7 @@
<child>
<object class="GtkLabel" id="label409">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Month</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">start_month_box</property>
@ -270,6 +386,7 @@
<child>
<object class="GtkLabel" id="label408">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Year</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">start_year</property>
@ -303,7 +420,7 @@
<child>
<object class="GtkComboBoxText" id="start_month_box">
<property name="visible">True</property>
<property name="model">month_model1</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext4"/>
<attributes>
@ -340,6 +457,7 @@
<child>
<object class="GtkLabel" id="label412">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="xpad">6</property>
<property name="label" translatable="yes">&lt;b&gt;Second date&lt;/b&gt;</property>
@ -357,6 +475,7 @@
<child>
<object class="GtkLabel" id="label407">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">D_ay</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">stop_day</property>
@ -373,6 +492,7 @@
<child>
<object class="GtkLabel" id="label406">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Mo_nth</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">stop_month_box</property>
@ -389,6 +509,7 @@
<child>
<object class="GtkLabel" id="label405">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Y_ear</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">stop_year</property>
@ -422,7 +543,7 @@
<child>
<object class="GtkComboBoxText" id="stop_month_box">
<property name="visible">True</property>
<property name="model">month_model2</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext5"/>
<attributes>
@ -456,24 +577,6 @@
<property name="x_padding">6</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
@ -485,9 +588,11 @@
<child>
<object class="GtkHBox" id="hbox96">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="label415">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Te_xt comment:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">date_text_entry</property>
@ -505,79 +610,31 @@
<property name="can_focus">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="padding">6</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="hbuttonbox36">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button174">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button175">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button176">
<property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
@ -588,9 +645,15 @@
<action-widget response="-5">button176</action-widget>
</action-widgets>
</object>
<object class="GtkListStore" id="calendar_model">
<object class="GtkListStore" id="month_model1">
<columns>
<!-- column-name gchararray1 -->
<!-- column-name gchararray5 -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkListStore" id="month_model2">
<columns>
<!-- column-name gchararray6 -->
<column type="gchararray"/>
</columns>
</object>
@ -606,16 +669,4 @@
<column type="gchararray"/>
</columns>
</object>
<object class="GtkListStore" id="month_model2">
<columns>
<!-- column-name gchararray6 -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkListStore" id="month_model1">
<columns>
<!-- column-name gchararray5 -->
<column type="gchararray"/>
</columns>
</object>
</interface>

View File

@ -1,26 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires grampswidgets 0.0 -->
<!-- interface-naming-policy project-wide -->
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkDialog" id="editevent">
<property name="can_focus">False</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox11">
<object class="GtkBox" id="dialog-vbox11">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area11">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button111">
<property name="label">gtk-cancel</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup">Close window without changes</property>
<property name="tooltip_text" translatable="yes">Close window without changes</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="ok">
<property name="label">gtk-ok</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup">Accept changes and close window</property>
<property name="tooltip_text" translatable="yes">Accept changes and close window</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button126">
<property name="label">gtk-help</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkTable" id="table21">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">12</property>
<property name="n_rows">4</property>
<property name="n_columns">5</property>
<property name="column_spacing">12</property>
<property name="row_spacing">4</property>
<child>
<placeholder/>
</child>
<child>
<object class="GtkLabel" id="label154">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Event type:</property>
<property name="use_underline">True</property>
@ -35,6 +114,7 @@
<child>
<object class="GtkLabel" id="label155">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Date:</property>
<property name="use_underline">True</property>
@ -50,11 +130,13 @@
</child>
<child>
<object class="GtkButton" id="date_stat">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Invoke date editor</property>
<property name="use_action_appearance">False</property>
<property name="relief">none</property>
<accelerator key="d" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<accessibility>
@ -68,6 +150,7 @@
<child>
<object class="GtkImage" id="date_stat_child">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Show Date Editor</property>
<property name="icon_name">gramps-date</property>
@ -89,6 +172,7 @@
<child>
<object class="GtkLabel" id="label156">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">De_scription:</property>
<property name="use_underline">True</property>
@ -104,9 +188,11 @@
</child>
<child>
<object class="GtkToggleButton" id="private">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="relief">none</property>
<accelerator key="p" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<child internal-child="accessible">
@ -117,6 +203,7 @@
<child>
<object class="GtkImage" id="image2674">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">gtk-dialog-authentication</property>
<child internal-child="accessible">
<object class="AtkObject" id="image2674-atkobject">
@ -153,6 +240,7 @@
<child>
<object class="GtkLabel" id="label157">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="ypad">3</property>
<property name="label" translatable="yes">_Place:</property>
@ -169,14 +257,17 @@
</child>
<child>
<object class="GtkButton" id="add_del_place">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="relief">none</property>
<accelerator key="a" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<child>
<object class="GtkImage" id="image2699">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
</object>
@ -192,21 +283,27 @@
<child>
<object class="GtkHBox" id="hbox130">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="place">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="ellipsize">end</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="select_place">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="relief">none</property>
<accelerator key="s" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<accessibility>
@ -220,6 +317,7 @@
<child>
<object class="GtkImage" id="image2700">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">gtk-index</property>
<child internal-child="accessible">
<object class="AtkObject" id="image2700-atkobject">
@ -248,13 +346,15 @@
<child>
<object class="GtkComboBox" id="personal_events">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">What type of event this is. Eg 'Burial', 'Graduation', ... .</property>
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry" id="personal_events-entry">
<property name="can_focus">False</property>
</object>
</child>
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry" id="personal_events-entry">
<property name="can_focus">True</property>
<property name="overwrite_mode">True</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">1</property>
@ -266,6 +366,7 @@
<child>
<object class="GtkLabel" id="label656">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_ID:</property>
<property name="use_underline">True</property>
@ -304,11 +405,9 @@
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
@ -318,72 +417,11 @@
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area11">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button111">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup">Close window without changes</property>
<property name="tooltip_text" translatable="yes">Close window without changes</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="ok">
<property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup">Accept changes and close window</property>
<property name="tooltip_text" translatable="yes">Accept changes and close window</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button126">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
<action-widgets>

View File

@ -91,7 +91,8 @@
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry" id="eer_role_combo-entry">
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="overwrite_mode">True</property>
</object>
</child>
</object>
@ -354,7 +355,8 @@
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry" id="eer_type_combo-entry">
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="overwrite_mode">True</property>
</object>
</child>
</object>

View File

@ -636,7 +636,8 @@
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry" id="marriage_type-entry">
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="overwrite_mode">True</property>
</object>
</child>
</object>

View File

@ -42,7 +42,8 @@
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry" id="ntype-entry">
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="overwrite_mode">True</property>
</object>
</child>
</object>

View File

@ -82,7 +82,8 @@
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry" id="type-entry">
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="overwrite_mode">True</property>
</object>
</child>
</object>

View File

@ -345,7 +345,8 @@
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry" id="ntype-entry">
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="overwrite_mode">True</property>
</object>
</child>
</object>
@ -644,7 +645,8 @@ Indicate that the surname consists of different parts. Every surname has its own
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry" id="cmborigin-entry">
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="overwrite_mode">True</property>
</object>
</child>
</object>

View File

@ -79,7 +79,8 @@
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry" id="media_type-entry">
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="overwrite_mode">True</property>
</object>
</child>
</object>
@ -333,7 +334,8 @@
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry" id="repo_type-entry">
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="overwrite_mode">True</property>
</object>
</child>
</object>

View File

@ -74,7 +74,8 @@
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry" id="repository_type-entry">
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="overwrite_mode">True</property>
</object>
</child>
</object>

View File

@ -103,7 +103,8 @@
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry" id="type-entry">
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="overwrite_mode">True</property>
</object>
</child>
</object>

View File

@ -364,7 +364,7 @@ class FlatNodeMap(object):
:param srtkey_hndl: the (sortkey, handle) tuple that must be inserted
:Returns: path of the row inserted in the treeview
:Returns type: integer or None
:Returns type: Gtk.TreePath or None
"""
if srtkey_hndl[1] in self._hndl2index:
print ('WARNING: Attempt to add row twice to the model (%s)' %
@ -385,7 +385,7 @@ class FlatNodeMap(object):
#update self.__corr so it remains correct
if self._reverse:
self.__corr = (len(self._index2hndl) - 1, -1)
return self.real_path(insert_pos)
return Gtk.TreePath((self.real_path(insert_pos),))
def delete(self, srtkey_hndl):
"""
@ -398,7 +398,7 @@ class FlatNodeMap(object):
:param srtkey_hndl: the (sortkey, handle) tuple that must be inserted
:Returns: path of the row deleted from the treeview
:Returns type: integer or None
:Returns type: Gtk.TreePath or None
"""
#remove it from the full list first
if not self._identical:
@ -425,7 +425,7 @@ class FlatNodeMap(object):
for key, val in self._hndl2index.iteritems():
if val > index:
self._hndl2index[key] -= 1
return delpath
return Gtk.TreePath((delpath,))
#-------------------------------------------------------------------------
#
@ -647,7 +647,7 @@ class FlatBaseModel(GObject.Object, Gtk.TreeModel):
insert_path = self.node_map.insert(insert_val)
if insert_path is not None:
node = self.get_iter(insert_path)
node = self.do_get_iter(insert_path)
self.row_inserted(insert_path, node)
else:
self.node_map.insert(insert_val, allkeyonly=True)
@ -683,7 +683,7 @@ class FlatBaseModel(GObject.Object, Gtk.TreeModel):
else:
#the row is visible in the view, is changed, but the order is fixed
path = self.node_map.get_path_from_handle(handle)
node = self.get_iter(path)
node = self.do_get_iter(path)[1]
self.row_changed(path, node)
def handle2path(self, handle):

View File

@ -421,8 +421,8 @@ class MonitoredDataType(object):
"""
Constructor for the MonitoredDataType class.
@param obj: Existing ComboBoxEntry widget to use.
@type obj: Gtk.ComboBoxEntry
@param obj: Existing ComboBox widget to use with has_entry=True.
@type obj: Gtk.ComboBox
@param set_val: The function that sets value of the type in the object
@type set_val: method
@param get_val: The function that gets value of the type in the object.

View File

@ -198,15 +198,20 @@ class Tooltip(Gtk.Window):
def _calculate_pos(self, widget):
screen = widget.get_screen()
w, h = self.size_request()
greq = Gtk.Requisition()
greq = self.size_request()
w = greq.width
h = greq.height
x, y = widget.window.get_origin()
_, x, y = widget.get_window().get_origin()
if widget.flags() & Gtk.NO_WINDOW:
x += widget.allocation.x
y += widget.allocation.y
# TODO GTK3 No longer WidgetFlags!
#if widget.get_state_flags() & Gtk.WidgetFlags.NO_WINDOW:
x += widget.get_allocation().width
y += widget.get_allocation().height
x = screen.get_root_window().get_pointer()[0]
x = screen.get_root_window().get_pointer()[1]
#TODO GTK3, how: x = screen.get_window().get_device_position()[0]
x -= (w / 2 + Tooltip.BORDER_WIDTH)
pointer_screen, px, py, _ = screen.get_display().get_pointer()
@ -222,21 +227,26 @@ class Tooltip(Gtk.Window):
elif x < monitor.x:
x = monitor.x
if ((y + h + widget.allocation.height + Tooltip.BORDER_WIDTH) >
if ((y + h + widget.get_allocation().height + Tooltip.BORDER_WIDTH) >
monitor.y + monitor.height):
y -= h + Tooltip.BORDER_WIDTH
else:
y += widget.allocation.height + Tooltip.BORDER_WIDTH
y += widget.get_allocation().height + Tooltip.BORDER_WIDTH
return x, y
# from gtktooltips.c:gtk_tooltips_paint_window
def _on__draw_event(self, window, cairo_context):
w, h = window.size_request()
window.get_style().paint_flat_box(window.window,
Gtk.StateType.NORMAL, Gtk.ShadowType.OUT,
None, window, "tooltip",
0, 0, w, h)
#GTK3 TODO, paint_flat_box deprecated !!
greq = self.size_request()
w = greq.width
h = greq.height
Gtk.render_frame(window.get_style_context(), cairo_context,
0,0,w,h)
#window.get_style().paint_flat_box(window.window,
# Gtk.StateType.NORMAL, Gtk.ShadowType.OUT,
# None, window, "tooltip",
# 0, 0, w, h)
return False
def _real_display(self, widget):
@ -374,8 +384,8 @@ class IconEntry(object):
if not isinstance(pixbuf, GdkPixbuf.Pixbuf):
raise TypeError("pixbuf must be a GdkPixbuf")
else:
# Turning of the icon should also restore the background
entry.modify_base(Gtk.StateType.NORMAL, None)
# Turning off the icon should also restore the background
entry.override_background_color(Gtk.StateType.NORMAL, None)
if not self._pixbuf:
return
self._pixbuf = pixbuf
@ -412,7 +422,7 @@ class IconEntry(object):
entry.realize()
# Hack: Save a reference to the text area, now when its created
self._text_area = entry.get_root_window().get_children()[0]
self._text_area = entry.get_window().get_children()[0]
self._text_area_pos = self._text_area.get_position()
# PyGTK should allow default values for most of the values here.
@ -441,7 +451,8 @@ class IconEntry(object):
Gdk.WindowAttributesType.VISUAL |
Gdk.WindowAttributesType.NOREDIR
)
win = Gdk.Window(entry.get_root_window(),
#the window containing the icon image
win = Gdk.Window(entry.get_window(),
attr,
attrmask)
## Gdk.WindowType.CHILD,
@ -459,17 +470,15 @@ class IconEntry(object):
## wmclass_class='', override_redirect=True)
self._icon_win = win
win.set_user_data(entry)
win.set_background(entry.get_style().base[entry.get_state()])
#win.set_background(entry.get_style().base[entry.get_state()])
self._constructed = True
def deconstruct(self):
if self._icon_win:
# This is broken on PyGTK 2.6.x
try:
self._icon_win.set_user_data(None)
except:
pass
self._icon_win.set_user_data(None)
# Destroy not needed, called by the GC.
# TODO GTK3: we see error: Gdk-WARNING **: losing last reference to undestroyed window
# TODO Investigate
self._icon_win = None
def update_background(self, color):
@ -478,12 +487,27 @@ class IconEntry(object):
if not self._icon_win:
return
self._entry.modify_base(Gtk.StateType.NORMAL, color)
maxvalcol = 65535.
if color:
red = int(color.red/ maxvalcol*255)
green = int(color.green/ maxvalcol*255)
blue = int(color.blue/ maxvalcol*255)
rgba = Gdk.RGBA()
Gdk.RGBA.parse(rgba, 'rgb(%f,%f,%f)'%(red, green, blue))
self._entry.override_background_color(Gtk.StateType.NORMAL, rgba)
else:
self._entry.override_background_color(Gtk.StateType.NORMAL, None)
self.draw_pixbuf()
def get_background(self):
return self._entry.get_style().base[Gtk.StateType.NORMAL]
""" Return default background color as a Gdk.Color """
backcol = self._entry.get_style_context().get_background_color(Gtk.StateType.NORMAL)
bcol= Gdk.Color.parse('#fff')[1]
bcol.red = int(backcol.red * 65535)
bcol.green = int(backcol.green * 65535)
bcol.blue = int(backcol.blue * 65535)
return bcol
def resize_windows(self):
if not self._pixbuf:
@ -492,11 +516,15 @@ class IconEntry(object):
icony = iconx = 4
# Make space for the icon, both windows
winw = self._entry.get_root_window().get_width()
textw = self._text_area.get_width()
texth = self._text_area.get_height()
#textw, texth = self._text_area.get_size()
textw = winw - self._pixw - (iconx + icony)
# GTK 3 gives for entry the sizes for the entire editor
geom =self._text_area.get_geometry()
origx = geom[0]
origy = geom[1]
origw = geom[2]
origh = geom[3]
textw = origw
texth = origh
textw = textw - self._pixw - (iconx + icony)
if self._pos == Gtk.PositionType.LEFT:
textx, texty = self._text_area_pos
@ -519,9 +547,10 @@ class IconEntry(object):
# If the size of the window is large enough, resize and move it
# Otherwise just move it to the right side of the entry
if (icon_win.get_width(), icon_win.get_height()) != (self._pixw, self._pixh):
icon_win.move_resize(iconx, icony, self._pixw, self._pixh)
icon_win.move_resize(origx + origw - self._pixw, icony + origy, 100, 100)
icon_win.move_resize(origx + origw - self._pixw, icony + origy, self._pixw, self._pixh)
else:
icon_win.move(iconx, icony)
icon_win.move(origx + origw - self._pixw, icony + origy)
def draw_pixbuf(self):
if not self._pixbuf:
@ -533,15 +562,21 @@ class IconEntry(object):
return
# Draw background first
color = self._entry.get_style().base_gc[self._entry.get_state()]
win.draw_rectangle(color, True,
0, 0, self._pixw, self._pixh)
color = self._entry.get_style_context().get_background_color(
self._entry.get_state())
## TODO GTK3 no more draw_rectangle
cairo_t = Gdk.cairo_create(win)
Gdk.cairo_set_source_rgba(cairo_t, color)
#win.draw_rectangle(color, True,
# 0, 0, self._pixw, self._pixh)
# If sensitive draw the icon, regardless of the window emitting the
# event since makes it a bit smoother on resize
if self._entry.flags() & Gtk.SENSITIVE:
win.draw_pixbuf(None, self._pixbuf, 0, 0, 0, 0,
self._pixw, self._pixh)
if self._entry.get_sensitive():
Gdk.cairo_set_source_pixbuf(cairo_t, self._pixbuf, 0, 0)
#TODO GTK3: win not visible under red/white part of gtkEntry, no icon also!
#TODO GTK3: deprecate the icon? Use button indication on edit date button?
win.show()
def _update_position(self):
if self._entry.get_property('xalign') > 0.5:
@ -649,6 +684,7 @@ class MaskedEntry(UndoableEntry):
self._block_insert = False
self._block_delete = False
self.in_do_draw = False
# Virtual methods, note do_size_alloc needs gtk 2.9 +
def do_size_allocate(self, allocation):
@ -658,9 +694,10 @@ class MaskedEntry(UndoableEntry):
self._icon.resize_windows()
def do_draw(self, cairo_t):
#TODO GTK3: It seems this is called in a loop, test, add print here
Gtk.Entry.do_draw(self, cairo_t)
if Gtk.cairo_should_draw_window(cairo_t, self.get_root_window()):
if Gtk.cairo_should_draw_window(cairo_t, self.get_window()):
self._icon.draw_pixbuf()
def do_realize(self):
@ -939,7 +976,7 @@ class MaskedEntry(UndoableEntry):
else:
match_func = self._completion_normal_match_func
completion = self._get_completion()
completion.set_match_func(match_func)
completion.set_match_func(match_func, None)
def is_empty(self):
text = self.get_text()
@ -1035,7 +1072,7 @@ class MaskedEntry(UndoableEntry):
content = model[iter][COL_TEXT]
return content.startswith(self.get_text())
def _completion_normal_match_func(self, completion, key, iter):
def _completion_normal_match_func(self, completion, key, iter, data=None):
model = completion.get_model()
if not len(model):
return
@ -1043,7 +1080,7 @@ class MaskedEntry(UndoableEntry):
content = model[iter][COL_TEXT].lower()
return key.lower() in content
def _on_completion__match_selected(self, completion, model, iter):
def _on_completion__match_selected(self, completion, model, iter, data=None):
if not len(model):
return