source: sasview/src/sas/sasgui/perspectives/file_converter/frame_select_dialog.py @ 94f4518

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.2ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 94f4518 was 94f4518, checked in by lewis, 8 years ago

Add option to export multiple frames as one file or multiple files

  • Property mode set to 100644
File size: 2.2 KB
Line 
1import wx
2
3class FrameSelectDialog(wx.Dialog):
4
5    def __init__(self, n_frames):
6        wx.Dialog.__init__(self, None, title="Select Frames")
7
8        sizer = wx.GridBagSizer(10, 10)
9
10        y = 0
11        instructions = ("The file you've selected has {} frames. "
12            "Please select a subset of frames to convert to CanSAS "
13            "format").format(n_frames)
14        instructions_label = wx.StaticText(self, -1, instructions)
15        instructions_label.Wrap(self.GetSize().width - 10)
16        sizer.Add(instructions_label, (y,0), (1,2), wx.ALL, 5)
17        y += 1
18
19        first_label = wx.StaticText(self, -1,
20            "First Frame (0-{}): ".format(n_frames-1))
21        sizer.Add(first_label, (y,0), (1,1), wx.ALL, 5)
22
23        self.first_input = wx.TextCtrl(self, -1)
24        sizer.Add(self.first_input, (y,1), (1,1))
25        y += 1
26
27        last_label = wx.StaticText(self, -1,
28            "Last Frame (0-{}): ".format(n_frames-1))
29        sizer.Add(last_label, (y,0), (1,1), wx.ALL, 5)
30
31        self.last_input = wx.TextCtrl(self, -1)
32        sizer.Add(self.last_input, (y,1), (1,1))
33        y += 1
34
35        increment_label = wx.StaticText(self, -1, "Increment: ")
36        sizer.Add(increment_label, (y,0), (1,1), wx.ALL, 5)
37
38        self.increment_input = wx.TextCtrl(self, -1)
39        sizer.Add(self.increment_input, (y,1), (1,1))
40        y += 1
41
42        export_label = wx.StaticText(self, -1, "Export each frame to:")
43        sizer.Add(export_label, (y,0), (1,1), wx.LEFT | wx.RIGHT | wx.TOP, 5)
44        y += 1
45
46        self.single_btn = wx.RadioButton(self, -1, label="The same file",
47            style=wx.RB_GROUP)
48        sizer.Add(self.single_btn, (y,0), (1,1),
49            wx.LEFT | wx.RIGHT | wx.BOTTOM, 5)
50
51        multiple_btn = wx.RadioButton(self, -1, label="Multiple files")
52        sizer.Add(multiple_btn, (y,1), (1,1),
53            wx.LEFT | wx.RIGHT | wx.BOTTOM, 5)
54        y += 1
55
56        done_btn = wx.Button(self, wx.ID_OK)
57        sizer.Add(done_btn, (y,0), (1,1), wx.LEFT | wx.BOTTOM, 15)
58
59        cancel_btn = wx.Button(self, wx.ID_CANCEL)
60        sizer.Add(cancel_btn, (y,1), (1,1), wx.LEFT | wx.RIGHT | wx.BOTTOM, 15)
61
62        self.SetSizer(sizer)
63
64        size = self.GetSize()
65        size.height += 35
66        self.SetSize(size)
Note: See TracBrowser for help on using the repository browser.