157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
|
# File 'lib/watobo/gui/table_editor.rb', line 157
def initialize(owner, opts)
super(owner, opts)
@request = nil
@event_dispatcher_listeners = Hash.new
initTable()
self.connect(SEL_COMMAND, method(:onTableClick))
@ctrl_pressed = false
addKeyHandler(self)
self.connect(SEL_DOUBLECLICKED) do |sender, sel, data|
row = sender.getCurrentRow
if row >= 0 then
self.selectRow(row, false)
end
end
self.connect(SEL_DOUBLECLICKED) do |sender, sel, data|
row = sender.getCurrentRow
return nil unless row >= 0 and row < self.numRows
transcoder = TranscoderWindow.new(FXApp.instance, self.getItemText(row, 2))
transcoder.create
transcoder.show(Fox::PLACEMENT_SCREEN)
end
self.connect(SEL_RIGHTBUTTONRELEASE) do |sender, sel, event|
unless event.moved?
self.cancelInput()
ypos = event.click_y
row = self.rowAtY(ypos)
next unless row >= 0 and row <= self.numRows
self.selectRow(row, false) if row < self.numRows
FXMenuPane.new(self) do ||
if row < self.numRows
cell_value = self.getItemText(row, 2)
cell_value.extend Watobo::Mixin::Transcoders
parm_name = self.getItemText(row, 1)
FXMenuCaption.new(,"- Decoder -")
FXMenuSeparator.new()
decodeB64 = FXMenuCommand.new(,"Base64: #{cell_value.b64decode}")
decodeB64.connect(SEL_COMMAND) {
self.setItemText(row, 2, cell_value.b64decode)
}
decodeHex = FXMenuCommand.new(,"Hex(A): #{cell_value.hexdecode}")
decodeHex.connect(SEL_COMMAND) {
self.setItemText(row, 2, cell_value.hexdecode)
}
hex2int = FXMenuCommand.new(,"Hex(Int): #{cell_value.hex2int}")
hex2int.connect(SEL_COMMAND) {
self.setItemText(row, 2, cell_value.hex2int)
}
decodeURL = FXMenuCommand.new(,"URL: #{cell_value.url_decode}")
decodeURL.connect(SEL_COMMAND) {
self.setItemText(row, 2, cell_value.url_decode)
}
FXMenuSeparator.new()
FXMenuCaption.new(,"- Encoder -")
FXMenuSeparator.new()
encodeB64 = FXMenuCommand.new(,"Base64: #{cell_value.b64encode}")
encodeB64.connect(SEL_COMMAND) {
self.setItemText(row, 2, cell_value.b64encode)
}
encodeHex = FXMenuCommand.new(,"Hex: #{cell_value.hexencode}")
encodeHex.connect(SEL_COMMAND) {
self.setItemText(row, 2, cell_value.hexencode)
}
encodeURL = FXMenuCommand.new(,"URL: #{cell_value.url_encode}")
encodeURL.connect(SEL_COMMAND) {
self.setItemText(row, 2, cell_value.url_encode)
}
FXMenuSeparator.new()
remRow = FXMenuCommand.new(,"Remove: #{parm_name}")
remRow.connect(SEL_COMMAND) {
self.removeRows(row,1, true)
}
remRow = FXMenuCommand.new(,"Add Parameter..")
remRow.connect(SEL_COMMAND) { addNewParm() }
elsif row >= 0
remRow = FXMenuCommand.new(,"Add Parameter..")
remRow.connect(SEL_COMMAND) { addNewParm() }
end
.create
.(nil, event.root_x, event.root_y)
app.runModalWhileShown()
end
end
end
self.columnHeader.connect(SEL_COMMAND) do |sender, sel, index|
self.fitColumnsToContents(index)
end
end
|