Exemplo n.º 1
0
 def test_scintillawrapper_void_void_int_in_callback(self):
     notepad.outputDebugString('test_scintillawrapper_void_void_int_in_callback')
     editor.write('test');
     editor.callback(lambda args: self.callback_scintillawrapper_void_void_int(args), [SCINTILLANOTIFICATION.SAVEPOINTREACHED])
     editor.setSavePoint()
     self.poll_for_callback()
     self.assertEqual(self.callbackCalled, True)
Exemplo n.º 2
0
 def test_scintillawrapper_void_int_cells_in_callback(self):
     editor.write('Hi')
     editor.setText('')
     editor.callback(lambda args: self.callback_scintillawrapper_void_int_cells(args), [SCINTILLANOTIFICATION.SAVEPOINTREACHED])
     editor.setSavePoint()
     self.poll_for_callback()
     self.assertEqual(self.callbackCalled, True)
 def test_scintillawrapper_int_void_position_in_callback(self):
     editor.callback(
         lambda args: self.callback_scintillawrapper_int_void_position(
             args), [SCINTILLANOTIFICATION.MODIFIED])
     editor.write("Hello World")
     self.poll_for_callback()
     self.assertEqual(self.callbackCalled, True)
 def test_scintillawrapper_void_void_string_in_callback(self):
     editor.callback(
         lambda args: self.callback_scintillawrapper_void_void_string(args),
         [SCINTILLANOTIFICATION.MODIFIED])
     editor.write("test")
     self.poll_for_callback()
     self.assertEqual(self.callbackCalled, True)
 def test_scintillawrapper_int_void_stringresult_in_callback(self):
     editor.callback(
         lambda args: self.callback_scintillawrapper_int_void_stringresult(
             args), [SCINTILLANOTIFICATION.MODIFIED])
     editor.write('abc123 def456 ghi789')
     self.poll_for_callback()
     self.assertEqual(self.callbackCalled, True)
 def test_scintillawrapper_position_int_findtext_in_callback(self):
     editor.callback(
         lambda args: self.callback_scintillawrapper_position_int_findtext(
             args), [SCINTILLANOTIFICATION.MODIFIED])
     editor.write('ac123 def456\r\nghi11111 xl45')
     self.poll_for_callback()
     self.assertEqual(self.callbackCalled, True)
 def test_scintillawrapper_int_position_void_in_callback(self):
     editor.callback(
         lambda args: self.callback_scintillawrapper_int_position_void(
             args), [SCINTILLANOTIFICATION.MODIFIED])
     editor.write("test")
     # self.poll_for_callback()
     self.poll_for_callback()
 def test_scintillawrapper_void_position_string_in_callback(self):
     editor.callback(
         lambda args: self.callback_scintillawrapper_void_position_string(
             args), [SCINTILLANOTIFICATION.SAVEPOINTREACHED])
     editor.setSavePoint()
     self.poll_for_callback()
     self.assertEqual(self.callbackCalled, True)
Exemplo n.º 9
0
 def test_scintillawrapper_int_void_textrange_in_callback(self):
     notepad.setLangType(LANGTYPE.XML)
     editor.write('<test attrib="unit" />')
     time.sleep(0.1)  # lexing and threading don't seem to mix
     editor.callback(lambda args: self.callback_scintillawrapper_int_void_textrange(args), [SCINTILLANOTIFICATION.SAVEPOINTREACHED])
     editor.setSavePoint()
     self.poll_for_callback()
     self.assertEqual(self.callbackCalled, True)
 def test_scintillawrapper_int_int_string_in_callback(self):
     editor.write('ABC This is a some ABC text we are going to search')
     editor.callback(
         lambda args: self.callback_scintillawrapper_int_int_string(args),
         [SCINTILLANOTIFICATION.SAVEPOINTREACHED])
     editor.setSavePoint()
     self.poll_for_callback()
     self.assertEqual(self.callbackCalled, True)
 def test_scintillawrapper_int_int_stringresult_in_callback_getLine(self):
     editor.callback(
         lambda args: self.
         callback_scintillawrapper_int_int_stringresult_getLine(args),
         [SCINTILLANOTIFICATION.MODIFIED])
     editor.write("One\r\nTwo\r\nThree")
     self.poll_for_callback()
     self.assertEqual(self.callbackCalled, True)
Exemplo n.º 12
0
 def setCallbacks(self):
     self.clearCallbacks()
     editor.setMouseDwellTime(self.mouseDwellTime)
     editor.callback(self.onCalltipClick,
                     [Npp.SCINTILLANOTIFICATION.CALLTIPCLICK])
     editor.callback(self.onAutocomplete,
                     [Npp.SCINTILLANOTIFICATION.CHARADDED])
     editor.callback(self.onMouseDwell,
                     [Npp.SCINTILLANOTIFICATION.DWELLSTART])
     editor.callback(self.textModified,
                     [Npp.SCINTILLANOTIFICATION.MODIFIED])
     notepad.callback(self.onBufferActivated,
                      [Npp.NOTIFICATION.BUFFERACTIVATED])
     notepad.callback(self.onShutdown, [Npp.NOTIFICATION.SHUTDOWN])
     if self.lexer:
         editor.callbackSync(self.lexer.on_updateui,
                             [Npp.SCINTILLANOTIFICATION.UPDATEUI])
         notepad.callback(self.lexer.on_langchanged,
                          [Npp.NOTIFICATION.LANGCHANGED])
Exemplo n.º 13
0
 def test_scintillawrapper_int_int_stringresult_in_callback_styleGetFont(self):
     editor.callback(lambda args: self.callback_scintillawrapper_int_int_stringresult_styleGetFont(args), [SCINTILLANOTIFICATION.MODIFIED])
     editor.write("test");
     self.poll_for_callback()
     self.assertEqual(self.callbackCalled, True)
Exemplo n.º 14
0
                _end_marker_line_to_delete = marker_end_line

            editor.markerDelete(_start_marker_line_to_delete,
                                MARK_HIDELINESBEGIN)
            editor.markerDelete(_start_marker_line_to_delete,
                                MARK_HIDELINESUNDERLINE)
            editor.markerDelete(_end_marker_line_to_delete, MARK_HIDELINESEND)

        else:
            return

    editor.hideLines(start_line, end_line)
    editor.markerAdd(marker_start_line, MARK_HIDELINESBEGIN)
    editor.markerAdd(marker_start_line, MARK_HIDELINESUNDERLINE)
    editor.markerAdd(marker_end_line, MARK_HIDELINESEND)
    editor.gotoLine(marker_start_line)


# ---------------------------------------------------------------------------------

try:
    MARGINCLICK_CALLBACK_REGISTERED
except NameError:
    editor.callbackSync(sync_callback_MARGINCLICK,
                        [SCINTILLANOTIFICATION.MARGINCLICK])
    editor.callback(async_callback_MARGINCLICK,
                    [SCINTILLANOTIFICATION.MARGINCLICK])
    notepad.callback(callback_BUFFERACTIVATED, [NOTIFICATION.BUFFERACTIVATED])
    MARGINCLICK_CALLBACK_REGISTERED = True

main()