def _onKeyDown(self, vk, mod): if vk == VK_UP and mod == 0: self._scroll(-1) self.paint() elif vk == VK_DOWN and mod == 0: self._scroll(1) self.paint() elif (vk == VK_PRIOR or vk == VK_LEFT) and mod == 0: rect = self.rectText() self._scroll(-(rect[3] - rect[1])) self.paint() elif (vk == VK_NEXT or vk == VK_RIGHT) and mod == 0: rect = self.rectText() self._scroll(rect[3] - rect[1]) self.paint() elif vk == VK_F1 and mod == 0: def jobHelp(job_item): help_path = os.path.join(ckit.getAppExePath(), 'doc\\index.html') pyauto.shellExecute(None, help_path, "", "") def jobHelpFinished(job_item): print("Helpを開きました") print("") job_item = ckit.JobItem(jobHelp, jobHelpFinished) ckit.JobQueue.defaultQueue().enqueue(job_item)
def onEditConfig(info): def jobHelp(job_item): self.desktop.editConfigFile() def jobHelpFinished(job_item): print("設定ファイルのエディタを起動しました") print("") job_item = ckit.JobItem(jobHelp, jobHelpFinished) ckit.JobQueue.defaultQueue().enqueue(job_item)
def onHelp(info): def jobHelp(job_item): help_path = os.path.join(ckit.getAppExePath(), 'doc\\index.html') pyauto.shellExecute(None, help_path, "", "") def jobHelpFinished(job_item): print("Helpを開きました") print("") job_item = ckit.JobItem(jobHelp, jobHelpFinished) ckit.JobQueue.defaultQueue().enqueue(job_item)
def onEnter(self, commandline, text, mod): args = text.split(';') file = args[0] if not os.path.exists(file): return False for association in self.main_window.association_list: for pattern in association[0].split(): if fnmatch.fnmatch(file, pattern): info = ckit.CommandInfo() info.args = args info.mod = mod commandline.planCommand(association[1], info, text) commandline.quit() return True joint_args = clnch_misc.joinArgs(args[1:]) directory, tmp = ckit.splitPath(file) if not os.path.isabs(file): file = os.path.abspath(file) #print( "File: %s" % ( file, ) ) #print( " %s" % ( joint_args, ) ) def jobShellExecute(job_item): pyauto.shellExecute(None, file, joint_args, directory) def jobShellExecuteFinished(job_item): pass job_item = ckit.JobItem(jobShellExecute, jobShellExecuteFinished) ckit.JobQueue.defaultQueue().enqueue(job_item) commandline.appendHistory(text) commandline.quit() return True
def onHelp(info): def jobHelp(job_item): if ckit.strings.locale == ckit.TranslatedStrings.ja_JP: dirname = "ja" else: dirname = "en" help_path = os.path.join(ckit.getAppExePath(), 'doc\\%s\\index.html' % dirname) pyauto.shellExecute(None, help_path, "", "") def jobHelpFinished(job_item): print(ckit.strings["log_help_opened"]) print("") job_item = ckit.JobItem(jobHelp, jobHelpFinished) ckit.JobQueue.defaultQueue().enqueue(job_item)
def _onKeyDown(self, vk, mod): if vk == VK_UP and mod == 0: self._scroll(-1) self.paint() elif vk == VK_DOWN and mod == 0: self._scroll(1) self.paint() elif (vk == VK_PRIOR or vk == VK_LEFT) and mod == 0: rect = self.rectText() self._scroll(-(rect[3] - rect[1])) self.paint() elif (vk == VK_NEXT or vk == VK_RIGHT) and mod == 0: rect = self.rectText() self._scroll(rect[3] - rect[1]) self.paint() elif vk == VK_F1 and mod == 0: def jobHelp(job_item): if ckit.strings.locale == ckit.TranslatedStrings.ja_JP: dirname = "ja" else: dirname = "en" help_path = ckit.joinPath(ckit.getAppExePath(), 'doc\\%s\\index.html' % dirname) pyauto.shellExecute(None, help_path, "", "") def jobHelpFinished(job_item): print(ckit.strings["log_help_opened"]) print("") job_item = ckit.JobItem(jobHelp, jobHelpFinished) ckit.JobQueue.defaultQueue().enqueue(job_item)
def onEnter(self, commandline, text, mod): if not (text.lower().startswith("http:") or text.lower().startswith("https:")): return False #print( "URL: %s" % ( text, ) ) def jobShellExecute(job_item): pyauto.shellExecute(None, text, "", "") def jobShellExecuteFinished(job_item): pass job_item = ckit.JobItem(jobShellExecute, jobShellExecuteFinished) ckit.JobQueue.defaultQueue().enqueue(job_item) commandline.appendHistory(text) commandline.quit() return True