Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
1fb98904
Commit
1fb98904
authored
Nov 08, 2011
by
Keegi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
workaround for frozen buttons appearing on some cases
parent
1fe67e7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
pronterface.py
pronterface.py
+16
-3
No files found.
pronterface.py
View file @
1fb98904
...
@@ -720,12 +720,15 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -720,12 +720,15 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if
0.3
*
rr
+
0.59
*
gg
+
0.11
*
bb
<
60
:
if
0.3
*
rr
+
0.59
*
gg
+
0.11
*
bb
<
60
:
b
.
SetForegroundColour
(
"#ffffff"
)
b
.
SetForegroundColour
(
"#ffffff"
)
except
:
except
:
b
=
wx
.
Button
(
self
.
panel
,
-
1
,
""
)
b
=
wx
.
StaticText
(
self
.
panel
,
-
1
,
""
,
size
=
(
72
,
20
),
style
=
wx
.
ALIGN_CENTRE
+
wx
.
ST_NO_AUTORESIZE
)
#+wx.SIMPLE_BORDER
b
.
Freeze
()
b
.
Freeze
()
b
.
custombutton
=
i
b
.
custombutton
=
i
b
.
properties
=
btndef
b
.
properties
=
btndef
b
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
procbutton
)
if
btndef
is
not
None
:
b
.
Bind
(
wx
.
EVT_MOUSE_EVENTS
,
self
.
editbutton
)
b
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
procbutton
)
b
.
Bind
(
wx
.
EVT_MOUSE_EVENTS
,
self
.
editbutton
)
else
:
b
.
Bind
(
wx
.
EVT_BUTTON
,
lambda
e
:
e
.
Skip
())
self
.
custombuttonbuttons
.
append
(
b
)
self
.
custombuttonbuttons
.
append
(
b
)
if
i
<
4
:
if
i
<
4
:
ubs
.
Add
(
b
)
ubs
.
Add
(
b
)
...
@@ -880,18 +883,23 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -880,18 +883,23 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if
hasattr
(
obj
,
"custombutton"
):
if
hasattr
(
obj
,
"custombutton"
):
self
.
dragging
=
wx
.
Button
(
self
.
panel
,
-
1
,
obj
.
GetLabel
())
self
.
dragging
=
wx
.
Button
(
self
.
panel
,
-
1
,
obj
.
GetLabel
())
self
.
dragging
.
SetBackgroundColour
(
obj
.
GetBackgroundColour
())
self
.
dragging
.
SetBackgroundColour
(
obj
.
GetBackgroundColour
())
self
.
dragging
.
SetForegroundColour
(
obj
.
GetForegroundColour
())
self
.
dragging
.
sourcebutton
=
obj
self
.
dragging
.
sourcebutton
=
obj
self
.
dragging
.
Raise
()
self
.
dragging
.
Raise
()
self
.
dragging
.
Disable
()
self
.
dragging
.
Disable
()
self
.
dragging
.
SetPosition
(
self
.
panel
.
ScreenToClient
(
scrpos
))
self
.
dragging
.
SetPosition
(
self
.
panel
.
ScreenToClient
(
scrpos
))
for
b
in
self
.
custombuttonbuttons
:
for
b
in
self
.
custombuttonbuttons
:
if
b
.
IsFrozen
():
b
.
Thaw
()
if
b
.
IsFrozen
():
b
.
Thaw
()
#if b.properties is None:
# b.SetStyle(wx.ALIGN_CENTRE+wx.ST_NO_AUTORESIZE+wx.SIMPLE_BORDER)
self
.
last_drag_dest
=
obj
self
.
last_drag_dest
=
obj
self
.
dragging
.
label
=
obj
.
s_label
=
obj
.
GetLabel
()
self
.
dragging
.
label
=
obj
.
s_label
=
obj
.
GetLabel
()
self
.
dragging
.
bgc
=
obj
.
s_bgc
=
obj
.
GetBackgroundColour
()
self
.
dragging
.
bgc
=
obj
.
s_bgc
=
obj
.
GetBackgroundColour
()
self
.
dragging
.
fgc
=
obj
.
s_fgc
=
obj
.
GetForegroundColour
()
else
:
else
:
# dragging in progress
# dragging in progress
self
.
dragging
.
SetPosition
(
self
.
panel
.
ScreenToClient
(
scrpos
))
self
.
dragging
.
SetPosition
(
self
.
panel
.
ScreenToClient
(
scrpos
))
wx
.
CallAfter
(
self
.
dragging
.
Refresh
)
btns
=
self
.
custombuttonbuttons
btns
=
self
.
custombuttonbuttons
dst
=
None
dst
=
None
src
=
self
.
dragging
.
sourcebutton
src
=
self
.
dragging
.
sourcebutton
...
@@ -919,16 +927,21 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -919,16 +927,21 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if
dst
is
not
self
.
last_drag_dest
:
if
dst
is
not
self
.
last_drag_dest
:
if
self
.
last_drag_dest
is
not
None
:
if
self
.
last_drag_dest
is
not
None
:
self
.
last_drag_dest
.
SetBackgroundColour
(
self
.
last_drag_dest
.
s_bgc
)
self
.
last_drag_dest
.
SetBackgroundColour
(
self
.
last_drag_dest
.
s_bgc
)
self
.
last_drag_dest
.
SetForegroundColour
(
self
.
last_drag_dest
.
s_fgc
)
self
.
last_drag_dest
.
SetLabel
(
self
.
last_drag_dest
.
s_label
)
self
.
last_drag_dest
.
SetLabel
(
self
.
last_drag_dest
.
s_label
)
if
dst
is
not
None
and
dst
is
not
src
:
if
dst
is
not
None
and
dst
is
not
src
:
dst
.
s_bgc
=
dst
.
GetBackgroundColour
()
dst
.
s_bgc
=
dst
.
GetBackgroundColour
()
dst
.
s_fgc
=
dst
.
GetForegroundColour
()
dst
.
s_label
=
dst
.
GetLabel
()
dst
.
s_label
=
dst
.
GetLabel
()
src
.
SetBackgroundColour
(
dst
.
GetBackgroundColour
())
src
.
SetBackgroundColour
(
dst
.
GetBackgroundColour
())
src
.
SetForegroundColour
(
dst
.
GetForegroundColour
())
src
.
SetLabel
(
dst
.
GetLabel
())
src
.
SetLabel
(
dst
.
GetLabel
())
dst
.
SetBackgroundColour
(
drg
.
bgc
)
dst
.
SetBackgroundColour
(
drg
.
bgc
)
dst
.
SetForegroundColour
(
drg
.
fgc
)
dst
.
SetLabel
(
drg
.
label
)
dst
.
SetLabel
(
drg
.
label
)
else
:
else
:
src
.
SetBackgroundColour
(
drg
.
bgc
)
src
.
SetBackgroundColour
(
drg
.
bgc
)
src
.
SetForegroundColour
(
drg
.
fgc
)
src
.
SetLabel
(
drg
.
label
)
src
.
SetLabel
(
drg
.
label
)
self
.
last_drag_dest
=
dst
self
.
last_drag_dest
=
dst
elif
hasattr
(
self
,
"dragging"
)
and
not
e
.
ButtonIsDown
(
wx
.
MOUSE_BTN_LEFT
):
elif
hasattr
(
self
,
"dragging"
)
and
not
e
.
ButtonIsDown
(
wx
.
MOUSE_BTN_LEFT
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment