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
97964293
Commit
97964293
authored
May 28, 2012
by
kliment
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #231 from Stefanowicz/experimental
Fixed background colors when using dark themes
parents
d098a953
af37c07d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
8 deletions
+18
-8
pronterface.py
pronterface.py
+2
-2
xybuttons.py
xybuttons.py
+8
-3
zbuttons.py
zbuttons.py
+8
-3
No files found.
pronterface.py
View file @
97964293
...
...
@@ -592,9 +592,9 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
szbuttons
=
wx
.
GridBagSizer
()
self
.
xyb
=
XYButtons
(
self
.
panel
,
self
.
moveXY
,
self
.
homeButtonClicked
,
self
.
spacebarAction
)
self
.
xyb
=
XYButtons
(
self
.
panel
,
self
.
moveXY
,
self
.
homeButtonClicked
,
self
.
spacebarAction
,
self
.
settings
.
bgcolor
)
szbuttons
.
Add
(
self
.
xyb
,
pos
=
(
0
,
1
),
flag
=
wx
.
ALIGN_CENTER
)
self
.
zb
=
ZButtons
(
self
.
panel
,
self
.
moveZ
)
self
.
zb
=
ZButtons
(
self
.
panel
,
self
.
moveZ
,
self
.
settings
.
bgcolor
)
szbuttons
.
Add
(
self
.
zb
,
pos
=
(
0
,
2
),
flag
=
wx
.
ALIGN_CENTER
)
#lls.Add(self.zb, pos=(2,6), span=(1,1), flag=wx.ALIGN_CENTER)
wx
.
CallAfter
(
self
.
xyb
.
SetFocus
)
...
...
xybuttons.py
View file @
97964293
...
...
@@ -47,7 +47,7 @@ class XYButtons(BufferedCanvas):
center
=
(
124
,
121
)
spacer
=
7
def
__init__
(
self
,
parent
,
moveCallback
=
None
,
cornerCallback
=
None
,
spacebarCallback
=
None
,
ID
=-
1
):
def
__init__
(
self
,
parent
,
moveCallback
=
None
,
cornerCallback
=
None
,
spacebarCallback
=
None
,
bgcolor
=
"#FFFFFF"
,
ID
=-
1
):
self
.
bg_bmp
=
wx
.
Image
(
imagefile
(
"control_xy.png"
),
wx
.
BITMAP_TYPE_PNG
)
.
ConvertToBitmap
()
self
.
keypad_bmp
=
wx
.
Image
(
imagefile
(
"arrow_keys.png"
),
wx
.
BITMAP_TYPE_PNG
)
.
ConvertToBitmap
()
self
.
keypad_idx
=
-
1
...
...
@@ -61,6 +61,10 @@ class XYButtons(BufferedCanvas):
# Remember the last clicked buttons, so we can repeat when spacebar pressed
self
.
lastMove
=
None
self
.
lastCorner
=
None
self
.
bgcolor
=
wx
.
Colour
()
self
.
bgcolor
.
SetFromName
(
bgcolor
)
self
.
bgcolormask
=
wx
.
Colour
(
self
.
bgcolor
.
Red
(),
self
.
bgcolor
.
Green
(),
self
.
bgcolor
.
Blue
(),
128
)
BufferedCanvas
.
__init__
(
self
,
parent
,
ID
)
self
.
SetSize
(
self
.
bg_bmp
.
GetSize
())
...
...
@@ -220,6 +224,7 @@ class XYButtons(BufferedCanvas):
def
draw
(
self
,
dc
,
w
,
h
):
dc
.
SetBackground
(
wx
.
Brush
(
self
.
bgcolor
))
dc
.
Clear
()
gc
=
wx
.
GraphicsContext
.
Create
(
dc
)
...
...
@@ -254,8 +259,8 @@ class XYButtons(BufferedCanvas):
r
=
kpos
[
2
]
gc
.
DrawEllipse
(
kpos
[
0
]
-
r
,
kpos
[
1
]
-
r
,
r
*
2
,
r
*
2
)
else
:
gc
.
SetPen
(
wx
.
Pen
(
wx
.
Colour
(
255
,
255
,
255
,
0
),
4
))
gc
.
SetBrush
(
wx
.
Brush
(
wx
.
Colour
(
255
,
255
,
255
,
128
)
))
gc
.
SetPen
(
wx
.
Pen
(
self
.
bgcolor
,
0
))
gc
.
SetBrush
(
wx
.
Brush
(
self
.
bgcolormask
))
gc
.
DrawRectangle
(
0
,
0
,
w
,
h
)
...
...
zbuttons.py
View file @
97964293
...
...
@@ -39,7 +39,7 @@ class ZButtons(BufferedCanvas):
3
:
None
}
def
__init__
(
self
,
parent
,
moveCallback
=
None
,
ID
=-
1
):
def
__init__
(
self
,
parent
,
moveCallback
=
None
,
bgcolor
=
"#FFFFFF"
,
ID
=-
1
):
self
.
bg_bmp
=
wx
.
Image
(
imagefile
(
"control_z.png"
),
wx
.
BITMAP_TYPE_PNG
)
.
ConvertToBitmap
()
self
.
range
=
None
self
.
direction
=
None
...
...
@@ -49,6 +49,10 @@ class ZButtons(BufferedCanvas):
# Remember the last clicked value, so we can repeat when spacebar pressed
self
.
lastValue
=
None
self
.
bgcolor
=
wx
.
Colour
()
self
.
bgcolor
.
SetFromName
(
bgcolor
)
self
.
bgcolormask
=
wx
.
Colour
(
self
.
bgcolor
.
Red
(),
self
.
bgcolor
.
Green
(),
self
.
bgcolor
.
Blue
(),
128
)
BufferedCanvas
.
__init__
(
self
,
parent
,
ID
)
self
.
SetSize
(
wx
.
Size
(
59
,
244
))
...
...
@@ -102,6 +106,7 @@ class ZButtons(BufferedCanvas):
return
(
self
.
lookupRange
(
abs
(
ydelta
)),
sign
(
ydelta
))
def
draw
(
self
,
dc
,
w
,
h
):
dc
.
SetBackground
(
wx
.
Brush
(
self
.
bgcolor
))
dc
.
Clear
()
gc
=
wx
.
GraphicsContext
.
Create
(
dc
)
if
self
.
bg_bmp
:
...
...
@@ -123,8 +128,8 @@ class ZButtons(BufferedCanvas):
if
self
.
range
!=
None
and
self
.
direction
!=
None
:
self
.
highlight
(
gc
,
self
.
range
,
self
.
direction
)
else
:
gc
.
SetPen
(
wx
.
Pen
(
wx
.
Colour
(
255
,
255
,
255
,
0
),
4
))
gc
.
SetBrush
(
wx
.
Brush
(
wx
.
Colour
(
255
,
255
,
255
,
128
)
))
gc
.
SetPen
(
wx
.
Pen
(
self
.
bgcolor
,
0
))
gc
.
SetBrush
(
wx
.
Brush
(
self
.
bgcolormask
))
gc
.
DrawRectangle
(
0
,
0
,
w
,
h
)
## ------ ##
...
...
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