Exemplo n.º 1
0
    def _insertTable(self, param):
        editor = self._application.mainWindow.pagePanel.pageView.codeEditor
        parent = self._application.mainWindow

        with TableDialog(parent) as dlg:
            controller = TableDialogController(dlg, self._application.config)
            if controller.showDialog() == wx.ID_OK:
                result = controller.getResult()
                editor.replaceText(result)
Exemplo n.º 2
0
    def _insertTable(self, param):
        editor = self._application.mainWindow.pagePanel.pageView.codeEditor
        parent = self._application.mainWindow

        with TableDialog(parent) as dlg:
            controller = TableDialogController(dlg, self._application.config)
            if controller.showDialog() == wx.ID_OK:
                result = controller.getResult()
                editor.replaceText(result)
Exemplo n.º 3
0
    def testDefault (self):
        dlg = TableDialog (self.wnd)
        Tester.dialogTester.appendOk()

        controller = TableDialogController (dlg, self._application.config)
        controller.showDialog()

        result = controller.getResult()

        validResult = u'''<table border="1">
<tr>
<td></td>
</tr>
</table>'''

        self.assertEqual (result, validResult, result)
Exemplo n.º 4
0
    def testBorder_02(self):
        dlg = TableDialog(self.mainWindow)
        controller = TableDialogController(dlg, self.application.config)
        Tester.dialogTester.appendOk()

        dlg.borderWidth = 0
        controller.showDialog()

        result = controller.getResult()

        validResult = '''<table>
<tr>
<td></td>
</tr>
</table>'''

        self.assertEqual(result, validResult, result)
Exemplo n.º 5
0
    def testBorder_02(self):
        dlg = TableDialog(self.mainWindow)
        controller = TableDialogController(dlg, self.application.config)
        Tester.dialogTester.appendOk()

        dlg.borderWidth = 0
        controller.showDialog()

        result = controller.getResult()

        validResult = '''<table>
<tr>
<td></td>
</tr>
</table>'''

        self.assertEqual(result, validResult, result)
Exemplo n.º 6
0
    def testCells(self):
        dlg = TableDialog(self.mainWindow)
        controller = TableDialogController(dlg, self.application.config)

        dlg.colsCount = 5
        Tester.dialogTester.appendOk()

        controller.showDialog()

        result = controller.getResult()

        validResult = '''<table border="1">
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>'''

        self.assertEqual(result, validResult, result)
Exemplo n.º 7
0
    def testCells(self):
        dlg = TableDialog(self.mainWindow)
        controller = TableDialogController(dlg, self.application.config)

        dlg.colsCount = 5
        Tester.dialogTester.appendOk()

        controller.showDialog()

        result = controller.getResult()

        validResult = '''<table border="1">
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>'''

        self.assertEqual(result, validResult, result)
Exemplo n.º 8
0
    def testColsCount (self):
        dlg = TableDialog (self.wnd)
        Tester.dialogTester.appendOk()

        controller = TableDialogController (dlg, self._application.config)
        dlg.colsCount = 10
        controller.showDialog()

        dlg2 = TableDialog (self.wnd)
        controller2 = TableDialogController (dlg2, self._application.config)

        self.assertEqual (dlg2.colsCount, 10)

        Tester.dialogTester.appendOk()
        controller2.showDialog()
Exemplo n.º 9
0
    def testHCells (self):
        dlg = TableDialog (self.wnd)
        controller = TableDialogController (dlg, self._application.config)

        dlg.colsCount = 5
        dlg.rowsCount = 3
        dlg.headerCells = True
        Tester.dialogTester.appendOk()

        controller.showDialog()

        result = controller.getResult()

        validResult = u'''<table border="1">
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>'''

        self.assertEqual (result, validResult, result)