{% extends "schsys/db_field_edt.html" %} {% load exfiltry %} {% load exsyntax %} {% block pythoncodeinit %} def init_form(self): self.save_btn.Disable() self.modified = False self.tuser = wx.Timer(self) self.tuser.Start(1000) self.Bind(wx.EVT_TIMER, self.on_timer_user, self.tuser) self.EDITOR.SetSavePoint() self.save_btn.Bind(wx.EVT_BUTTON, self.on_click) atab=self.get_acc_tab() atab.append((0, wx.WXK_INSERT, self.on_panel_focus)) atab.append((wx.ACCEL_ALT, ord('I'), self.on_panel_focus)) self.set_acc_key_tab(self,atab) self._panel.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.on_insert_click) self.EDITOR.SetCurrentPos(0) self.EDITOR.SetSelection(0,0) wx.CallAfter(self.EDITOR.SetFocus) from schbuilder.autocomplete import TABLE_SNIPPETS self.actions = TABLE_SNIPPETS def on_panel_focus(self, event): self._panel.SetFocus() def on_insert_click(self, event): item = self._panel.GetSelection() if item.IsOk(): key = self._panel.GetItemText(item) if key in self.actions: self.insert_txt(self.actions[key]) def insert_txt(self, txt): pos = self.EDITOR.GetCurrentPos() self.EDITOR.InsertText(pos, txt) pos+=len(txt) self.EDITOR.SetCurrentPos(pos) self.EDITOR.SetFocus() {% endblock %} {% block form_title %} Edition: {{ object.name }} {% endblock %} {% block title %} TAB:{{object.name}} {% endblock %} {% block edit_area_sch %}
|
|