equal
deleted
inserted
replaced
20 #You should have received a copy of the GNU General Public |
20 #You should have received a copy of the GNU General Public |
21 #License along with this library; if not, write to the Free Software |
21 #License along with this library; if not, write to the Free Software |
22 #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 |
23 |
24 import wx, wx.grid |
24 import wx, wx.grid |
|
25 |
|
26 from types import TupleType |
25 |
27 |
26 from PLCOpenEditor import AppendMenu |
28 from PLCOpenEditor import AppendMenu |
27 from plcopen.structures import LOCATIONDATATYPES, TestIdentifier, IEC_KEYWORDS |
29 from plcopen.structures import LOCATIONDATATYPES, TestIdentifier, IEC_KEYWORDS |
28 |
30 |
29 #------------------------------------------------------------------------------- |
31 #------------------------------------------------------------------------------- |
239 |
241 |
240 def ClearErrors(self): |
242 def ClearErrors(self): |
241 self.Errors = {} |
243 self.Errors = {} |
242 |
244 |
243 class VariableDropTarget(wx.TextDropTarget): |
245 class VariableDropTarget(wx.TextDropTarget): |
244 |
246 ''' |
|
247 This allows dragging a variable location from somewhere to the Location |
|
248 column of a variable row. |
|
249 |
|
250 The drag source should be a TextDataObject containing a Python tuple like: |
|
251 ('%ID0.0.0', 'location', 'REAL') |
|
252 |
|
253 c_ext/CFileEditor.py has an example of this (you can drag a C extension |
|
254 variable to the Location column of the variable panel). |
|
255 ''' |
245 def __init__(self, parent): |
256 def __init__(self, parent): |
246 wx.TextDropTarget.__init__(self) |
257 wx.TextDropTarget.__init__(self) |
247 self.ParentWindow = parent |
258 self.ParentWindow = parent |
248 |
259 |
249 def OnDropText(self, x, y, data): |
260 def OnDropText(self, x, y, data): |