ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change
on this file since 39a365d was
0d9dae8,
checked in by Gervaise Alina <gervyh@…>, 16 years ago
|
add a new module containing common classes that I used often:
sans.guiframe.utils
remove event slicer and add it in sans.guicoom.events,
modified slicer for those events
|
-
Property mode set to
100644
|
File size:
587 bytes
|
Rev | Line | |
---|
[0d9dae8] | 1 | """ |
---|
| 2 | Contains common classes |
---|
| 3 | """ |
---|
| 4 | import wx |
---|
| 5 | |
---|
| 6 | def format_number(value, high=False): |
---|
| 7 | """ |
---|
| 8 | Return a float in a standardized, human-readable formatted string |
---|
| 9 | """ |
---|
| 10 | try: |
---|
| 11 | value = float(value) |
---|
| 12 | except: |
---|
| 13 | print "returning 0" |
---|
| 14 | return "0" |
---|
| 15 | |
---|
| 16 | if high: |
---|
| 17 | return "%-6.4g" % value |
---|
| 18 | else: |
---|
| 19 | return "%-5.3g" % value |
---|
| 20 | |
---|
| 21 | class PanelMenu(wx.Menu): |
---|
| 22 | plots = None |
---|
| 23 | graph = None |
---|
| 24 | |
---|
| 25 | def set_plots(self, plots): |
---|
| 26 | self.plots = plots |
---|
| 27 | |
---|
| 28 | def set_graph(self, graph): |
---|
| 29 | self.graph = graph |
---|
Note: See
TracBrowser
for help on using the repository browser.