SourceForge logo
SourceForge logo
Menu

matplotlib-checkins — Commit notification. DO NOT POST to this list, just subscribe to it.

You can subscribe to this list here.

2007 Jan
Feb
Mar
Apr
May
Jun
Jul
(115)
Aug
(120)
Sep
(137)
Oct
(170)
Nov
(461)
Dec
(263)
2008 Jan
(120)
Feb
(74)
Mar
(35)
Apr
(74)
May
(245)
Jun
(356)
Jul
(240)
Aug
(115)
Sep
(78)
Oct
(225)
Nov
(98)
Dec
(271)
2009 Jan
(132)
Feb
(84)
Mar
(74)
Apr
(56)
May
(90)
Jun
(79)
Jul
(83)
Aug
(296)
Sep
(214)
Oct
(76)
Nov
(82)
Dec
(66)
2010 Jan
(46)
Feb
(58)
Mar
(51)
Apr
(77)
May
(58)
Jun
(126)
Jul
(128)
Aug
(64)
Sep
(50)
Oct
(44)
Nov
(48)
Dec
(54)
2011 Jan
(68)
Feb
(52)
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
(1)
2018 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S





1
2
(4)
3
(2)
4
(9)
5
6
7
8
9
10
11
(6)
12
13
14
15
16
(10)
17
(1)
18
19
(1)
20
21
22
(3)
23
24
25
(2)
26
27
28
(3)
29
(5)
30
31






Showing 1 results of 1

Revision: 8091
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8091&view=rev
Author: jdh2358
Date: 2010年01月17日 01:42:30 +0000 (2010年1月17日)
Log Message:
-----------
added Goekhan's apply patch to qt editor
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backends/qt4_editor/figureoptions.py
 trunk/matplotlib/lib/matplotlib/backends/qt4_editor/formlayout.py
Modified: trunk/matplotlib/lib/matplotlib/backends/qt4_editor/figureoptions.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/qt4_editor/figureoptions.py	2010年01月16日 23:14:50 UTC (rev 8090)
+++ trunk/matplotlib/lib/matplotlib/backends/qt4_editor/figureoptions.py	2010年01月17日 01:42:30 UTC (rev 8091)
@@ -112,43 +112,46 @@
 datalist = [(general, "Axes", "")]
 if has_curve:
 datalist.append((curves, "Curves", ""))
