42 |
# that by fenPDF.animation.regenerateVs() |
# that by fenPDF.animation.regenerateVs() |
43 |
|
|
44 |
class KeyActions: |
class KeyActions: |
45 |
def __init__(self, context): |
def __init__(self, fenpdf): |
46 |
self.context = context |
self.fenPDF = fenpdf |
47 |
def insertChar(self, main, char): |
def insertChar(self, main, char): |
48 |
"""Insert a character to the accursed node - no creation. |
"""Insert a character to the accursed node - no creation. |
49 |
|
|
50 |
If no node is accursed, will do nothing. |
If no node is accursed, will do nothing. |
51 |
""" |
""" |
52 |
cur = self.context.states.cursor |
cur = self.fenPDF.uistate.cursor |
53 |
|
|
54 |
acc = cur.getAccursed() |
acc = cur.getAccursed() |
55 |
|
|
67 |
|
|
68 |
If no node is accursed, create a new node at cursor. |
If no node is accursed, create a new node at cursor. |
69 |
""" |
""" |
70 |
cur = self.context.states.cursor |
cur = self.fenPDF.uistate.cursor |
71 |
|
|
72 |
if cur.getAccursed() == None: |
if cur.getAccursed() == None: |
73 |
node = self.fenPDF.actions.abstract.createNewNode( |
node = self.fenPDF.actions.abstract.createNewNode( |
87 |
The number n may be positive or negative. |
The number n may be positive or negative. |
88 |
If no node is accursed, will do nothing. |
If no node is accursed, will do nothing. |
89 |
""" |
""" |
90 |
cur = self.context.states.cursor |
cur = self.fenPDF.uistate.cursor |
91 |
acc = cur.getAccursed() |
acc = cur.getAccursed() |
92 |
if acc == None: return |
if acc == None: return |
93 |
|
|
102 |
self.fenPDF.animation.regenerateVS() |
self.fenPDF.animation.regenerateVS() |
103 |
|
|
104 |
def backspace(self, main): |
def backspace(self, main): |
105 |
cur = self.context.states.cursor |
cur = self.fenPDF.uistate.cursor |
|
|
|
106 |
|
|
107 |
node = cur.getAccursed() |
node = cur.getAccursed() |
108 |
if node == None: return |
if node == None: return |
138 |
# Graa - this certainly doesn't work XXX |
# Graa - this certainly doesn't work XXX |
139 |
# **AND** breaks encapsulation. Was moved |
# **AND** breaks encapsulation. Was moved |
140 |
# here from fenpdf10.py, and needs fixing XXX |
# here from fenpdf10.py, and needs fixing XXX |
141 |
self.context.states.buoymanager.singles[1].mainNode = ff.view.buoy.MainNode2D(planeHome, irregu, ctrl) |
self.fenPDF.views.buoymanager.singles[1].mainNode = ff.view.buoy.MainNode2D(planeHome, irregu, ctrl) |
142 |
|
|
143 |
self.fenPDF.animation.regenerateVS() |
self.fenPDF.animation.regenerateVS() |
144 |
|
|
145 |
def save(self): |
def save(self): |
146 |
self.context.save() |
self.fenPDF.actions.global.save() |
147 |
self.fenPDF.animation.regenerateVS() |
self.fenPDF.animation.regenerateVS() |
148 |
|
|
149 |
def exit(self): |
def exit(self): |