PR 41 from Metallicow. Pen and Brush style updates

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2014-01-11 23:12:52 +00:00
parent 7d3e2b7c2e
commit b0fa504d1d

View File

@@ -53,6 +53,7 @@ from time import clock
import wx import wx
from .Utilities import BBox from .Utilities import BBox
from . import GUIMode
## A global variable to hold the Pixels per inch that wxWindows thinks is in use ## A global variable to hold the Pixels per inch that wxWindows thinks is in use
@@ -267,23 +268,23 @@ class DrawObject:
} }
FillStyleList = { FillStyleList = {
"Transparent" : wx.TRANSPARENT, "Transparent" : wx.BRUSHSTYLE_TRANSPARENT,
"Solid" : wx.SOLID, "Solid" : wx.BRUSHSTYLE_SOLID,
"BiDiagonalHatch": wx.BDIAGONAL_HATCH, "BiDiagonalHatch": wx.BRUSHSTYLE_BDIAGONAL_HATCH,
"CrossDiagHatch" : wx.CROSSDIAG_HATCH, "CrossDiagHatch" : wx.BRUSHSTYLE_CROSSDIAG_HATCH,
"FDiagonal_Hatch": wx.FDIAGONAL_HATCH, "FDiagonal_Hatch": wx.BRUSHSTYLE_FDIAGONAL_HATCH,
"CrossHatch" : wx.CROSS_HATCH, "CrossHatch" : wx.BRUSHSTYLE_CROSS_HATCH,
"HorizontalHatch": wx.HORIZONTAL_HATCH, "HorizontalHatch": wx.BRUSHSTYLE_HORIZONTAL_HATCH,
"VerticalHatch" : wx.VERTICAL_HATCH "VerticalHatch" : wx.BRUSHSTYLE_VERTICAL_HATCH
} }
LineStyleList = { LineStyleList = {
"Solid" : wx.SOLID, "Solid" : wx.PENSTYLE_SOLID,
"Transparent": wx.TRANSPARENT, "Transparent": wx.PENSTYLE_TRANSPARENT,
"Dot" : wx.DOT, "Dot" : wx.PENSTYLE_DOT,
"LongDash" : wx.LONG_DASH, "LongDash" : wx.PENSTYLE_LONG_DASH,
"ShortDash" : wx.SHORT_DASH, "ShortDash" : wx.PENSTYLE_SHORT_DASH,
"DotDash" : wx.DOT_DASH, "DotDash" : wx.PENSTYLE_DOT_DASH,
} }
def Bind(self, Event, CallBackFun): def Bind(self, Event, CallBackFun):
@@ -1712,9 +1713,9 @@ class Text(TextObjectMixin, DrawObject):
Size = 14, Size = 14,
Color = "Black", Color = "Black",
BackgroundColor = None, BackgroundColor = None,
Family = wx.MODERN, Family = wx.FONTFAMILY_MODERN,
Style = wx.NORMAL, Style = wx.FONTSTYLE_NORMAL,
Weight = wx.NORMAL, Weight = wx.FONTWEIGHT_NORMAL,
Underlined = False, Underlined = False,
Position = 'tl', Position = 'tl',
InForeground = False, InForeground = False,
@@ -1823,17 +1824,17 @@ class ScaledText(TextObjectMixin, DrawObject):
* Family: Font family, a generic way of referring to fonts without * Family: Font family, a generic way of referring to fonts without
specifying actual facename. One of: specifying actual facename. One of:
* wx.DEFAULT: Chooses a default font. * wx.FONTFAMILY_DEFAULT: Chooses a default font.
* wx.DECORATI: A decorative font. * wx.FONTFAMILY_DECORATIVE: A decorative font.
* wx.ROMAN: A formal, serif font. * wx.FONTFAMILY_ROMAN: A formal, serif font.
* wx.SCRIPT: A handwriting font. * wx.FONTFAMILY_SCRIPT: A handwriting font.
* wx.SWISS: A sans-serif font. * wx.FONTFAMILY_SWISS: A sans-serif font.
* wx.MODERN: A fixed pitch font. * wx.FONTFAMILY_MODERN: A fixed pitch font.
.. note:: these are only as good as the wxWindows defaults, which aren't so good. .. note:: these are only as good as the wxWindows defaults, which aren't so good.
* Style: One of wx.NORMAL, wx.SLANT and wx.ITALIC. * Style: One of wx.FONTSTYLE_NORMAL, wx.FONTSTYLE_SLANT and wx.FONTSTYLE_ITALIC.
* Weight: One of wx.NORMAL, wx.LIGHT and wx.BOLD. * Weight: One of wx.FONTWEIGHT_NORMAL, wx.FONTWEIGHT_LIGHT and wx.FONTWEIGHT_BOLD.
* Underlined: The value can be True or False. At present this may have an an * Underlined: The value can be True or False. At present this may have an an
effect on Windows only. effect on Windows only.
@@ -1869,9 +1870,9 @@ class ScaledText(TextObjectMixin, DrawObject):
Size, Size,
Color = "Black", Color = "Black",
BackgroundColor = None, BackgroundColor = None,
Family = wx.MODERN, Family = wx.FONTFAMILY_MODERN,
Style = wx.NORMAL, Style = wx.FONTSTYLE_NORMAL,
Weight = wx.NORMAL, Weight = wx.FONTWEIGHT_NORMAL,
Underlined = False, Underlined = False,
Position = 'tl', Position = 'tl',
Font = None, Font = None,
@@ -2001,9 +2002,9 @@ class ScaledTextBox(TextObjectMixin, DrawObject):
LineWidth = 1, LineWidth = 1,
Width = None, Width = None,
PadSize = None, PadSize = None,
Family = wx.MODERN, Family = wx.FONTFAMILY_MODERN,
Style = wx.NORMAL, Style = wx.FONTSTYLE_NORMAL,
Weight = wx.NORMAL, Weight = wx.FONTWEIGHT_NORMAL,
Underlined = False, Underlined = False,
Position = 'tl', Position = 'tl',
Alignment = "left", Alignment = "left",
@@ -2868,7 +2869,6 @@ class FloatCanvas(wx.Panel):
self.SetProjectionFun(ProjectionFun) self.SetProjectionFun(ProjectionFun)
from . import GUIMode
self.GUIMode = None # making sure the arrribute exists self.GUIMode = None # making sure the arrribute exists
self.SetMode(GUIMode.GUIMouse()) # make the default Mouse Mode. self.SetMode(GUIMode.GUIMouse()) # make the default Mouse Mode.
@@ -2888,7 +2888,7 @@ class FloatCanvas(wx.Panel):
""" """
global FontScale global FontScale
dc = wx.ScreenDC() dc = wx.ScreenDC()
dc.SetFont(wx.Font(16, wx.ROMAN, wx.NORMAL, wx.NORMAL)) dc.SetFont(wx.Font(16, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))
E = dc.GetTextExtent("X") E = dc.GetTextExtent("X")
FontScale = 16/E[1] FontScale = 16/E[1]
del dc del dc