def showDlg(self):
        logger.debug(util.funcName(obj=self))
        dlg = dutil.createDialog(self.unoObjs, _dlgdef)
        if not dlg:
            return
        ctrl_getter = dutil.ControlGetter(dlg)
        self.evtHandler = DlgEventHandler(self)
        self.dlgCtrls = DlgControls(self.unoObjs, ctrl_getter, self.evtHandler,
                                    self.script)
        self.evtHandler.setCtrls(self.dlgCtrls)
        self.dlgCtrls.loadValues(self.userVars)

        varname = 'CharComparison'
        if not self.userVars.isEmpty(varname):
            self.app.setCharCompFromInput(self.userVars.get(varname))
            self.charsetAlreadySet = True
        else:
            self.charsetAlreadySet = False

        evt = EventObject()
        for ctrl in (self.dlgCtrls.comboScript, self.dlgCtrls.comboFont,
                     self.dlgCtrls.txtFontSize):
            evt.Source = ctrl
            self.evtHandler.textChanged(evt)  # Simulate a textChanged event

        ## Display the dialog

        self.dlgClose = dlg.endExecute
        dlg.execute()

        if self.compareOnClose:
            self.app.doChecks()
        dlg.dispose()
Exemple #2
0
      def testStandard( self ):
          self.failUnless( IllegalArgumentException != None, "none-test" )
          self.failUnlessRaises( IllegalArgumentException, self.tobj.raiseException, 1,"foo",self.tobj)
                 
          self.failUnless( TWO == uno.Enum( "test.testtools.bridgetest.TestEnum","TWO"), "enum" )
          self.failUnless( UNSIGNED_LONG == uno.Enum( "com.sun.star.uno.TypeClass", "UNSIGNED_LONG" ) )
          self.failUnless( typeOfIllegalArgumentException ==
                           uno.Type( "com.sun.star.lang.IllegalArgumentException", EXCEPTION) )

          # should not throw an exception
          e = EventObject()
          e.Source = self.ctx
          e = EventObject( self.ctx )
          e = EventObject( e )
    def addRemainingListeners(self):
        """We have already added action listeners in __init__(),
        but we wait to add listeners for other types of controls because
        they could have side effects during loadValues().
        """
        self.txtRowNum.addTextListener(self.evtHandler)
        self.txtCorrection.addTextListener(self.evtHandler)
        self.scrollbarRow.addAdjustmentListener(self.evtHandler)

        for ctrl in (self.chkSuggestions, self.chkIsCorrect,
                     self.listSimilarWords, self.listSuggestions):
            ctrl.addItemListener(self.evtHandler)

        # Simulate an itemStateChanged event.
        evt = EventObject()
        evt.Source = self.chkSuggestions
        self.evtHandler.itemStateChanged(evt)
Exemple #4
0
    def testStandard(self):
        self.failUnless(IllegalArgumentException != None, "none-test")
        self.failUnlessRaises(IllegalArgumentException,
                              self.tobj.raiseException, 1, "foo", self.tobj)

        self.failUnless(
            TWO == uno.Enum("test.testtools.bridgetest.TestEnum", "TWO"),
            "enum")
        self.failUnless(UNSIGNED_LONG == uno.Enum("com.sun.star.uno.TypeClass",
                                                  "UNSIGNED_LONG"))
        self.failUnless(typeOfIllegalArgumentException == uno.Type(
            "com.sun.star.lang.IllegalArgumentException", EXCEPTION))

        # should not throw an exception
        e = EventObject()
        e.Source = self.ctx
        e = EventObject(self.ctx)
        e = EventObject(e)