|
18 | 18 | # logger = tool.setupLogger(__name__, __name__ + '.log', 'w', logging.DEBUG) |
19 | 19 | logger =logging.getLogger('main') |
20 | 20 |
|
21 | | -<<<<<<< HEAD |
22 | 21 |
|
23 | | -class pnlMethod(wx.Panel): |
24 | | - def _init_ctrls(self, prnt): |
25 | | - # generated method, don't edit |
26 | | - wx.Panel.__init__(self, id=wxID_PNLMETHOD, name=u'pnlMethod', |
27 | | - parent=prnt, pos=wx.Point(135, 307), size=wx.Size(439, 357), |
28 | | - style=wx.TAB_TRAVERSAL) |
29 | | - self.SetClientSize(wx.Size(423, 319)) |
30 | | - |
31 | | - self.rbGenerate = wx.RadioButton(id=wxID_PNLMETHODSRBGENERATE, |
32 | | - label=u'Automatically generate a Method ', name=u'rbGenerate', |
33 | | - parent=self, pos=wx.Point(16, 8), size=wx.Size(392, 16), style=0) |
34 | | - self.rbGenerate.SetValue(True) |
35 | | - self.rbGenerate.Bind(wx.EVT_RADIOBUTTON, self.OnRbGenerateRadiobutton, |
36 | | - id=wxID_PNLMETHODSRBGENERATE) |
37 | | - |
38 | | - self.rbSelect = wx.RadioButton(id=wxID_PNLMETHODSRBSELECT, |
39 | | - label=u'Select an existing Method', name=u'rbSelect', parent=self, |
40 | | - pos=wx.Point(16, 32), size=wx.Size(392, 13), style=0) |
41 | | - self.rbSelect.SetValue(False) |
42 | | - self.rbSelect.Bind(wx.EVT_RADIOBUTTON, self.OnRbSelectRadiobutton, |
43 | | - id=wxID_PNLMETHODSRBSELECT) |
44 | | - |
45 | | - self.rbCreateNew = wx.RadioButton(id=wxID_PNLMETHODSRBCREATENEW, |
46 | | - label=u'Create a new Method ', name=u'rbCreateNew', parent=self, |
47 | | - pos=wx.Point(16, 208), size=wx.Size(392, 13), style=0) |
48 | | - self.rbCreateNew.SetValue(False) |
49 | | - self.rbCreateNew.Bind(wx.EVT_RADIOBUTTON, self.OnRbCreateNewRadiobutton, |
50 | | - id=wxID_PNLMETHODSRBCREATENEW) |
51 | | - |
52 | | - self.txtMethodDescrip = wx.richtext.RichTextCtrl(id=wxID_PNLMETHODSRICHTEXTCTRL1, |
53 | | - parent=self, pos=wx.Point(16, 224), size=wx.Size(392, 84), |
54 | | - style=wx.richtext.RE_MULTILINE, value=u'Method Description') |
55 | | - self.txtMethodDescrip.Enable(False) |
56 | | - self.txtMethodDescrip.Bind(wx.EVT_SET_FOCUS, self.OnTxtMethodDescripSetFocus) |
57 | | - self.txtMethodDescrip.Bind(wx.EVT_KILL_FOCUS, self.OnTxtMethodDescripKillFocus) |
58 | | - |
59 | | - self.lstMethods = wx.ListCtrl(id=wxID_PNLMETHODSLISTCTRL1, |
60 | | - name='lstMethods', parent=self, pos=wx.Point(16, 48), |
61 | | - size=wx.Size(392, 152), style=wx.LC_REPORT|wx.LC_SINGLE_SEL) |
62 | | - self.lstMethods.Bind(wx.EVT_SET_FOCUS, self.OnLstMethodSetFocus) |
63 | | - |
64 | | - |
65 | | - self.lstMethods.InsertColumn(0, 'Description') |
66 | | - self.lstMethods.InsertColumn(1, 'Link') |
67 | | - self.lstMethods.InsertColumn(2, 'id') |
68 | | - self.lstMethods.SetColumnWidth(0, 200) |
69 | | - self.lstMethods.SetColumnWidth(1, 153) |
70 | | - self.lstMethods.SetColumnWidth(2,0) |
71 | | - # self.lstMethods.Enable(False) |
72 | | - |
73 | | - |
74 | | - |
75 | | - |
76 | | - def __init__(self, parent, id, pos, size, style, name, ss, method): |
77 | | - self.series_service = ss |
78 | | - self.prev_val = method |
79 | | - self._init_ctrls(parent) |
80 | | - |
81 | | - def OnLstMethodSetFocus(self, event): |
82 | | - self.rbSelect.SetValue(True) |
83 | | - |
84 | | - def OnRbGenerateRadiobutton(self, event): |
85 | | - # self.lstMethods.Enable(False) |
86 | | - self.txtMethodDescrip.Enable(False) |
87 | | - |
88 | | - event.Skip() |
89 | | - |
90 | | - def OnRbSelectRadiobutton(self, event): |
91 | | - self.lstMethods.Enable(True) |
92 | | - self.txtMethodDescrip.Enable(False) |
93 | | - |
94 | | - event.Skip() |
95 | | - |
96 | | - def OnRbCreateNewRadiobutton(self, event): |
97 | | - # self.lstMethods.Enable(False) |
98 | | - self.txtMethodDescrip.Enable(True) |
99 | | - |
100 | | - event.Skip() |
101 | | - |
102 | | - def OnTxtMethodDescripSetFocus(self, event): |
103 | | - if self.txtMethodDescrip.GetValue() =="Method Description": |
104 | | - self.txtMethodDescrip.SetValue("") |
105 | | - |
106 | | - event.Skip() |
107 | | - |
108 | | - def OnTxtMethodDescripKillFocus(self, event): |
109 | | - if self.txtMethodDescrip.GetValue() =="": |
110 | | - self.txtMethodDescrip.SetValue("Method Description") |
111 | | - |
112 | | - event.Skip() |
113 | | - |
114 | | - |
115 | | - def getMethod(self): |
116 | | - |
117 | | - m = None |
118 | | - if self.rbGenerate.Value: |
119 | | - genmethod = "Values derived from ODM Tools Python" |
120 | | - |
121 | | - m= self.series_service.get_method_by_description(genmethod) |
122 | | - if m is None: |
123 | | - logger.debug("assigning new method description") |
124 | | - m = Methods() |
125 | | - m.MethodDescription = genmethod |
126 | | - |
127 | | - |
128 | | - elif self.rbSelect.Value: |
129 | | - index = self.lstMethods.GetFirstSelected() |
130 | | - desc= self.lstMethods.GetItem(index, 0).GetText() |
131 | | - |
132 | | - logger.debug(desc) |
133 | | - m= self.series_service.get_method_by_description(desc) |
134 | | - |
135 | | - |
136 | | - |
137 | | - elif self.rbCreateNew.Value: |
138 | | - |
139 | | - logger.debug("assigning new method description") |
140 | | - m.description = self.txtMethodDescrip.GetValue() |
141 | | - |
142 | | - return m |
143 | | -======= |
144 | 22 | class pnlMethod(wx.Panel): # Rename this to page method view |
145 | 23 | def __init__(self, parent): |
146 | 24 | wx.Panel.__init__(self, parent) |
@@ -324,4 +202,3 @@ def __init__(self, parent): |
324 | 202 | # logger.debug("assigning new method description") |
325 | 203 | # m.description = self.txtMethodDescrip.GetValue() |
326 | 204 | # return m |
327 | | ->>>>>>> origin/update_cvs |
0 commit comments