(self, cbTS, RCinTable, commitStr)
| 2845 | cbTS.setCompositionCursor(cbTS.compositionBufferCursor) |
| 2846 | |
| 2847 | def setOutputString(self, cbTS, RCinTable, commitStr): |
| 2848 | # 如果使用萬用字元解碼 |
| 2849 | if cbTS.isWildcardChardefs: |
| 2850 | if not cbTS.client.isUiLess: |
| 2851 | cbTS.isShowMessage = True |
| 2852 | cbTS.showMessageOnKeyUp = True |
| 2853 | cbTS.onKeyUpMessage = cbTS.cin.getCharEncode(commitStr) |
| 2854 | cbTS.wildcardcandidates = [] |
| 2855 | cbTS.wildcardpagecandidates = [] |
| 2856 | cbTS.isWildcardChardefs = False |
| 2857 | |
| 2858 | if cbTS.imeReverseLookup: |
| 2859 | if RCinTable.cin is not None: |
| 2860 | if not RCinTable.cin.getCharEncode(commitStr) == "": |
| 2861 | if not cbTS.client.isUiLess: |
| 2862 | cbTS.isShowMessage = True |
| 2863 | message = RCinTable.cin.getCharEncode(commitStr) |
| 2864 | if not cbTS.client.isMetroApp: |
| 2865 | cbTS.showMessageOnKeyUp = True |
| 2866 | cbTS.onKeyUpMessage = message |
| 2867 | else: |
| 2868 | cbTS.showMessage(message, cbTS.messageDurationTime) |
| 2869 | else: |
| 2870 | if not cbTS.client.isUiLess: |
| 2871 | cbTS.isShowMessage = True |
| 2872 | cbTS.showMessageOnKeyUp = True |
| 2873 | if cbTS.RCinFileNotExist: |
| 2874 | cbTS.onKeyUpMessage = "反查字根碼表檔案不存在!" |
| 2875 | else: |
| 2876 | cbTS.onKeyUpMessage = "反查字根碼表尚在載入中!" |
| 2877 | |
| 2878 | if cbTS.homophoneQuery and cbTS.isHomophoneChardefs: |
| 2879 | cbTS.isHomophoneChardefs = False |
| 2880 | if not cbTS.client.isUiLess: |
| 2881 | cbTS.isShowMessage = True |
| 2882 | cbTS.showMessageOnKeyUp = True |
| 2883 | cbTS.onKeyUpMessage = cbTS.cin.getCharEncode(commitStr) |
| 2884 | |
| 2885 | # 如果使用打繁出簡,就轉成簡體中文 |
| 2886 | if cbTS.outputSimpChinese: |
| 2887 | commitStr = cbTS.opencc.convert(commitStr) |
| 2888 | |
| 2889 | if not cbTS.compositionBufferMode: |
| 2890 | cbTS.setCommitString(commitStr) |
| 2891 | else: |
| 2892 | RemoveStringLength = 0 |
| 2893 | if not cbTS.selcandmode: |
| 2894 | if cbTS.menusymbolsmode: |
| 2895 | RemoveStringLength = len(cbTS.compositionChar) - 1 |
| 2896 | cbTS.menusymbolsmode = False |
| 2897 | elif cbTS.dayisymbolsmode: |
| 2898 | RemoveStringLength = self.calcRemoveStringLength(cbTS) - 1 |
| 2899 | else: |
| 2900 | RemoveStringLength = self.calcRemoveStringLength(cbTS) |
| 2901 | else: |
| 2902 | self.removeCompositionBufferString(cbTS, 1, False if cbTS.compositionBufferCursor < len(cbTS.compositionBufferString) else True) |
| 2903 | self.setCompositionBufferString(cbTS, commitStr, RemoveStringLength) |
| 2904 | if not cbTS.selcandmode: |
no test coverage detected