- result = formlayout.fedit(datalist, title="Figure options", parent=parent,
- icon=get_icon('qt4_editor_options.svg'))
- if result is None:
- return
-
- if has_curve:
- general, curves = result
- else:
- general, = result
-
- # Set / General
- title, xmin, xmax, xlabel, xscale, ymin, ymax, ylabel, yscale = general
- axes.set_xscale(xscale)
- axes.set_yscale(yscale)
- axes.set_title(title)
- axes.set_xlim(xmin, xmax)
- axes.set_xlabel(xlabel)
- axes.set_ylim(ymin, ymax)
- axes.set_ylabel(ylabel)
-
- if has_curve:
- # Set / Curves
- for index, curve in enumerate(curves):
- line = linedict[curvelabels[index]]
- label, linestyle, linewidth, color, \
- marker, markersize, markerfacecolor, markeredgecolor = curve
- line.set_label(label)
- line.set_linestyle(linestyle)
- line.set_linewidth(linewidth)
- line.set_color(color)
- if marker is not 'none':
- line.set_marker(marker)
- line.set_markersize(markersize)
- line.set_markerfacecolor(markerfacecolor)
- line.set_markeredgecolor(markeredgecolor)
-
- # Redraw
- figure = axes.get_figure()
- figure.canvas.draw()
-
+ 
+ def apply_callback(data):
+ """This function will be called to apply changes"""
+ if has_curve:
+ general, curves = data
+ else:
+ general, = data
+ 
+ # Set / General
+ title, xmin, xmax, xlabel, xscale, ymin, ymax, ylabel, yscale = general
+ axes.set_xscale(xscale)
+ axes.set_yscale(yscale)
+ axes.set_title(title)
+ axes.set_xlim(xmin, xmax)
+ axes.set_xlabel(xlabel)
+ axes.set_ylim(ymin, ymax)
+ axes.set_ylabel(ylabel)
+ 
+ if has_curve:
+ # Set / Curves
+ for index, curve in enumerate(curves):
+ line = linedict[curvelabels[index]]
+ label, linestyle, linewidth, color, \
+ marker, markersize, markerfacecolor, markeredgecolor = curve
+ line.set_label(label)
+ line.set_linestyle(linestyle)
+ line.set_linewidth(linewidth)
+ line.set_color(color)
+ if marker is not 'none':
+ line.set_marker(marker)
+ line.set_markersize(markersize)
+ line.set_markerfacecolor(markerfacecolor)
+ line.set_markeredgecolor(markeredgecolor)
+ 
+ # Redraw
+ figure = axes.get_figure()
+ figure.canvas.draw()
+ 
+ data = formlayout.fedit(datalist, title="Figure options", parent=parent,
+ icon=get_icon('qt4_editor_options.svg'), apply=apply_callback)
+ if data is not None:
+ apply_callback(data)
+ 
Modified: trunk/matplotlib/lib/matplotlib/backends/qt4_editor/formlayout.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/qt4_editor/formlayout.py	2010年01月16日 23:14:50 UTC (rev 8090)
+++ trunk/matplotlib/lib/matplotlib/backends/qt4_editor/formlayout.py	2010年01月17日 01:42:30 UTC (rev 8091)
@@ -33,7 +33,11 @@
 OTHER DEALINGS IN THE SOFTWARE.
 """
 
-__version__ = '1.0.5'
+# History:
+# 1.0.7: added support for "Apply" button
+# 1.0.6: code cleaning
+
+__version__ = '1.0.7'
 __license__ = __doc__
 
 DEBUG = False
@@ -67,21 +71,21 @@
 QPushButton.__init__(self, parent)
 self.setFixedSize(20, 20)
 self.setIconSize(QSize(12, 12))
- self.connect(self, SIGNAL("clicked()"), self.chooseColor)
+ self.connect(self, SIGNAL("clicked()"), self.choose_color)
 self._color = QColor()
 
- def chooseColor(self):
+ def choose_color(self):
 rgba, valid = QColorDialog.getRgba(self._color.rgba(),
 self.parentWidget())
 if valid:
 color = QColor.fromRgba(rgba)
- self.setColor(color)
+ self.set_color(color)
 
- def color(self):
+ def get_color(self):
 return self._color
 
 @pyqtSignature("QColor")
- def setColor(self, color):
+ def set_color(self, color):
 if color != self._color:
 self._color = color
 self.emit(SIGNAL("colorChanged(QColor)"), self._color)
@@ -89,7 +93,7 @@
 pixmap.fill(color)
 self.setIcon(QIcon(pixmap))
 
- color = pyqtProperty("QColor", color, setColor)
+ color = pyqtProperty("QColor", get_color, set_color)
 
 
 def text_to_qcolor(text):
@@ -369,8 +373,10 @@
 class FormDialog(QDialog):
 """Form Dialog"""
 def __init__(self, data, title="", comment="",
- icon=None, parent=None):
+ icon=None, parent=None, apply=None):
 super(FormDialog, self).__init__(parent)
+
+ self.apply_callback = apply
 
 # Form
 if isinstance(data[0][0], (list, tuple)):
@@ -387,6 +393,9 @@
 
 # Button box
 bbox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
+ if self.apply_callback is not None:
+ apply_btn = bbox.addButton(QDialogButtonBox.Apply)
+ self.connect(apply_btn, SIGNAL("clicked()"), self.apply)
 self.connect(bbox, SIGNAL("accepted()"), SLOT("accept()"))
 self.connect(bbox, SIGNAL("rejected()"), SLOT("reject()"))
 layout.addWidget(bbox)
@@ -406,17 +415,25 @@
 self.data = None
 QDialog.reject(self)
 
+ def apply(self):
+ self.apply_callback(self.formwidget.get())
+ 
 def get(self):
 """Return form result"""
 return self.data
 
 
-def fedit(data, title="", comment="", icon=None, parent=None):
+def fedit(data, title="", comment="", icon=None, parent=None, apply=None):
 """
 Create form dialog and return result
 (if Cancel button is pressed, return None)
 
 data: datalist, datagroup
+ title: string
+ comment: string
+ icon: QIcon instance
+ parent: parent QWidget
+ apply: apply callback (function)
 
 datalist: list/tuple of (field_name, field_value)
 datagroup: list/tuple of (datalist *or* datagroup, title, comment)
@@ -440,7 +457,7 @@
 if QApplication.startingUp():
 QApplication([])
 
- dialog = FormDialog(data, title, comment, icon, parent)
+ dialog = FormDialog(data, title, comment, icon, parent, apply)
 if dialog.exec_():
 return dialog.get()
 
@@ -471,8 +488,11 @@
 
 #--------- datalist example
 datalist = create_datalist_example()
+ def apply_test(data):
+ print "data:", data
 print "result:", fedit(datalist, title="Example",
- comment="This is just an <b>example</b>.")
+ comment="This is just an <b>example</b>.",
+ apply=apply_test)
 
 #--------- datagroup example
 datagroup = create_datagroup_example()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

Showing 1 results of 1

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /