Moved duplicate code from shipbrowser items OnPaint in gui.utils.drawUtils
This commit is contained in:
21
gui/utils/drawUtils.py
Normal file
21
gui/utils/drawUtils.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import wx
|
||||
|
||||
def DrawGradientBar(width, height, gStart, gEnd, gMid = None):
|
||||
canvas = wx.EmptyBitmap(width,height)
|
||||
|
||||
mdc = wx.MemoryDC()
|
||||
mdc.SelectObject(canvas)
|
||||
|
||||
r = wx.Rect(0, 0, width, height)
|
||||
r.height = r.height / 2
|
||||
|
||||
if gMid is None:
|
||||
gMid = gStart
|
||||
|
||||
mdc.GradientFillLinear(r, gStart, gEnd, wx.SOUTH)
|
||||
r.top = r.height
|
||||
mdc.GradientFillLinear(r, gMid, gEnd, wx.NORTH)
|
||||
|
||||
mdc.SelectObject(wx.NullBitmap)
|
||||
|
||||
return canvas
|
||||
Reference in New Issue
Block a user