Exemplo n.º 1
0
 def goptionpane_show_message_dialog(self, message, title, message_type):
     command = GOptionPane_showMessageDialog.format(
         msg=strlib.quote_string(strlib.url_encode(message)),
         title=strlib.quote_string(strlib.url_encode(title)),
         dialog_type=message_type.value)
     self.put_pipe(command)
     self.get_result()  # Wait for dialog to close
Exemplo n.º 2
0
 def goptionpane_show_text_file_dialog(self, message, title, rows, cols):
     command = GOptionPane_showTextFileDialog.format(
         msg=strlib.quote_string(strlib.url_encode(message)),
         title=strlib.quote_string(strlib.url_encode(title)),
         rows=rows,
         cols=cols)
     self.put_pipe(command)
     self.get_result()  # Wait for dialog to close
Exemplo n.º 3
0
 def goptionpane_show_input_dialog(self, message, title):
     command = GOptionPane_showInputDialog.format(
         msg=strlib.quote_string(strlib.url_encode(message)),
         title=strlib.quote_string(strlib.url_encode(title)),
     )
     self.put_pipe(command)
     result = self.get_result()
     return strlib.url_decode(result)
Exemplo n.º 4
0
 def goptionpane_show_confirm_dialog(self, message, title, confirm_type):
     command = GOptionPane_showConfirmDialog.format(
         msg=strlib.quote_string(strlib.url_encode(message)),
         title=strlib.quote_string(strlib.url_encode(title)),
         dialog_type=confirm_type.value)
     self.put_pipe(command)
     result = self.get_result()
     return int(result)
Exemplo n.º 5
0
    def convert_field(self, value, conversion):
        # print('convert_field')
        # print(value, conversion)
        if conversion == 'b':
            return 'true' if value else 'false'
        elif conversion == 'q':
            return _strlib.quote_string(value)
        elif conversion == 'u':
            return _strlib.quote_string(_strlib.url_encode(value))

        return super().convert_field(value, conversion)
Exemplo n.º 6
0
 def goptionpane_show_option_dialog(self, message, title, options,
                                    initially_selected):
     command = GOptionPane_showOptionDialog.format(
         msg=strlib.quote_string(strlib.url_encode(message)),
         title=strlib.quote_string(strlib.url_encode(title)),
         options=', '.join(
             map(strlib.quote_string,
                 map(strlib.url_encode, map(str, options)))),
         initial=strlib.quote_string(strlib.url_encode(initially_selected)))
     self.put_pipe(command)
     result = self.get_result()
     return int(result)
Exemplo n.º 7
0
 def put_console(self, line, stderr=False):
     # BUGFIX: strings that end with '\' don't print because of back-end error;
     # kludge fix by appending an "invisible" space after it
     if line.endswith('\\'):
         line += ' '
     self.put_pipe(
         JBEConsole_print.format(line=strlib.quote_string(line),
                                 stderr=boolalpha(stderr)))
     self.echo_console(line, stderr)
Exemplo n.º 8
0
 def note_play(self, note, repeat):
     note = str(note) + boolalpha(repeat)
     command = Note_play.format(
         note=strlib.quote_string(strlib.url_encode(note)))
     self.put_pipe(command)
     self.get_result()  # Wait for playing to be done
Exemplo n.º 9
0
 def gfilechooser_show_save_dialog(self, current_dir):
     command = GFileChooser_showOpenDialog.format(
         cwd=strlib.quote_string(current_dir))
     self.put_pipe(command)
     return self.get_result()
Exemplo n.º 10
0
 def setSelectedItem(self, gobj, item):
     command = GChooser_setSelectedItem.format(
         id=gobj.ID, item=strlib.quote_string(item))
     self.put_pipe(command)
Exemplo n.º 11
0
 def setText(self, gobj, str):
     command = GTextField_setText.format(id=gobj.ID,
                                         text=strlib.quote_string(str))
     self.put_pipe(command)
Exemplo n.º 12
0
 def createGCheckBox(self, gobj, label):
     Platform.SOURCE_TABLE[gobj.ID] = gobj
     command = GCheckBox_create.format(id=gobj.ID,
                                       label=strlib.quote_string(label))
     self.put_pipe(command)
Exemplo n.º 13
0
 def setActionCommand(self, gobj, cmd):
     command = GInteractor_setActionCommand.format(
         id=gobj.ID, cmd=strlib.quote_string(cmd))
     self.put_pipe(command)
Exemplo n.º 14
0
 def setWindowTitle(self, gw, title):
     command = GWindow_setTitle.format(id=gw.gwd.ID,
                                       title=strlib.quote_string(title))
     self.put_pipe(command)
Exemplo n.º 15
0
 def setLabel(self, gobj, str):
     command = GLabel_setLabel.format(id=gobj.ID,
                                      label=strlib.quote_string(str))
     self.put_pipe(command)