MCPcopy Create free account
hub / github.com/Image-Py/imagepy / on_label

Method on_label

imagepy/ui/tablewindow.py:196–222  ·  view source on GitHub ↗
(self, evt)

Source from the content-addressed store, hash-verified

194 self.Bind(Grid.EVT_GRID_LABEL_RIGHT_CLICK, self.on_label)
195
196 def on_label(self, evt):
197 # Did we click on a row or a column?
198 row, col = evt.GetRow(), evt.GetCol()
199 if row==-1:
200 props = self.tps.props
201
202 cur = props.iloc[:,col]
203 para = {'accu':cur[0], 'tc':cur[1], 'lc':cur[2], 'ln':cur[3]}
204 view = [(int, 'accu', (0, 10), 0, 'accuracy', ''),
205 ('color', 'tc', 'text color', ''),
206 ('color', 'lc', 'line color', ''),
207 (list, 'ln', ['Text', 'Line', 'Both'], str, 'draw', '')]
208 rst = IPy.get_para('Table Properties', view, para)
209 if not rst :return
210 if col!=-1:
211 props.iloc[:,col] = [para[i] for i in ['accu', 'tc', 'lc', 'ln']]
212 if col==-1:
213 for c in range(props.shape[1]):
214 props.iloc[:,c] = [para[i] for i in ['accu', 'tc', 'lc', 'ln']]
215 '''
216 if row==-1 and col>-1:
217 props.ix['ln',col] = (props.ix['ln',col]+1)%3
218 if row==-1 and col==-1:
219 cn = self.tps.data.columns[col]
220 props.ix['ln'] = (props.ix['ln'].min()+1)%3
221 '''
222 self.tps.update()
223
224
225 def set_handler(self, handle=None):

Callers

nothing calls this directly

Calls 2

get_paraMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected