From 7a96bd6296fd51e0da73eb1c0a8de8289f0327b5 Mon Sep 17 00:00:00 2001 From: Werner F Bruhin Date: Sat, 14 Jun 2014 15:23:41 +0200 Subject: [PATCH] - KEY_SHIFT and KEY_CTRL where defined in canvas.py and composit.py moved to oglmisc.py - added above to test_lib_ogl.py --- unittests/test_lib_ogl.py | 5 +++++ wx/lib/ogl/canvas.py | 3 +-- wx/lib/ogl/composit.py | 2 -- wx/lib/ogl/oglmisc.py | 5 +++++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/unittests/test_lib_ogl.py b/unittests/test_lib_ogl.py index be0394de..c5fea229 100644 --- a/unittests/test_lib_ogl.py +++ b/unittests/test_lib_ogl.py @@ -83,6 +83,11 @@ class lib_ogl_Tests(wtc.WidgetTestCase): ogl.LINE_ALIGNMENT_VERT ogl.LINE_ALIGNMENT_TO_NEXT_HANDLE ogl.LINE_ALIGNMENT_NONE + + # keys + ogl.KEY_SHIFT + ogl.KEY_CTRL + #--------------------------------------------------------------------------- diff --git a/wx/lib/ogl/canvas.py b/wx/lib/ogl/canvas.py index f5134777..34cfb335 100644 --- a/wx/lib/ogl/canvas.py +++ b/wx/lib/ogl/canvas.py @@ -17,11 +17,10 @@ The OGL canvas class import wx from .lines import LineShape from .composit import * +from .oglmisc import * NoDragging, StartDraggingLeft, ContinueDraggingLeft, StartDraggingRight, ContinueDraggingRight = 0, 1, 2, 3, 4 -KEY_SHIFT, KEY_CTRL = 1, 2 - # Helper function: True if 'contains' wholly contains 'contained'. diff --git a/wx/lib/ogl/composit.py b/wx/lib/ogl/composit.py index 2fce96ef..71ce3407 100644 --- a/wx/lib/ogl/composit.py +++ b/wx/lib/ogl/composit.py @@ -20,8 +20,6 @@ import wx from .basic import RectangleShape, Shape, ControlPoint from .oglmisc import * -KEY_SHIFT, KEY_CTRL = 1, 2 - _objectStartX = 0.0 _objectStartY = 0.0 diff --git a/wx/lib/ogl/oglmisc.py b/wx/lib/ogl/oglmisc.py index 25189bb4..333680a4 100644 --- a/wx/lib/ogl/oglmisc.py +++ b/wx/lib/ogl/oglmisc.py @@ -77,6 +77,11 @@ LINE_ALIGNMENT_VERT = 0 LINE_ALIGNMENT_TO_NEXT_HANDLE = 2 LINE_ALIGNMENT_NONE = 0 +# was defined in canvas and in composit +KEY_SHIFT = 1 +KEY_CTRL = 2 + + def FormatText(dc, text, width, height, formatMode): """