From ea181b5b72abfaf0534d7bb0c59850a7d1dabd94 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 23 Jan 2014 00:19:55 +0000 Subject: [PATCH] PR57: Mainly style changes, a few white space stuff and an xrange to range change. * Phoenix FONTFAMILY, STYLE, WEIGHT Fixes * PENSTYLE_ & BRUSHSTYLE_ Fixes * Fix FONTWEIGHT to FONTSTYLE typo * Phoenix Deprecations: wx.OPEN to wx.FD_OPEN * Phoenix Deprecations: wx.SAVE to wx.FD_SAVE git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75683 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- demo/AdjustChannels.py | 2 +- demo/AnalogClock.py | 4 +- demo/ArtProvider.py | 2 +- demo/Calendar.py | 4 +- demo/CollapsiblePane.py | 2 +- demo/ColourDB.py | 6 +- demo/CustomDragAndDrop.py | 4 +- demo/DragAndDrop.py | 6 +- demo/DragImage.py | 2 +- demo/DynamicSashWindow.py | 4 +- demo/FileHistory.py | 4 +- demo/FloatCanvas.py | 80 +++++++++++++-------------- demo/FontDialog.py | 2 +- demo/FontEnumerator.py | 2 +- demo/GenericButtons.py | 2 +- demo/GraphicsContext.py | 2 +- demo/GraphicsGradient.py | 4 +- demo/GridSimple.py | 4 +- demo/GridStdEdRend.py | 4 +- demo/Grid_MegaExample.py | 22 ++++---- demo/ImageAlpha.py | 2 +- demo/Img2PyArtProvider.py | 2 +- demo/Joystick.py | 16 +++--- demo/Main.py | 4 +- demo/MaskedEditControls.py | 24 ++++---- demo/MaskedNumCtrl.py | 2 +- demo/MediaCtrl.py | 2 +- demo/MimeTypesManager.py | 4 +- demo/MouseGestures.py | 2 +- demo/OGL.py | 8 +-- demo/OwnerDrawnComboBox.py | 24 ++++---- demo/PenAndBrushStyles.py | 55 +++++++++++++----- demo/PopupMenu.py | 4 +- demo/RichTextCtrl.py | 4 +- demo/ScrolledWindow.py | 12 ++-- demo/SplitTree.py | 15 ++--- demo/StandardPaths.py | 2 +- demo/StaticText.py | 2 +- demo/TextCtrl.py | 2 +- demo/Threads.py | 6 +- demo/Throbber.py | 4 +- demo/Timer.py | 2 +- demo/URLDragAndDrop.py | 4 +- demo/Unicode.py | 2 +- demo/Wizard.py | 2 +- demo/XmlResource.py | 2 +- demo/XmlResourceHandler.py | 6 +- demo/XmlResourceSubclass.py | 4 +- demo/agw/AUI.py | 2 +- demo/agw/AquaButton.py | 2 +- demo/agw/BalloonTip.py | 19 ++++--- demo/agw/ButtonPanel.py | 4 +- demo/agw/CustomTreeCtrl.py | 16 +++--- demo/agw/FlatMenu.py | 4 +- demo/agw/FlatNotebook.py | 4 +- demo/agw/FloatSpin.py | 2 +- demo/agw/FoldPanelBar.py | 2 +- demo/agw/GradientButton.py | 4 +- demo/agw/HyperLinkCtrl.py | 30 +++++----- demo/agw/HyperTreeList.py | 12 ++-- demo/agw/MacLargeDemo.py | 4 +- demo/agw/PersistentControls.py | 2 +- demo/agw/PyCollapsiblePane.py | 2 +- demo/agw/PyGauge.py | 2 +- demo/agw/ShapedButton.py | 28 +++++----- demo/agw/SuperToolTip.py | 4 +- demo/agw/UltimateReportDemo.py | 12 ++-- demo/agw/Windows7Explorer_Contents.py | 2 +- demo/agw/XLSGrid.py | 4 +- demo/agw/ZoomBar.py | 12 ++-- 70 files changed, 296 insertions(+), 257 deletions(-) diff --git a/demo/AdjustChannels.py b/demo/AdjustChannels.py index 9fc2a532..7d85aa56 100644 --- a/demo/AdjustChannels.py +++ b/demo/AdjustChannels.py @@ -109,7 +109,7 @@ class ImageWindow(wx.Window): # paint a background to show the alpha manipulation dc.SetBackground(wx.Brush("WHITE")) dc.Clear() - dc.SetBrush(wx.Brush("GREY", wx.CROSSDIAG_HATCH)) + dc.SetBrush(wx.Brush("GREY", wx.BRUSHSTYLE_CROSSDIAG_HATCH)) windowsize= self.GetSize() dc.DrawRectangle(0, 0, windowsize[0], windowsize[1]) diff --git a/demo/AnalogClock.py b/demo/AnalogClock.py index 018c4a8f..f1503ae6 100644 --- a/demo/AnalogClock.py +++ b/demo/AnalogClock.py @@ -51,7 +51,7 @@ class TestPanel(wx.Panel): c4.SetForegroundColour(colour) colour = wx.Colour(0, 132, 132) c4.SetShadowColour(colour) - c4.SetTickFont(wx.Font(10, wx.FONTFAMILY_MODERN, wx.NORMAL, wx.BOLD)) + c4.SetTickFont(wx.Font(10, wx.FONTFAMILY_MODERN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) c4.SetBackgroundColour(wx.BLACK) c4.SetFaceBorderColour(wx.BLACK) c4.SetFaceFillColour(wx.BLACK) @@ -101,7 +101,7 @@ class TestPanel(wx.Panel): c6.SetFaceFillColour(colour) colour = wx.Colour(255, 213, 213) c6.SetShadowColour(colour) - c6.SetTickFont(wx.Font(10, wx.FONTFAMILY_ROMAN, wx.NORMAL, wx.BOLD)) + c6.SetTickFont(wx.Font(10, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) # layout the clocks in a grid gs = wx.GridSizer(2, 3, 4, 4) diff --git a/demo/ArtProvider.py b/demo/ArtProvider.py index b9c6c344..b2d9f1ed 100644 --- a/demo/ArtProvider.py +++ b/demo/ArtProvider.py @@ -121,7 +121,7 @@ class TestPanel(wx.Panel): sizer = wx.BoxSizer(wx.VERTICAL) title = wx.StaticText(self, -1, "ArtProvider") - title.SetFont(wx.Font(18, wx.SWISS, wx.NORMAL, wx.BOLD)) + title.SetFont(wx.Font(18, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) sizer.Add(title, 0, wx.ALIGN_CENTRE|wx.ALL, 5) line = wx.StaticLine(self, -1, size=(20,-1), style=wx.LI_HORIZONTAL) diff --git a/demo/Calendar.py b/demo/Calendar.py index a66112d2..edddd8ae 100644 --- a/demo/Calendar.py +++ b/demo/Calendar.py @@ -367,8 +367,8 @@ class PrintCalend: self.back_color = 'WHITE' self.sel_color = 'RED' self.high_color = 'LIGHT BLUE' - self.font = wx.SWISS - self.bold = wx.NORMAL + self.font = wx.FONTFAMILY_SWISS + self.bold = wx.FONTWEIGHT_NORMAL self.sel_key = None # last used by self.sel_lst = [] # highlighted selected days diff --git a/demo/CollapsiblePane.py b/demo/CollapsiblePane.py index 2c35d712..cec30260 100644 --- a/demo/CollapsiblePane.py +++ b/demo/CollapsiblePane.py @@ -16,7 +16,7 @@ class TestPanel(wx.Panel): wx.Panel.__init__(self, parent, -1) title = wx.StaticText(self, label="wx.CollapsiblePane") - title.SetFont(wx.Font(18, wx.SWISS, wx.NORMAL, wx.BOLD)) + title.SetFont(wx.Font(18, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) title.SetForegroundColour("blue") self.cp = cp = wx.CollapsiblePane(self, label=label1, diff --git a/demo/ColourDB.py b/demo/ColourDB.py index b297e9b9..e0e72be2 100644 --- a/demo/ColourDB.py +++ b/demo/ColourDB.py @@ -20,7 +20,7 @@ class TestWindow(wx.ScrolledWindow): # This could also be done by getting the window's default font; # either way, we need to have a font loaded for later on. #self.SetBackgroundColour("WHITE") - self.font = wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL) + self.font = wx.Font(10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL) # Create drawing area and set its font dc = wx.ClientDC(self) @@ -97,7 +97,7 @@ class TestWindow(wx.ScrolledWindow): def Draw(self, dc, rgn=None, vs=None): dc.SetTextForeground("BLACK") - dc.SetPen(wx.Pen("BLACK", 1, wx.SOLID)) + dc.SetPen(wx.Pen("BLACK", 1, wx.PENSTYLE_SOLID)) dc.SetFont(self.font) colours = self.clrList numColours = len(colours) @@ -121,7 +121,7 @@ class TestWindow(wx.ScrolledWindow): dc.DrawText(clr, self.cellWidth, y) - brush = wx.Brush(clr, wx.SOLID) + brush = wx.Brush(clr, wx.BRUSHSTYLE_SOLID) dc.SetBrush(brush) dc.DrawRectangle(10 * self.cellWidth, y, 6 * self.cellWidth, self.textHeight) diff --git a/demo/CustomDragAndDrop.py b/demo/CustomDragAndDrop.py index 7c3e1b16..bb42e979 100644 --- a/demo/CustomDragAndDrop.py +++ b/demo/CustomDragAndDrop.py @@ -197,7 +197,7 @@ class CustomDnDPanel(wx.Panel): def __init__(self, parent, log): wx.Panel.__init__(self, parent, -1) - self.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD, False)) + self.SetFont(wx.Font(10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False)) # Make the controls text1 = wx.StaticText(self, -1, @@ -266,7 +266,7 @@ class TestPanel(wx.Panel): msg = "Custom Drag-And-Drop" text = wx.StaticText(self, -1, "", style=wx.ALIGN_CENTRE) - text.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD, False)) + text.SetFont(wx.Font(24, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False)) text.SetLabel(msg) w,h = text.GetTextExtent(msg) text.SetSize(wx.Size(w,h+1)) diff --git a/demo/DragAndDrop.py b/demo/DragAndDrop.py index 029b1b44..420d0053 100644 --- a/demo/DragAndDrop.py +++ b/demo/DragAndDrop.py @@ -14,7 +14,7 @@ class ClipTextPanel(wx.Panel): wx.Panel.__init__(self, parent, -1) self.log = log - #self.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD, False)) + #self.SetFont(wx.Font(10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False)) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add( @@ -155,7 +155,7 @@ class FileDropPanel(wx.Panel): def __init__(self, parent, log): wx.Panel.__init__(self, parent, -1) - #self.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD, False)) + #self.SetFont(wx.Font(10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False)) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add( @@ -209,7 +209,7 @@ class TestPanel(wx.Panel): msg = "Clipboard / Drag-And-Drop" text = wx.StaticText(self, -1, "", style=wx.ALIGN_CENTRE) - text.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD, False)) + text.SetFont(wx.Font(24, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False)) text.SetLabel(msg) w,h = text.GetTextExtent(msg) diff --git a/demo/DragImage.py b/demo/DragImage.py index ee608343..9d2f8186 100644 --- a/demo/DragImage.py +++ b/demo/DragImage.py @@ -74,7 +74,7 @@ class DragCanvas(wx.ScrolledWindow): # 'draw' the text onto the bitmap dc = wx.MemoryDC() dc.SelectObject(bmp) - dc.SetBackground(wx.Brush(bg_colour, wx.SOLID)) + dc.SetBackground(wx.Brush(bg_colour, wx.BRUSHSTYLE_SOLID)) dc.Clear() dc.SetTextForeground(wx.RED) dc.SetFont(font) diff --git a/demo/DynamicSashWindow.py b/demo/DynamicSashWindow.py index fab2767f..c103d0ac 100644 --- a/demo/DynamicSashWindow.py +++ b/demo/DynamicSashWindow.py @@ -16,7 +16,7 @@ class TestView(stc.StyledTextCtrl): self.SetMarginWidth(1,0) self.StyleSetFont(stc.STC_STYLE_DEFAULT, - wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL)) + wx.Font(10, wx.FONTFAMILY_MODERN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.Bind(gizmos.EVT_DYNAMIC_SASH_SPLIT, self.OnSplit) self.Bind(gizmos.EVT_DYNAMIC_SASH_UNIFY, self.OnUnify) @@ -103,7 +103,7 @@ def runTest(frame, nb, log): #| wxDS_DRAG_CORNER ) - win.SetFont(wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL)) + win.SetFont(wx.Font(10, wx.FONTFAMILY_MODERN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) view = TestView(win, -1, log) view.SetText(sampleText) else: diff --git a/demo/FileHistory.py b/demo/FileHistory.py index 8a587229..92f1e03a 100644 --- a/demo/FileHistory.py +++ b/demo/FileHistory.py @@ -23,8 +23,8 @@ class TestPanel(wx.Panel): # Make and layout the controls fs = self.GetFont().GetPointSize() - bf = wx.Font(fs+4, wx.SWISS, wx.NORMAL, wx.BOLD) - nf = wx.Font(fs+2, wx.SWISS, wx.NORMAL, wx.NORMAL) + bf = wx.Font(fs+4, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD) + nf = wx.Font(fs+2, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL) t = wx.StaticText(self, -1, "FileHistory") t.SetFont(bf) diff --git a/demo/FloatCanvas.py b/demo/FloatCanvas.py index dc9de9c1..3820f302 100644 --- a/demo/FloatCanvas.py +++ b/demo/FloatCanvas.py @@ -198,7 +198,7 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import import os dlg = wx.FileDialog( self, message="Save file as ...", defaultDir=os.getcwd(), - defaultFile="", wildcard="*.png", style=wx.SAVE + defaultFile="", wildcard="*.png", style=wx.FD_SAVE ) if dlg.ShowModal() == wx.ID_OK: path = dlg.GetPath() @@ -917,15 +917,15 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import self.Canvas.AddText("20 Pixels", (-10,5), Size = 20) self.Canvas.AddText("10 Pixels", (-10,3), Size = 10) - self.Canvas.AddText("MODERN Font", (-10, 0), Family = wx.MODERN) - self.Canvas.AddText("DECORATIVE Font", (-10, -1), Family = wx.DECORATIVE) - self.Canvas.AddText("ROMAN Font", (-10, -2), Family = wx.ROMAN) - self.Canvas.AddText("SCRIPT Font", (-10, -3), Family = wx.SCRIPT) - self.Canvas.AddText("ROMAN BOLD Font", (-10, -4), Family = wx.ROMAN, Weight=wx.BOLD) - self.Canvas.AddText("ROMAN ITALIC BOLD Font", (-10, -5), Family = wx.ROMAN, Weight=wx.BOLD, Style=wx.ITALIC) + self.Canvas.AddText("MODERN Font", (-10, 0), Family = wx.FONTFAMILY_MODERN) + self.Canvas.AddText("DECORATIVE Font", (-10, -1), Family = wx.FONTFAMILY_DECORATIVE) + self.Canvas.AddText("ROMAN Font", (-10, -2), Family = wx.FONTFAMILY_ROMAN) + self.Canvas.AddText("SCRIPT Font", (-10, -3), Family = wx.FONTFAMILY_SCRIPT) + self.Canvas.AddText("ROMAN BOLD Font", (-10, -4), Family = wx.FONTFAMILY_ROMAN, Weight=wx.FONTWEIGHT_BOLD) + self.Canvas.AddText("ROMAN ITALIC BOLD Font", (-10, -5), Family = wx.FONTFAMILY_ROMAN, Weight=wx.FONTWEIGHT_BOLD, Style=wx.FONTSTYLE_ITALIC) # NOTE: this font exists on my Linux box..who knows were else you'll find it! - Font = wx.Font(20, wx.DEFAULT, wx.ITALIC, wx.NORMAL, False, "helvetica") + Font = wx.Font(20, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_ITALIC, wx.FONTWEIGHT_NORMAL, False, "helvetica") self.Canvas.AddText("Helvetica Italic", (-10, -6), Font = Font) self.Canvas.ZoomToBB() @@ -965,22 +965,22 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import x = -200 - self.Canvas.AddScaledText("MODERN Font", (x, 0), Size = 7, Family = wx.MODERN, Color = (0,0,0)) - self.Canvas.AddScaledText("DECORATIVE Font", (x, -10), Size = 7, Family = wx.DECORATIVE, Color = (0,0,1)) - self.Canvas.AddScaledText("ROMAN Font", (x, -20), Size = 7, Family = wx.ROMAN) - self.Canvas.AddScaledText("SCRIPT Font", (x, -30), Size = 7, Family = wx.SCRIPT) - self.Canvas.AddScaledText("ROMAN BOLD Font", (x, -40), Size = 7, Family = wx.ROMAN, Weight=wx.BOLD) - self.Canvas.AddScaledText("ROMAN ITALIC BOLD Font", (x, -50), Size = 7, Family = wx.ROMAN, Weight=wx.BOLD, Style=wx.ITALIC) + self.Canvas.AddScaledText("MODERN Font", (x, 0), Size = 7, Family = wx.FONTFAMILY_MODERN, Color = (0,0,0)) + self.Canvas.AddScaledText("DECORATIVE Font", (x, -10), Size = 7, Family = wx.FONTFAMILY_DECORATIVE, Color = (0,0,1)) + self.Canvas.AddScaledText("ROMAN Font", (x, -20), Size = 7, Family = wx.FONTFAMILY_ROMAN) + self.Canvas.AddScaledText("SCRIPT Font", (x, -30), Size = 7, Family = wx.FONTFAMILY_SCRIPT) + self.Canvas.AddScaledText("ROMAN BOLD Font", (x, -40), Size = 7, Family = wx.FONTFAMILY_ROMAN, Weight=wx.FONTWEIGHT_BOLD) + self.Canvas.AddScaledText("ROMAN ITALIC BOLD Font", (x, -50), Size = 7, Family = wx.FONTFAMILY_ROMAN, Weight=wx.FONTWEIGHT_BOLD, Style=wx.FONTSTYLE_ITALIC) Canvas.AddPointSet((x,0), Color = "White", Diameter = 4) # NOTE: this font exists on my OS-X.who knows were else you'll find it! Point = (-100, 50) - Font = wx.Font(12, wx.DEFAULT, wx.ITALIC, wx.NORMAL, False, "helvetica") + Font = wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_ITALIC, wx.FONTWEIGHT_NORMAL, False, "helvetica") T = self.Canvas.AddScaledText("Helvetica Italic", Point, Size = 20, Font = Font, Position = 'bc') Point = (-50, -50) - Font = wx.Font(12, wx.DEFAULT, wx.ITALIC, wx.NORMAL, False, "times") + Font = wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_ITALIC, wx.FONTWEIGHT_NORMAL, False, "times") T = self.Canvas.AddScaledText("Times Font", Point, Size = 8, Font = Font) self.Canvas.ZoomToBB() @@ -1003,9 +1003,9 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import LineWidth = 1, Width = None, PadSize = 5, - Family = wx.ROMAN, - Style = wx.NORMAL, - Weight = wx.NORMAL, + Family = wx.FONTFAMILY_ROMAN, + Style = wx.FONTSTYLE_NORMAL, + Weight = wx.FONTWEIGHT_NORMAL, Underlined = False, Position = 'br', Alignment = "left", @@ -1023,7 +1023,7 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import LineColor = "Red", LineStyle = "Solid", PadSize = 5, - Family = wx.TELETYPE, + Family = wx.FONTFAMILY_TELETYPE, Position = 'bl') Box = Canvas.AddScaledTextBox("A String\nThis box is clickable", @@ -1033,7 +1033,7 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import LineColor = "Red", LineStyle = "Solid", PadSize = 5, - Family = wx.TELETYPE, + Family = wx.FONTFAMILY_TELETYPE, Position = 'tr') Box.Bind(FloatCanvas.EVT_FC_LEFT_DOWN, self.binding2) @@ -1051,9 +1051,9 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import LineWidth = 2, Width = None, PadSize = 5, - Family = wx.TELETYPE, - Style = wx.NORMAL, - Weight = wx.NORMAL, + Family = wx.FONTFAMILY_TELETYPE, + Style = wx.FONTSTYLE_NORMAL, + Weight = wx.FONTWEIGHT_NORMAL, Underlined = False, Position = 'cr', Alignment = "left", @@ -1069,9 +1069,9 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import LineWidth = 2, Width = None, PadSize = 5, - Family = wx.TELETYPE, - Style = wx.NORMAL, - Weight = wx.NORMAL, + Family = wx.FONTFAMILY_TELETYPE, + Style = wx.FONTSTYLE_NORMAL, + Weight = wx.FONTWEIGHT_NORMAL, Underlined = False, Position = 'cl', Alignment = "left", @@ -1090,9 +1090,9 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import LineWidth = 2, Width = None, PadSize = 3, - Family = wx.TELETYPE, - Style = wx.NORMAL, - Weight = wx.NORMAL, + Family = wx.FONTFAMILY_TELETYPE, + Style = wx.FONTSTYLE_NORMAL, + Weight = wx.FONTWEIGHT_NORMAL, Underlined = False, Position = 'tc', Alignment = "left", @@ -1108,9 +1108,9 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import LineWidth = 2, Width = None, PadSize = 0.5, - Family = wx.TELETYPE, - Style = wx.NORMAL, - Weight = wx.NORMAL, + Family = wx.FONTFAMILY_TELETYPE, + Style = wx.FONTSTYLE_NORMAL, + Weight = wx.FONTWEIGHT_NORMAL, Underlined = False, Position = 'bc', Alignment = "left", @@ -1126,7 +1126,7 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import LineWidth = 2, Width = 20, PadSize = 0.5, - Family = wx.TELETYPE, + Family = wx.FONTFAMILY_TELETYPE, ) Box = Canvas.AddScaledTextBox("Some more auto wrapped text. Wrapped to a different width.\n\nThis is another paragraph.", @@ -1136,7 +1136,7 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import LineWidth = 2, Width = 40, PadSize = 0.5, - Family = wx.ROMAN, + Family = wx.FONTFAMILY_ROMAN, Alignment = "right" ) Point = N.array((100, -20), N.float_) @@ -1147,7 +1147,7 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import LineWidth = 1, Width = 40, PadSize = 0.0, - Family = wx.ROMAN, + Family = wx.FONTFAMILY_ROMAN, Position = "cc", LineSpacing = 0.8 ) @@ -1166,7 +1166,7 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import LineColor = "White", Width = None, PadSize = 2, - Family = wx.ROMAN, + Family = wx.FONTFAMILY_ROMAN, Position = Position, LineSpacing = 0.8 ) @@ -1182,7 +1182,7 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import LineColor = "White", Width = None, PadSize = 2, - Family = wx.ROMAN, + Family = wx.FONTFAMILY_ROMAN, Position = "tl", Alignment = "center", LineSpacing = 0.8 @@ -1197,7 +1197,7 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import LineColor = None, Width = None, PadSize = 2, - Family = wx.ROMAN, + Family = wx.FONTFAMILY_ROMAN, Position = "tl", Alignment = "right", LineSpacing = 0.8 @@ -1211,7 +1211,7 @@ def BuildDrawFrame(): # this gets called when needed, rather than on import LineWidth = 1, Width = 40, PadSize = 2.0, - Family = wx.ROMAN, + Family = wx.FONTFAMILY_ROMAN, Position = "cc", LineSpacing = 0.8, Alignment = 'center', diff --git a/demo/FontDialog.py b/demo/FontDialog.py index 253ee4dc..92564929 100644 --- a/demo/FontDialog.py +++ b/demo/FontDialog.py @@ -30,7 +30,7 @@ class TestPanel(wx.Panel): fgs.Add(wx.StaticText(self, -1, "PointSize:")) self.ps = wx.StaticText(self, -1, "") font = self.ps.GetFont() - font.SetWeight(wx.BOLD) + font.SetWeight(wx.FONTWEIGHT_BOLD) self.ps.SetFont(font) fgs.Add(self.ps, 0, wx.ADJUST_MINSIZE) diff --git a/demo/FontEnumerator.py b/demo/FontEnumerator.py index f5ac9188..70354f56 100644 --- a/demo/FontEnumerator.py +++ b/demo/FontEnumerator.py @@ -42,7 +42,7 @@ class TestPanel(wx.Panel): def OnSelect(self, evt): face = self.lb1.GetStringSelection() - font = wx.Font(28, wx.DEFAULT, wx.NORMAL, wx.NORMAL, False, face) + font = wx.Font(28, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, face) self.txt.SetLabel(face) self.txt.SetFont(font) if wx.Platform == "__WXMAC__": self.Refresh() diff --git a/demo/GenericButtons.py b/demo/GenericButtons.py index 5c6874dd..1e88ba9a 100644 --- a/demo/GenericButtons.py +++ b/demo/GenericButtons.py @@ -41,7 +41,7 @@ class TestPanel(wx.Panel): # Also, this one is fancier, with custom colors and bezel size. b = buttons.GenButton(self, -1, 'bigger') self.Bind(wx.EVT_BUTTON, self.OnBiggerButton, b) - b.SetFont(wx.Font(20, wx.SWISS, wx.NORMAL, wx.BOLD, False)) + b.SetFont(wx.Font(20, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False)) b.SetBezelWidth(5) b.SetMinSize(wx.DefaultSize) b.SetBackgroundColour("Navy") diff --git a/demo/GraphicsContext.py b/demo/GraphicsContext.py index 3d997501..78134144 100644 --- a/demo/GraphicsContext.py +++ b/demo/GraphicsContext.py @@ -87,7 +87,7 @@ class TestPanel(wx.Panel): def Draw(self, gc): font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) - font.SetWeight(wx.BOLD) + font.SetWeight(wx.FONTWEIGHT_BOLD) gc.SetFont(font, wx.BLACK) # make a path that contains a circle and some lines, centered at 0,0 diff --git a/demo/GraphicsGradient.py b/demo/GraphicsGradient.py index ad79df7d..465ad2f8 100644 --- a/demo/GraphicsGradient.py +++ b/demo/GraphicsGradient.py @@ -88,7 +88,7 @@ class TestPanel(scrolled.ScrolledPanel): # and the other widgets for collecting data about the gradient label1 = wx.StaticText(self, -1, "Geometry") - label1.SetFont(wx.FFont(15, wx.SWISS, wx.FONTFLAG_BOLD)) + label1.SetFont(wx.FFont(15, wx.FONTFAMILY_SWISS, wx.FONTFLAG_BOLD)) x1 = 0 x2 = self.gpanel.Size.width y0 = self.gpanel.Size.height / 2 @@ -98,7 +98,7 @@ class TestPanel(scrolled.ScrolledPanel): self.y2 = wx.TextCtrl(self, value=str(y0), size=(50,-1)) label2 = wx.StaticText(self, -1, "Stops") - label2.SetFont(wx.FFont(15, wx.SWISS, wx.FONTFLAG_BOLD)) + label2.SetFont(wx.FFont(15, wx.FONTFAMILY_SWISS, wx.FONTFLAG_BOLD)) firstStop = GradientStopPanel(self, 0.0) lastStop = GradientStopPanel(self, 1.0, wx.WHITE) self.stops = [firstStop, lastStop] diff --git a/demo/GridSimple.py b/demo/GridSimple.py index 77e92c98..8171b801 100644 --- a/demo/GridSimple.py +++ b/demo/GridSimple.py @@ -24,7 +24,7 @@ class SimpleGrid(gridlib.Grid): ##, mixins.GridAutoEditMixin): self.SetCellValue(1, 1, "Another cell") self.SetCellValue(2, 2, "Yet another cell") self.SetCellValue(3, 3, "This cell is read-only") - self.SetCellFont(0, 0, wx.Font(12, wx.ROMAN, wx.ITALIC, wx.NORMAL)) + self.SetCellFont(0, 0, wx.Font(12, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_ITALIC, wx.FONTWEIGHT_NORMAL)) self.SetCellTextColour(1, 1, wx.RED) self.SetCellBackgroundColour(2, 2, wx.CYAN) self.SetReadOnly(3, 3, True) @@ -45,7 +45,7 @@ class SimpleGrid(gridlib.Grid): ##, mixins.GridAutoEditMixin): attr = gridlib.GridCellAttr() attr.SetTextColour(wx.BLACK) attr.SetBackgroundColour(wx.RED) - attr.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD)) + attr.SetFont(wx.Font(10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) # you can set cell attributes for the whole row (or column) self.SetRowAttr(5, attr) diff --git a/demo/GridStdEdRend.py b/demo/GridStdEdRend.py index dc670fef..d758f590 100644 --- a/demo/GridStdEdRend.py +++ b/demo/GridStdEdRend.py @@ -12,7 +12,7 @@ class MyCustomRenderer(gridlib.GridCellRenderer): def Draw(self, grid, attr, dc, rect, row, col, isSelected): dc.SetBackgroundMode(wx.SOLID) - dc.SetBrush(wx.Brush(wx.BLACK, wx.SOLID)) + dc.SetBrush(wx.Brush(wx.BLACK, wx.BRUSHSTYLE_SOLID)) dc.SetPen(wx.TRANSPARENT_PEN) dc.DrawRectangle(rect) @@ -138,7 +138,7 @@ Renderers used together. row = row + 2 font = self.GetFont() - font.SetWeight(wx.BOLD) + font.SetWeight(wx.FONTWEIGHT_BOLD) attr = gridlib.GridCellAttr() attr.SetFont(font) attr.SetBackgroundColour(wx.LIGHT_GREY) diff --git a/demo/Grid_MegaExample.py b/demo/Grid_MegaExample.py index 8eeb48e4..1d1ccf3c 100644 --- a/demo/Grid_MegaExample.py +++ b/demo/Grid_MegaExample.py @@ -214,11 +214,11 @@ class MegaImageRenderer(Grid.GridCellRenderer): dc.SetBackgroundMode(wx.SOLID) if isSelected: - dc.SetBrush(wx.Brush(wx.BLUE, wx.SOLID)) - dc.SetPen(wx.Pen(wx.BLUE, 1, wx.SOLID)) + dc.SetBrush(wx.Brush(wx.BLUE, wx.BRUSHSTYLE_SOLID)) + dc.SetPen(wx.Pen(wx.BLUE, 1, wx.PENSTYLE_SOLID)) else: - dc.SetBrush(wx.Brush(wx.WHITE, wx.SOLID)) - dc.SetPen(wx.Pen(wx.WHITE, 1, wx.SOLID)) + dc.SetBrush(wx.Brush(wx.WHITE, wx.BRUSHSTYLE_SOLID)) + dc.SetPen(wx.Pen(wx.WHITE, 1, wx.PENSTYLE_SOLID)) dc.DrawRectangleRect(rect) @@ -242,9 +242,9 @@ class MegaFontRenderer(Grid.GridCellRenderer): Grid.GridCellRenderer.__init__(self) self.table = table self.color = color - self.font = wx.Font(fontsize, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, font) - self.selectedBrush = wx.Brush("blue", wx.SOLID) - self.normalBrush = wx.Brush(wx.WHITE, wx.SOLID) + self.font = wx.Font(fontsize, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, font) + self.selectedBrush = wx.Brush("blue", wx.BRUSHSTYLE_SOLID) + self.normalBrush = wx.Brush(wx.WHITE, wx.BRUSHSTYLE_SOLID) self.colSize = None self.rowSize = 50 @@ -259,11 +259,11 @@ class MegaFontRenderer(Grid.GridCellRenderer): dc.SetBackgroundMode(wx.SOLID) if isSelected: - dc.SetBrush(wx.Brush(wx.BLUE, wx.SOLID)) - dc.SetPen(wx.Pen(wx.BLUE, 1, wx.SOLID)) + dc.SetBrush(wx.Brush(wx.BLUE, wx.BRUSHSTYLE_SOLID)) + dc.SetPen(wx.Pen(wx.BLUE, 1, wx.PENSTYLE_SOLID)) else: - dc.SetBrush(wx.Brush(wx.WHITE, wx.SOLID)) - dc.SetPen(wx.Pen(wx.WHITE, 1, wx.SOLID)) + dc.SetBrush(wx.Brush(wx.WHITE, wx.BRUSHSTYLE_SOLID)) + dc.SetPen(wx.Pen(wx.WHITE, 1, wx.PENSTYLE_SOLID)) dc.DrawRectangleRect(rect) text = self.table.GetValue(row, col) diff --git a/demo/ImageAlpha.py b/demo/ImageAlpha.py index 9613a8ce..8341e919 100644 --- a/demo/ImageAlpha.py +++ b/demo/ImageAlpha.py @@ -20,7 +20,7 @@ class TestPanel(wx.Panel): dc.SetBackground(wx.Brush("WHITE")) dc.Clear() - dc.SetFont(wx.Font(16, wx.SWISS, wx.NORMAL, wx.BOLD, True)) + dc.SetFont(wx.Font(16, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, True)) dc.DrawText("Bitmap alpha blending (on all ports but gtk+ 1.2)", 25,25) diff --git a/demo/Img2PyArtProvider.py b/demo/Img2PyArtProvider.py index bd2f55c7..15ce996a 100644 --- a/demo/Img2PyArtProvider.py +++ b/demo/Img2PyArtProvider.py @@ -15,7 +15,7 @@ class TestPanel(wx.Panel): self.SetSizer(sizer) title = wx.StaticText(self, -1, "Img2PyArtProvider") - title.SetFont(wx.Font(18, wx.SWISS, wx.NORMAL, wx.BOLD)) + title.SetFont(wx.Font(18, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) sizer.Add(title, 0, wx.ALIGN_CENTRE|wx.ALL, 5) line = wx.StaticLine(self, -1, size=(20,-1), style=wx.LI_HORIZONTAL) diff --git a/demo/Joystick.py b/demo/Joystick.py index cbf9f207..6dad47d7 100644 --- a/demo/Joystick.py +++ b/demo/Joystick.py @@ -35,7 +35,7 @@ class Label(wx.StaticText): wx.StaticText.__init__(self, parent, -1, label, style=wx.ALIGN_RIGHT) f = parent.GetFont() - f.SetWeight(wx.BOLD) + f.SetWeight(wx.FONTWEIGHT_BOLD) self.SetFont(f) #---------------------------------------------------------------------------- @@ -94,7 +94,7 @@ class JoyGauge(wx.Panel): dc.SetBrush(wx.Brush(wx.Colour(251, 252, 237))) dc.DrawRectangle(xorigin, yorigin, edgeSize, edgeSize) - dc.SetPen(wx.Pen(wx.BLACK, 1, wx.DOT_DASH)) + dc.SetPen(wx.Pen(wx.BLACK, 1, wx.PENSTYLE_DOT_DASH)) dc.DrawLine(xorigin, yorigin + center, xorigin + edgeSize, yorigin + center) dc.DrawLine(xorigin + center, yorigin, xorigin + center, yorigin + edgeSize) @@ -157,7 +157,7 @@ class JoyPanel(wx.Panel): fn = parent.GetFont() fn.SetPointSize(fn.GetPointSize() + 3) - fn.SetWeight(wx.BOLD) + fn.SetWeight(wx.FONTWEIGHT_BOLD) t = wx.StaticText(self, -1, "X - Y Axes", style = wx.ALIGN_CENTRE) t.SetFont(fn) @@ -236,7 +236,7 @@ class POVGauge(wx.Panel): dc.DrawCircle(xcenter, ycenter, 10) # fancy decorations - dc.SetPen(wx.Pen(wx.BLACK, 1, wx.DOT_DASH)) + dc.SetPen(wx.Pen(wx.BLACK, 1, wx.PENSTYLE_DOT_DASH)) dc.DrawLine(xorigin, ycenter, xorigin + diameter, ycenter) dc.DrawLine(xcenter, yorigin, xcenter, yorigin + diameter) @@ -349,7 +349,7 @@ class POVPanel(wx.Panel): fn = parent.GetFont() fn.SetPointSize(fn.GetPointSize() + 3) - fn.SetWeight(wx.BOLD) + fn.SetWeight(wx.FONTWEIGHT_BOLD) t = wx.StaticText(self, -1, "POV Control", style = wx.ALIGN_CENTER) t.SetFont(fn) @@ -386,7 +386,7 @@ class LED(wx.Panel): fn = parent.GetFont() fn.SetPointSize(fn.GetPointSize() - 1) - fn.SetWeight(wx.BOLD) + fn.SetWeight(wx.FONTWEIGHT_BOLD) self.fn = fn wx.Panel.__init__(self, parent, -1, size=self.size) @@ -488,7 +488,7 @@ class JoyButtons(wx.Panel): fn = parent.GetFont() fn.SetPointSize(fn.GetPointSize() + 3) - fn.SetWeight(wx.BOLD) + fn.SetWeight(wx.FONTWEIGHT_BOLD) t = wx.StaticText(self, -1, "Buttons", style = wx.ALIGN_LEFT) t.SetFont(fn) @@ -659,7 +659,7 @@ class AxisBar(wx.Gauge): # Copy the default font, make it bold. fn = self.GetParent().GetFont() - fn.SetWeight(wx.BOLD) + fn.SetWeight(wx.FONTWEIGHT_BOLD) # Set the font for the DC ... dc.SetFont(fn) diff --git a/demo/Main.py b/demo/Main.py index 4194305c..a94c60ce 100644 --- a/demo/Main.py +++ b/demo/Main.py @@ -2075,8 +2075,8 @@ class wxPythonDemo(wx.Frame): if USE_CUSTOMTREECTRL or 'wxMSW' not in wx.PlatformInfo: treeFont.SetPointSize(treeFont.GetPointSize()+2) - treeFont.SetWeight(wx.BOLD) - catFont.SetWeight(wx.BOLD) + treeFont.SetWeight(wx.FONTWEIGHT_BOLD) + catFont.SetWeight(wx.FONTWEIGHT_BOLD) self.tree.SetItemFont(self.root, treeFont) firstChild = None diff --git a/demo/MaskedEditControls.py b/demo/MaskedEditControls.py index 6a5c7883..01cee3c1 100644 --- a/demo/MaskedEditControls.py +++ b/demo/MaskedEditControls.py @@ -19,11 +19,11 @@ class demoMixin: regex = wx.StaticText( self, -1, "Regexp Validator(opt.)" ) ctrl = wx.StaticText( self, -1, "Masked TextCtrl" ) - description.SetFont( wx.Font(9, wx.SWISS, wx.NORMAL, wx.BOLD)) - mask.SetFont( wx.Font(9, wx.SWISS, wx.NORMAL, wx.BOLD)) - formatcode.SetFont( wx.Font(9, wx.SWISS, wx.NORMAL, wx.BOLD) ) - regex.SetFont( wx.Font(9, wx.SWISS, wx.NORMAL, wx.BOLD)) - ctrl.SetFont( wx.Font(9, wx.SWISS, wx.NORMAL, wx.BOLD)) + description.SetFont( wx.Font(9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) + mask.SetFont( wx.Font(9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) + formatcode.SetFont( wx.Font(9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD) ) + regex.SetFont( wx.Font(9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) + ctrl.SetFont( wx.Font(9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) sizer.Add(description) sizer.Add(mask) @@ -164,9 +164,9 @@ Many of these already do complicated validation; To see some examples, try autofmt = wx.StaticText( self, -1, "AutoFormat Code") ctrl = wx.StaticText( self, -1, "Masked Ctrl") - description.SetFont( wx.Font( 9, wx.SWISS, wx.NORMAL, wx.BOLD ) ) - autofmt.SetFont( wx.Font( 9, wx.SWISS, wx.NORMAL, wx.BOLD ) ) - ctrl.SetFont( wx.Font( 9, wx.SWISS, wx.NORMAL, wx.BOLD ) ) + description.SetFont( wx.Font( 9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD ) ) + autofmt.SetFont( wx.Font( 9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD ) ) + ctrl.SetFont( wx.Font( 9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD ) ) grid = wx.FlexGridSizer( cols=3, vgap=10, hgap=5 ) grid.Add( description, 0, wx.ALIGN_LEFT ) @@ -257,10 +257,10 @@ Page Up and Shift-Up arrow will similarly cycle backwards through the list. fields = wx.StaticText( self, -1, "Field Objects" ) ctrl = wx.StaticText( self, -1, "Masked TextCtrl" ) - description.SetFont( wx.Font( 9, wx.SWISS, wx.NORMAL, wx.BOLD ) ) - autofmt.SetFont( wx.Font( 9, wx.SWISS, wx.NORMAL, wx.BOLD ) ) - fields.SetFont( wx.Font( 9, wx.SWISS, wx.NORMAL, wx.BOLD ) ) - ctrl.SetFont( wx.Font( 9, wx.SWISS, wx.NORMAL, wx.BOLD ) ) + description.SetFont( wx.Font( 9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD ) ) + autofmt.SetFont( wx.Font( 9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD ) ) + fields.SetFont( wx.Font( 9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD ) ) + ctrl.SetFont( wx.Font( 9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD ) ) grid = wx.FlexGridSizer( cols=4, vgap=10, hgap=10 ) grid.Add( description, 0, wx.ALIGN_LEFT ) diff --git a/demo/MaskedNumCtrl.py b/demo/MaskedNumCtrl.py index c009529b..691d6ffa 100644 --- a/demo/MaskedNumCtrl.py +++ b/demo/MaskedNumCtrl.py @@ -66,7 +66,7 @@ The controls at the top reconfigure the resulting control at the bottom. label = wx.StaticText( panel, -1, "Resulting numeric control:" ) font = label.GetFont() - font.SetWeight(wx.BOLD) + font.SetWeight(wx.FONTWEIGHT_BOLD) label.SetFont(font) self.target_ctl = masked.NumCtrl( panel, -1, name="target control" ) diff --git a/demo/MediaCtrl.py b/demo/MediaCtrl.py index 6a85b78f..ade9012c 100644 --- a/demo/MediaCtrl.py +++ b/demo/MediaCtrl.py @@ -91,7 +91,7 @@ class TestPanel(wx.Panel): def OnLoadFile(self, evt): dlg = wx.FileDialog(self, message="Choose a media file", defaultDir=os.getcwd(), defaultFile="", - style=wx.OPEN | wx.CHANGE_DIR ) + style=wx.FD_OPEN | wx.FD_CHANGE_DIR ) if dlg.ShowModal() == wx.ID_OK: path = dlg.GetPath() self.DoLoadFile(path) diff --git a/demo/MimeTypesManager.py b/demo/MimeTypesManager.py index 776619ee..9b357f77 100644 --- a/demo/MimeTypesManager.py +++ b/demo/MimeTypesManager.py @@ -35,7 +35,7 @@ class MimeTypesDemoPanel(wx.Panel): # This will be used for all of the labels that follow (bold label) bfont = self.GetFont() - bfont.SetWeight(wx.BOLD) + bfont.SetWeight(wx.FONTWEIGHT_BOLD) # Contains everything tsizer = wx.BoxSizer(wx.VERTICAL) @@ -70,7 +70,7 @@ class MimeTypesDemoPanel(wx.Panel): f = self.GetFont() f.SetPointSize(f.GetPointSize() * 2) - f.SetWeight(wx.BOLD) + f.SetWeight(wx.FONTWEIGHT_BOLD) lbox.SetFont(f) lsizer = wx.StaticBoxSizer(lbox, wx.HORIZONTAL) diff --git a/demo/MouseGestures.py b/demo/MouseGestures.py index d4af8490..b2b71431 100644 --- a/demo/MouseGestures.py +++ b/demo/MouseGestures.py @@ -55,7 +55,7 @@ class TestPanel(wx.Panel): msg = "Mouse Gestures" text = wx.StaticText(self, -1, "", style=wx.ALIGN_CENTRE) - text.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD, False)) + text.SetFont(wx.Font(24, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False)) text.SetLabel(msg) w,h = text.GetTextExtent(msg) diff --git a/demo/OGL.py b/demo/OGL.py index bc62f7dd..2c0d8d1f 100644 --- a/demo/OGL.py +++ b/demo/OGL.py @@ -38,7 +38,7 @@ class DrawnShape(ogl.DrawnShape): self.DrawEllipse((-30, 25, 60, 20)) self.SetDrawnTextColour(wx.BLACK) - self.SetDrawnFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL)) + self.SetDrawnFont(wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.DrawText("DrawText", (-26, 28)) self.SetDrawnBrush(wx.GREEN_BRUSH) @@ -282,8 +282,8 @@ class TestWindow(ogl.ShapeCanvas): self.shapes = [] self.save_gdi = [] - rRectBrush = wx.Brush("MEDIUM TURQUOISE", wx.SOLID) - dsBrush = wx.Brush("WHEAT", wx.SOLID) + rRectBrush = wx.Brush("MEDIUM TURQUOISE", wx.BRUSHSTYLE_SOLID) + dsBrush = wx.Brush("WHEAT", wx.BRUSHSTYLE_SOLID) self.MyAddShape( CompositeDivisionShape(self), @@ -322,7 +322,7 @@ class TestWindow(ogl.ShapeCanvas): self.MyAddShape( DiamondShape(90, 90), - 355, 260, wx.Pen(wx.BLUE, 3, wx.DOT), wx.RED_BRUSH, "Polygon" + 355, 260, wx.Pen(wx.BLUE, 3, wx.PENSTYLE_DOT), wx.RED_BRUSH, "Polygon" ) self.MyAddShape( diff --git a/demo/OwnerDrawnComboBox.py b/demo/OwnerDrawnComboBox.py index 75a7c925..6dda9c4b 100644 --- a/demo/OwnerDrawnComboBox.py +++ b/demo/OwnerDrawnComboBox.py @@ -19,29 +19,29 @@ class PenStyleComboBox(wx.adv.OwnerDrawnComboBox): r = wx.Rect(*rect) # make a copy r.Deflate(3, 5) - penStyle = wx.SOLID + penStyle = wx.PENSTYLE_SOLID if item == 1: - penStyle = wx.TRANSPARENT + penStyle = wx.PENSTYLE_TRANSPARENT elif item == 2: - penStyle = wx.DOT + penStyle = wx.PENSTYLE_DOT elif item == 3: - penStyle = wx.LONG_DASH + penStyle = wx.PENSTYLE_LONG_DASH elif item == 4: - penStyle = wx.SHORT_DASH + penStyle = wx.PENSTYLE_SHORT_DASH elif item == 5: - penStyle = wx.DOT_DASH + penStyle = wx.PENSTYLE_DOT_DASH elif item == 6: - penStyle = wx.BDIAGONAL_HATCH + penStyle = wx.PENSTYLE_BDIAGONAL_HATCH elif item == 7: - penStyle = wx.CROSSDIAG_HATCH + penStyle = wx.PENSTYLE_CROSSDIAG_HATCH elif item == 8: - penStyle = wx.FDIAGONAL_HATCH + penStyle = wx.PENSTYLE_FDIAGONAL_HATCH elif item == 9: - penStyle = wx.CROSS_HATCH + penStyle = wx.PENSTYLE_CROSS_HATCH elif item == 10: - penStyle = wx.HORIZONTAL_HATCH + penStyle = wx.PENSTYLE_HORIZONTAL_HATCH elif item == 11: - penStyle = wx.VERTICAL_HATCH + penStyle = wx.PENSTYLE_VERTICAL_HATCH pen = wx.Pen(dc.GetTextForeground(), 3, penStyle) dc.SetPen(pen) diff --git a/demo/PenAndBrushStyles.py b/demo/PenAndBrushStyles.py index 1fc73fb8..52367009 100644 --- a/demo/PenAndBrushStyles.py +++ b/demo/PenAndBrushStyles.py @@ -1,18 +1,47 @@ +#!/usr/bin/env python + import wx import images -pen_styles = ["wx.SOLID", "wx.TRANSPARENT", "wx.DOT", "wx.LONG_DASH", - "wx.SHORT_DASH", "wx.DOT_DASH", "wx.BDIAGONAL_HATCH", - "wx.CROSSDIAG_HATCH", "wx.FDIAGONAL_HATCH", "wx.CROSS_HATCH", - "wx.HORIZONTAL_HATCH", "wx.VERTICAL_HATCH", "wx.USER_DASH"] +pen_styles = [#"wx.PENSTYLE_INVALID", + "wx.PENSTYLE_SOLID", + "wx.PENSTYLE_DOT", + "wx.PENSTYLE_LONG_DASH", + "wx.PENSTYLE_SHORT_DASH", + "wx.PENSTYLE_DOT_DASH", + "wx.PENSTYLE_USER_DASH", + "wx.PENSTYLE_TRANSPARENT", + "wx.PENSTYLE_BDIAGONAL_HATCH", + "wx.PENSTYLE_CROSSDIAG_HATCH", + "wx.PENSTYLE_FDIAGONAL_HATCH", + "wx.PENSTYLE_CROSS_HATCH", + "wx.PENSTYLE_HORIZONTAL_HATCH", + "wx.PENSTYLE_VERTICAL_HATCH", + "wx.PENSTYLE_FIRST_HATCH", + "wx.PENSTYLE_LAST_HATCH" + ] + if 'wxMSW' in wx.PlatformInfo: - pen_styles.append("wx.STIPPLE") - -brush_styles = ["wx.SOLID", "wx.TRANSPARENT", "wx.STIPPLE", "wx.BDIAGONAL_HATCH", - "wx.CROSSDIAG_HATCH", "wx.FDIAGONAL_HATCH", "wx.CROSS_HATCH", - "wx.HORIZONTAL_HATCH", "wx.VERTICAL_HATCH"] - + pen_styles.append("wx.PENSTYLE_STIPPLE_MASK_OPAQUE") + pen_styles.append("wx.PENSTYLE_STIPPLE_MASK") + pen_styles.append("wx.PENSTYLE_STIPPLE") + +brush_styles = [#"wx.BRUSHSTYLE_INVALID", + "wx.BRUSHSTYLE_SOLID", + "wx.BRUSHSTYLE_TRANSPARENT", + "wx.BRUSHSTYLE_STIPPLE_MASK_OPAQUE", + "wx.BRUSHSTYLE_STIPPLE_MASK", + "wx.BRUSHSTYLE_STIPPLE", + "wx.BRUSHSTYLE_BDIAGONAL_HATCH", + "wx.BRUSHSTYLE_CROSSDIAG_HATCH", + "wx.BRUSHSTYLE_FDIAGONAL_HATCH", + "wx.BRUSHSTYLE_CROSS_HATCH", + "wx.BRUSHSTYLE_HORIZONTAL_HATCH", + "wx.BRUSHSTYLE_VERTICAL_HATCH", + "wx.BRUSHSTYLE_FIRST_HATCH", + "wx.BRUSHSTYLE_LAST_HATCH" + ] class BasePanel(wx.Panel): def __init__(self, parent): @@ -115,7 +144,7 @@ class TestPanel(wx.Panel): wx.Panel.__init__(self, *args, **kw) font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) - font.SetWeight(wx.BOLD) + font.SetWeight(wx.FONTWEIGHT_BOLD) mainSizer = wx.BoxSizer(wx.VERTICAL) label1 = wx.StaticText(self, -1, "Pen Styles:") @@ -123,7 +152,7 @@ class TestPanel(wx.Panel): mainSizer.Add(label1, 0, wx.EXPAND|wx.ALL, 10) - gs1 = wx.GridSizer(4, 4, 3, 3) # rows, cols, vgap, hgap + gs1 = wx.GridSizer(rows=5, cols=4, vgap=3, hgap=3) for pen_name in pen_styles: small = PenPanel(self, pen_name) @@ -136,7 +165,7 @@ class TestPanel(wx.Panel): mainSizer.Add(label2, 0, wx.EXPAND|wx.ALL, 10) - gs2 = wx.GridSizer(3, 3, 3, 3) # rows, cols, vgap, hgap + gs2 = wx.GridSizer(rows=4, cols=4, vgap=3, hgap=3) for brush_name in brush_styles: small = BrushPanel(self, brush_name) diff --git a/demo/PopupMenu.py b/demo/PopupMenu.py index 2c6ca10f..6cf4d151 100644 --- a/demo/PopupMenu.py +++ b/demo/PopupMenu.py @@ -25,8 +25,8 @@ class TestPanel(wx.Panel): # Make and layout the controls fs = self.GetFont().GetPointSize() - bf = wx.Font(fs+4, wx.SWISS, wx.NORMAL, wx.BOLD) - nf = wx.Font(fs+2, wx.SWISS, wx.NORMAL, wx.NORMAL) + bf = wx.Font(fs+4, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD) + nf = wx.Font(fs+2, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL) t = wx.StaticText(self, -1, "PopupMenu") t.SetFont(bf) diff --git a/demo/RichTextCtrl.py b/demo/RichTextCtrl.py index d5bc40d1..5d54a9c8 100644 --- a/demo/RichTextCtrl.py +++ b/demo/RichTextCtrl.py @@ -272,7 +272,7 @@ class RichTextFrame(wx.Frame): wildcard, types = rt.RichTextBuffer.GetExtWildcard(save=False) dlg = wx.FileDialog(self, "Choose a filename", wildcard=wildcard, - style=wx.OPEN) + style=wx.FD_OPEN) if dlg.ShowModal() == wx.ID_OK: path = dlg.GetPath() if path: @@ -293,7 +293,7 @@ class RichTextFrame(wx.Frame): dlg = wx.FileDialog(self, "Choose a filename", wildcard=wildcard, - style=wx.SAVE) + style=wx.FD_SAVE) if dlg.ShowModal() == wx.ID_OK: path = dlg.GetPath() if path: diff --git a/demo/ScrolledWindow.py b/demo/ScrolledWindow.py index 42cac6c4..f6ec1a84 100644 --- a/demo/ScrolledWindow.py +++ b/demo/ScrolledWindow.py @@ -76,7 +76,7 @@ class MyCanvas(wx.ScrolledWindow): dc.SetPen(wx.Pen('BLUE', 4)) dc.DrawRectangle(15, 15, 50, 50) - dc.SetFont(wx.Font(14, wx.SWISS, wx.NORMAL, wx.NORMAL)) + dc.SetFont(wx.Font(14, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) dc.SetTextForeground(wx.Colour(0xFF, 0x20, 0xFF)) te = dc.GetTextExtent("Hello World") dc.DrawText("Hello World", 60, 65) @@ -95,7 +95,7 @@ class MyCanvas(wx.ScrolledWindow): dc.SetTextForeground(wx.Colour(0, 0xFF, 0x80)) dc.DrawText("a bitmap", 200, 85) - font = wx.Font(20, wx.SWISS, wx.NORMAL, wx.NORMAL) + font = wx.Font(20, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL) dc.SetFont(font) dc.SetTextForeground(wx.BLACK) @@ -116,9 +116,11 @@ class MyCanvas(wx.ScrolledWindow): # it does... y = 20 - for style in [wx.DOT, wx.LONG_DASH, wx.SHORT_DASH, wx.DOT_DASH, wx.USER_DASH]: + for style in [wx.PENSTYLE_DOT, wx.PENSTYLE_LONG_DASH, + wx.PENSTYLE_SHORT_DASH, wx.PENSTYLE_DOT_DASH, + wx.PENSTYLE_USER_DASH]: pen = wx.Pen("DARK ORCHID", 1, style) - if style == wx.USER_DASH: + if style == wx.PENSTYLE_USER_DASH: pen.SetCap(wx.CAP_BUTT) pen.SetDashes([1,2]) pen.SetColour("RED") @@ -127,7 +129,7 @@ class MyCanvas(wx.ScrolledWindow): y = y + 10 dc.SetBrush(wx.TRANSPARENT_BRUSH) - dc.SetPen(wx.Pen(wx.Colour(0xFF, 0x20, 0xFF), 1, wx.SOLID)) + dc.SetPen(wx.Pen(wx.Colour(0xFF, 0x20, 0xFF), 1, wx.PENSTYLE_SOLID)) dc.DrawRectangle(450,50, 100,100) old_pen = dc.GetPen() new_pen = wx.Pen("BLACK", 5) diff --git a/demo/SplitTree.py b/demo/SplitTree.py index 2e95db5b..22c57e70 100644 --- a/demo/SplitTree.py +++ b/demo/SplitTree.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + # 11/13/2003 - Jeff Grimmett (grimmtooth@softhome.net) # # o Updated for wx namespace @@ -7,11 +9,10 @@ # o Bigtime errors on startup. Blows up with a program error. # Error: # -# 21:04:11: Debug: ..\..\src\msw\treectrl.cpp(1508): assert "IsVisible(item)" +# 21:04:11: Debug: ..\..\src\msw\treectrl.cpp(1508): assert "IsVisible(item)" # failed: The item you call GetNextVisible() for must be visible itself! # # I suspect this error is in the lib itself. -# import wx import wx.gizmos as gizmos @@ -62,12 +63,12 @@ class TestValueWindow(gizmos.TreeCompanionWindow): text = text + tree.GetItemText(itemId) pen = wx.Pen( - wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DLIGHT), - 1, wx.SOLID + wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DLIGHT), + 1, wx.PENSTYLE_SOLID ) dc.SetPen(pen) - dc.SetBrush(wx.Brush(self.GetBackgroundColour(), wx.SOLID)) + dc.SetBrush(wx.Brush(self.GetBackgroundColour(), wx.BRUSHSTYLE_SOLID)) dc.DrawRectangle(rect.x, rect.y, rect.width+1, rect.height+1) dc.SetTextForeground("BLACK") dc.SetBackgroundMode(wx.TRANSPARENT) @@ -90,7 +91,7 @@ class TestPanel(wx.Panel): splitter = gizmos.ThinSplitterWindow( scroller, -1, style=wx.SP_3DBORDER | wx.CLIP_CHILDREN ) - + splitter.SetSashSize(2) tree = TestTree(splitter, style = wx.TR_HAS_BUTTONS | wx.TR_NO_LINES | @@ -131,7 +132,7 @@ def runTest(frame, nb, log): overview = """\ This demo shows a collection of classes that were designed to operate together and provide a tree control with additional columns for each -item. The classes are wx.RemotelyScrolledTreeCtrl, wx.TreeCompanionWindow, +item. The classes are wx.RemotelyScrolledTreeCtrl, wx.TreeCompanionWindow, wx.ThinSplitterWindow, and wx.SplitterScrolledWindow, some of which may also be useful by themselves. """ diff --git a/demo/StandardPaths.py b/demo/StandardPaths.py index a3a7fed6..050c19bc 100644 --- a/demo/StandardPaths.py +++ b/demo/StandardPaths.py @@ -12,7 +12,7 @@ class TestPanel(wx.Panel): sizer.AddGrowableCol(1) box = wx.BoxSizer(wx.VERTICAL) fs = self.GetFont().GetPointSize() - bf = wx.Font(fs+4, wx.SWISS, wx.NORMAL, wx.BOLD) + bf = wx.Font(fs+4, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD) t = wx.StaticText(self, -1, "StandardPaths") t.SetFont(bf) diff --git a/demo/StaticText.py b/demo/StaticText.py index 52b738ee..3acb63f7 100644 --- a/demo/StaticText.py +++ b/demo/StaticText.py @@ -34,7 +34,7 @@ class TestPanel(wx.Panel): str = "This is a different font." text = StaticText(self, -1, str, (20, 120)) - font = wx.Font(18, wx.SWISS, wx.NORMAL, wx.NORMAL) + font = wx.Font(18, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL) text.SetFont(font) StaticText(self, -1, diff --git a/demo/TextCtrl.py b/demo/TextCtrl.py index 862347e7..b83a5cb8 100644 --- a/demo/TextCtrl.py +++ b/demo/TextCtrl.py @@ -60,7 +60,7 @@ class TestPanel(wx.Panel): t4.SetInsertionPoint(0) t4.SetStyle(44, 47, wx.TextAttr("RED", "YELLOW")) points = t4.GetFont().GetPointSize() # get the current size - f = wx.Font(points+3, wx.ROMAN, wx.ITALIC, wx.BOLD, True) + f = wx.Font(points+3, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_ITALIC, wx.FONTWEIGHT_BOLD, True) t4.SetStyle(63, 77, wx.TextAttr("BLUE", wx.NullColour, f)) l5 = wx.StaticText(self, -1, "Test Positions") diff --git a/demo/Threads.py b/demo/Threads.py index 11c6a34d..e849ada5 100644 --- a/demo/Threads.py +++ b/demo/Threads.py @@ -62,7 +62,7 @@ class GraphWindow(wx.Window): for label in labels: self.values.append((label, 0)) - font = wx.Font(12, wx.SWISS, wx.NORMAL, wx.BOLD) + font = wx.Font(12, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD) self.SetFont(font) self.colors = [ wx.RED, wx.GREEN, wx.BLUE, wx.CYAN, @@ -98,7 +98,7 @@ class GraphWindow(wx.Window): dc.SetTextForeground(wx.BLUE) dc.SetBackground(wx.Brush(self.GetBackgroundColour())) dc.Clear() - dc.SetPen(wx.Pen(wx.BLACK, 3, wx.SOLID)) + dc.SetPen(wx.Pen(wx.BLACK, 3, wx.PENSTYLE_SOLID)) dc.DrawLine(self.linePos, 0, self.linePos, size.height-10) bh = ypos = self.barHeight @@ -138,7 +138,7 @@ class TestFrame(wx.Frame): #self.CenterOnParent() panel = wx.Panel(self, -1) - panel.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD)) + panel.SetFont(wx.Font(10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) wx.StaticText(panel, -1, "This demo shows multiple threads interacting with this\n" "window by sending events to it, one thread for each bar.", diff --git a/demo/Throbber.py b/demo/Throbber.py index 1d9400fd..0829d06c 100644 --- a/demo/Throbber.py +++ b/demo/Throbber.py @@ -50,7 +50,7 @@ class TestPanel(wx.Panel): throb.Throbber(self, -1, images, frameDelay = 0.1, label = 'Label') self.throbbers['label']['throbber'].SetFont(wx.Font( - pointSize = 10, family = wx.DEFAULT, style = wx.NORMAL, weight = wx.BOLD + pointSize = 10, family = wx.FONTFAMILY_DEFAULT, style = wx.FONTSTYLE_NORMAL, weight = wx.FONTWEIGHT_BOLD )) self.throbbers['overlay']['throbber'] = \ @@ -66,7 +66,7 @@ class TestPanel(wx.Panel): ) self.throbbers['overlay+text']['throbber'].SetFont(wx.Font( - pointSize = 8, family = wx.DEFAULT, style = wx.NORMAL, weight = wx.BOLD + pointSize = 8, family = wx.FONTFAMILY_DEFAULT, style = wx.FONTSTYLE_NORMAL, weight = wx.FONTWEIGHT_BOLD )) self.customThrobber = \ diff --git a/demo/Timer.py b/demo/Timer.py index 4ed40872..5a5c9457 100644 --- a/demo/Timer.py +++ b/demo/Timer.py @@ -56,7 +56,7 @@ class TestPanel(sp.ScrolledPanel): outsideSizer = wx.BoxSizer(wx.VERTICAL) text = wx.StaticText(self, -1, "wx.Timer", style=wx.ALIGN_CENTRE) - text.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD, False)) + text.SetFont(wx.Font(24, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False)) text.SetSize(text.GetBestSize()) text.SetForegroundColour(wx.BLUE) outsideSizer.Add(text, 0, wx.EXPAND|wx.ALL, 5) diff --git a/demo/URLDragAndDrop.py b/demo/URLDragAndDrop.py index 1065b0f0..0715f611 100644 --- a/demo/URLDragAndDrop.py +++ b/demo/URLDragAndDrop.py @@ -35,7 +35,7 @@ class TestPanel(wx.Panel): msg = "Drag-And-Drop of URLs" text = wx.StaticText(self, -1, "", style=wx.ALIGN_CENTRE) - text.SetFont(wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD, False)) + text.SetFont(wx.Font(24, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False)) text.SetLabel(msg) w,h = text.GetTextExtent(msg) text.SetSize(wx.Size(w,h+1)) @@ -44,7 +44,7 @@ class TestPanel(wx.Panel): outsideSizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND) outsideSizer.Add((20,20)) - self.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD, False)) + self.SetFont(wx.Font(10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False)) inSizer = wx.FlexGridSizer(cols=2, hgap=5, vgap=5) inSizer.AddGrowableCol(0) diff --git a/demo/Unicode.py b/demo/Unicode.py index 42639501..41a92ee7 100644 --- a/demo/Unicode.py +++ b/demo/Unicode.py @@ -49,7 +49,7 @@ class TestPanel(wx.Panel): font = self.GetFont() font.SetPointSize(14) - font.SetWeight(wx.BOLD) + font.SetWeight(wx.FONTWEIGHT_BOLD) self.AddLine(box) self.AddText(box, chi_uni[0], chi_uni[1], 'Chinese:', font) diff --git a/demo/Wizard.py b/demo/Wizard.py index 910d9979..f65872cf 100644 --- a/demo/Wizard.py +++ b/demo/Wizard.py @@ -11,7 +11,7 @@ def makePageTitle(wizPg, title): sizer = wx.BoxSizer(wx.VERTICAL) wizPg.SetSizer(sizer) title = wx.StaticText(wizPg, -1, title) - title.SetFont(wx.Font(18, wx.SWISS, wx.NORMAL, wx.BOLD)) + title.SetFont(wx.Font(18, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) sizer.Add(title, 0, wx.ALIGN_CENTRE|wx.ALL, 5) sizer.Add(wx.StaticLine(wizPg, -1), 0, wx.EXPAND|wx.ALL, 5) return sizer diff --git a/demo/XmlResource.py b/demo/XmlResource.py index 89f653f9..410ecb50 100644 --- a/demo/XmlResource.py +++ b/demo/XmlResource.py @@ -15,7 +15,7 @@ class TestPanel(wx.Panel): # make the components label = wx.StaticText(self, -1, "The lower panel was built from this XML:") - label.SetFont(wx.Font(12, wx.SWISS, wx.NORMAL, wx.BOLD)) + label.SetFont(wx.Font(12, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) resourceText = open(RESFILE).read() text = wx.TextCtrl(self, -1, resourceText, diff --git a/demo/XmlResourceHandler.py b/demo/XmlResourceHandler.py index ef0c3a07..326a4277 100644 --- a/demo/XmlResourceHandler.py +++ b/demo/XmlResourceHandler.py @@ -30,7 +30,7 @@ class MyCustomPanel(wx.Panel): self.Bind(wx.EVT_SIZE, self.OnSize) t = wx.StaticText(self, -1, "MyCustomPanel") f = t.GetFont() - f.SetWeight(wx.BOLD) + f.SetWeight(wx.FONTWEIGHT_BOLD) f.SetPointSize(f.GetPointSize()+2) t.SetFont(f) self.t = t @@ -55,7 +55,7 @@ class PreMyCustomPanel(wx.Panel): self.Bind(wx.EVT_SIZE, self.OnSize) t = wx.StaticText(self, -1, "MyCustomPanel") f = t.GetFont() - f.SetWeight(wx.BOLD) + f.SetWeight(wx.FONTWEIGHT_BOLD) f.SetPointSize(f.GetPointSize()+2) t.SetFont(f) self.t = t @@ -146,7 +146,7 @@ class TestPanel(wx.Panel): # make the components label = wx.StaticText(self, -1, "The lower panel was built from this XML:") - label.SetFont(wx.Font(12, wx.SWISS, wx.NORMAL, wx.BOLD)) + label.SetFont(wx.Font(12, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) text = wx.TextCtrl(self, -1, resourceText, style=wx.TE_READONLY|wx.TE_MULTILINE) diff --git a/demo/XmlResourceSubclass.py b/demo/XmlResourceSubclass.py index 4cda2a45..d142601b 100644 --- a/demo/XmlResourceSubclass.py +++ b/demo/XmlResourceSubclass.py @@ -40,7 +40,7 @@ class MyCustomPanel(wx.Panel): if self is evt.GetEventObject(): t = wx.StaticText(self, -1, "MyCustomPanel") f = t.GetFont() - f.SetWeight(wx.BOLD) + f.SetWeight(wx.FONTWEIGHT_BOLD) f.SetPointSize(f.GetPointSize()+2) t.SetFont(f) self.t = t @@ -65,7 +65,7 @@ class TestPanel(wx.Panel): # make the components label = wx.StaticText(self, -1, "The lower panel was built from this XML:") - label.SetFont(wx.Font(12, wx.SWISS, wx.NORMAL, wx.BOLD)) + label.SetFont(wx.Font(12, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) text = wx.TextCtrl(self, -1, resourceText, style=wx.TE_READONLY|wx.TE_MULTILINE) diff --git a/demo/agw/AUI.py b/demo/agw/AUI.py index 6bb9a4d7..22f3db5f 100644 --- a/demo/agw/AUI.py +++ b/demo/agw/AUI.py @@ -748,7 +748,7 @@ class ProgressGauge(wx.Window): self._topStartColour = self.LightColour(self._bottomStartColour, 80) self._topEndColour = self.LightColour(self._bottomStartColour, 40) - self._background = wx.Brush(wx.WHITE, wx.SOLID) + self._background = wx.Brush(wx.WHITE, wx.BRUSHSTYLE_SOLID) self.Bind(wx.EVT_PAINT, self.OnPaint) self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground) diff --git a/demo/agw/AquaButton.py b/demo/agw/AquaButton.py index 1d42dd70..42e48dc6 100644 --- a/demo/agw/AquaButton.py +++ b/demo/agw/AquaButton.py @@ -79,7 +79,7 @@ class AquaButtonDemo(wx.Panel): mainSizer.Add(btnSizer, 1, wx.EXPAND|wx.ALL, 30) boldFont = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) - boldFont.SetWeight(wx.BOLD) + boldFont.SetWeight(wx.FONTWEIGHT_BOLD) for child in self.mainPanel.GetChildren(): if isinstance(child, wx.StaticText): diff --git a/demo/agw/BalloonTip.py b/demo/agw/BalloonTip.py index 3c03e793..12080047 100644 --- a/demo/agw/BalloonTip.py +++ b/demo/agw/BalloonTip.py @@ -108,7 +108,8 @@ class BalloonTipDemo(wx.Frame): textctrl2 = wx.TextCtrl(panel, -1, "Another TextCtrl") # Add A GenStaticText statictext = StaticText(panel, -1, "Hello World!") - statictext.SetFont(wx.Font(9, wx.SWISS, wx.NORMAL, wx.BOLD, False)) + statictext.SetFont(wx.Font(9, wx.FONTFAMILY_SWISS, + wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False)) bmp = wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_TOOLBAR, (16,16)) # Add A GenBitmapButton @@ -160,10 +161,10 @@ class BalloonTipDemo(wx.Frame): "Gauge Help", "", "", "Read Me Carefully!", "SpinCtrl Help", "StaticText Help", "BitmapButton Help", "Button Help", "Taskbar Help"] - fontone = wx.Font(9, wx.SWISS, wx.NORMAL, wx.BOLD, True) - fonttwo = wx.Font(14, wx.SCRIPT, wx.NORMAL, wx.BOLD, False) - fontthree = wx.Font(9, wx.SWISS, wx.ITALIC, wx.NORMAL, False) - fontfour = wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD, True) + fontone = wx.Font(9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, True) + fonttwo = wx.Font(14, wx.FONTFAMILY_SCRIPT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False) + fontthree = wx.Font(9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_ITALIC, wx.FONTWEIGHT_NORMAL, False) + fontfour = wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, True) # Declare The BalloonTip Top Titles Fonts titlefonts = [None, None, fontone, None, fonttwo, fontthree, None, None, @@ -208,9 +209,9 @@ class BalloonTipDemo(wx.Frame): None, wx.BLUE, None, None, wx.RED, wx.GREEN, wx.BLUE, None] - fontone = wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL, True) - fonttwo = wx.Font(8, wx.SWISS, wx.ITALIC, wx.NORMAL, False) - fontthree = wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD, True) + fontone = wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, True) + fonttwo = wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_ITALIC, wx.FONTWEIGHT_NORMAL, False) + fontthree = wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, True) # Declare The BalloonTip Tip Messages Fonts messagefonts = [None, None, None, fontone, None, None, fonttwo, None, @@ -319,7 +320,7 @@ class BalloonTipDemo(wx.Frame): dlg = wx.MessageDialog(self, msg, "BalloonTip Demo", wx.OK | wx.ICON_INFORMATION) - dlg.SetFont(wx.Font(8, wx.NORMAL, wx.NORMAL, wx.NORMAL, False, "Verdana")) + dlg.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "Verdana")) dlg.ShowModal() dlg.Destroy() diff --git a/demo/agw/ButtonPanel.py b/demo/agw/ButtonPanel.py index 12f1abe5..c8836432 100644 --- a/demo/agw/ButtonPanel.py +++ b/demo/agw/ButtonPanel.py @@ -101,9 +101,9 @@ class SettingsPanel(wx.MiniFrame): def __set_properties(self): - self.defaultstyle.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) + self.defaultstyle.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, "")) self.defaultstyle.SetValue(1) - self.gradientstyle.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) + self.gradientstyle.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, "")) self.verticalgradient.SetValue(1) if self.targetTitleBar.GetStyle() & bp.BP_DEFAULT_STYLE: diff --git a/demo/agw/CustomTreeCtrl.py b/demo/agw/CustomTreeCtrl.py index d78e31ad..4b1501b7 100644 --- a/demo/agw/CustomTreeCtrl.py +++ b/demo/agw/CustomTreeCtrl.py @@ -24,9 +24,11 @@ import images #--------------------------------------------------------------------------- -penstyle = ["wx.SOLID", "wx.TRANSPARENT", "wx.DOT", "wx.LONG_DASH", "wx.DOT_DASH", "wx.USER_DASH", - "wx.BDIAGONAL_HATCH", "wx.CROSSDIAG_HATCH", "wx.FDIAGONAL_HATCH", "wx.CROSS_HATCH", - "wx.HORIZONTAL_HATCH", "wx.VERTICAL_HATCH"] +penstyle = ["wx.PENSTYLE_SOLID", "wx.PENSTYLE_TRANSPARENT", "wx.PENSTYLE_DOT", + "wx.PENSTYLE_LONG_DASH", "wx.PENSTYLE_DOT_DASH", "wx.PENSTYLE_USER_DASH", + "wx.PENSTYLE_BDIAGONAL_HATCH", "wx.PENSTYLE_CROSSDIAG_HATCH", + "wx.PENSTYLE_FDIAGONAL_HATCH", "wx.PENSTYLE_CROSS_HATCH", + "wx.PENSTYLE_HORIZONTAL_HATCH", "wx.PENSTYLE_VERTICAL_HATCH"] ArtIDs = [ "None", "wx.ART_ADD_BOOKMARK", @@ -242,7 +244,7 @@ class PenDialog(wx.Dialog): widthsizer = wx.BoxSizer(wx.HORIZONTAL) coloursizer = wx.BoxSizer(wx.HORIZONTAL) label_1 = wx.StaticText(self, -1, "Please Choose The Pen Settings:") - label_1.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) + label_1.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, "")) mainsizer.Add(label_1, 0, wx.ALL|wx.ADJUST_MINSIZE, 10) label_2 = wx.StaticText(self, -1, "Pen Colour") coloursizer.Add(label_2, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 5) @@ -366,7 +368,7 @@ class TreeButtonsDialog(wx.Dialog): sizer_2 = wx.BoxSizer(wx.HORIZONTAL) sizer_1 = wx.BoxSizer(wx.HORIZONTAL) label_1 = wx.StaticText(self, -1, "Please Choose One Of These Sets Of Icons:") - label_1.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) + label_1.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, "")) mainsizer.Add(label_1, 0, wx.ALL|wx.ADJUST_MINSIZE, 10) topsizer.Add(self.listicons, 0, wx.ALL|wx.EXPAND|wx.ADJUST_MINSIZE, 5) label_2 = wx.StaticText(self, -1, "Collapsed") @@ -480,7 +482,7 @@ class CheckDialog(wx.Dialog): sizer_3 = wx.BoxSizer(wx.HORIZONTAL) sizer_4 = wx.BoxSizer(wx.HORIZONTAL) label_1 = wx.StaticText(self, -1, "Please Choose One Of These Sets Of Icons:") - label_1.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) + label_1.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, "")) mainsizer.Add(label_1, 0, wx.ALL|wx.ADJUST_MINSIZE, 10) topsizer.Add(self.listicons, 0, wx.ALL|wx.EXPAND|wx.ADJUST_MINSIZE, 5) label_2 = wx.StaticText(self, -1, "Checked") @@ -620,7 +622,7 @@ class TreeIcons(wx.Dialog): sizer_2 = wx.BoxSizer(wx.HORIZONTAL) gridsizer = wx.FlexGridSizer(4, 3, 5, 5) label_1 = wx.StaticText(self, -1, "Please Choose The Icons For This Item (All Are Optional):") - label_1.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) + label_1.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, "")) mainsizer.Add(label_1, 0, wx.ALL|wx.ADJUST_MINSIZE, 10) label_2 = wx.StaticText(self, -1, "TreeIcon_Normal:") gridsizer.Add(label_2, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 5) diff --git a/demo/agw/FlatMenu.py b/demo/agw/FlatMenu.py index fde6812f..9be7f457 100644 --- a/demo/agw/FlatMenu.py +++ b/demo/agw/FlatMenu.py @@ -397,7 +397,7 @@ class FlatMenuDemo(wx.Frame): item = FM.FlatMenuItem(styleMenu, MENU_USE_CUSTOM, "Show Customize DropDown", "Shows the customize drop down arrow", wx.ITEM_CHECK) # Demonstrate how to set custom font and text colour to a FlatMenuItem - item.SetFont(wx.Font(10, wx.SWISS, wx.ITALIC, wx.BOLD, False, "Courier New")) + item.SetFont(wx.Font(10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_ITALIC, wx.FONTWEIGHT_BOLD, False, "Courier New")) item.SetTextColour(wx.RED) item.Check(True) @@ -459,7 +459,7 @@ class FlatMenuDemo(wx.Frame): numCols = 2 switch = int(math.ceil(maxItems/float(numCols))) - fnt = wx.Font(9, wx.SWISS, wx.ITALIC, wx.BOLD, False, "Courier New") + fnt = wx.Font(9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_ITALIC, wx.FONTWEIGHT_BOLD, False, "Courier New") colours = [wx.RED, wx.GREEN, wx.BLUE] for i in xrange(17): row, col = i%switch, i/switch diff --git a/demo/agw/FlatNotebook.py b/demo/agw/FlatNotebook.py index a33fd7de..11b98535 100644 --- a/demo/agw/FlatNotebook.py +++ b/demo/agw/FlatNotebook.py @@ -897,8 +897,8 @@ class LogoPanel(wx.Panel): self.SetBackgroundColour(wx.WHITE) self.bmp = images.Vippi.GetBitmap() - self.bigfont = wx.Font(18, wx.SWISS, wx.NORMAL, wx.BOLD, False) - self.normalfont = wx.Font(14, wx.SWISS, wx.NORMAL, wx.BOLD, True) + self.bigfont = wx.Font(18, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False) + self.normalfont = wx.Font(14, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, True) self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM) diff --git a/demo/agw/FloatSpin.py b/demo/agw/FloatSpin.py index b4a6f20c..e27c0583 100644 --- a/demo/agw/FloatSpin.py +++ b/demo/agw/FloatSpin.py @@ -122,7 +122,7 @@ class FloatSpinDemo(wx.Panel): def SetProperties(self): - self.helptext.SetFont(wx.Font(10, wx.MODERN, wx.NORMAL, wx.BOLD, 0, "Verdana")) + self.helptext.SetFont(wx.Font(10, wx.FONTFAMILY_MODERN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, "Verdana")) self.radioformat1.SetSelection(0) self.radioformat2.SetSelection(2) self.radioformat3.SetSelection(0) diff --git a/demo/agw/FoldPanelBar.py b/demo/agw/FoldPanelBar.py index bd4f2773..215143fb 100644 --- a/demo/agw/FoldPanelBar.py +++ b/demo/agw/FoldPanelBar.py @@ -189,7 +189,7 @@ class Extended(wx.Frame): dlg = wx.MessageDialog(self, msg, "FoldPanelBar Extended Demo", wx.OK | wx.ICON_INFORMATION) - dlg.SetFont(wx.Font(8, wx.NORMAL, wx.NORMAL, wx.NORMAL, False, "Verdana")) + dlg.SetFont(wx.Font(8, wx.FONTFAMILY_NORMAL, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "Verdana")) dlg.ShowModal() dlg.Destroy() diff --git a/demo/agw/GradientButton.py b/demo/agw/GradientButton.py index fbbed219..91d907bc 100644 --- a/demo/agw/GradientButton.py +++ b/demo/agw/GradientButton.py @@ -86,14 +86,14 @@ class GradientButtonDemo(wx.Panel): mainSizer.Add(btnSizer, 0, wx.EXPAND|wx.ALL, 10) boldFont = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) - boldFont.SetWeight(wx.BOLD) + boldFont.SetWeight(wx.FONTWEIGHT_BOLD) for child in self.mainPanel.GetChildren(): if isinstance(child, wx.StaticText): child.SetFont(boldFont) buttonFont = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) - buttonFont.SetWeight(wx.BOLD) + buttonFont.SetWeight(wx.FONTWEIGHT_BOLD) try: buttonFont.SetFaceName("Tahoma") self.btn1.SetFont(buttonFont) diff --git a/demo/agw/HyperLinkCtrl.py b/demo/agw/HyperLinkCtrl.py index 0f28438b..c615cfc9 100644 --- a/demo/agw/HyperLinkCtrl.py +++ b/demo/agw/HyperLinkCtrl.py @@ -22,30 +22,30 @@ class TestPanel(wx.Panel): def __init__(self, parent, log): self.log = log wx.Panel.__init__(self, parent, -1) - self.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL, wx.NORMAL, False)) + self.SetFont(wx.Font(10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False)) sizer = wx.BoxSizer(wx.VERTICAL) - self.SetSizer(sizer) - + self.SetSizer(sizer) + # Creator credits text1 = wx.StaticText(self, -1, "HyperLinkCtrl Example By Andrea Gavana") - text1.SetFont(wx.Font(9, wx.SWISS, wx.NORMAL, wx.BOLD, False, 'Verdana')) - + text1.SetFont(wx.Font(9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, 'Verdana')) + sizer.Add((0,10)) sizer.Add(text1, 0, wx.LEFT | wx.TOP | wx.BOTTOM, 10) - + text2 = wx.StaticText(self, -1, "Latest Revision: 11 May 2005") - text2.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL, False, 'Verdana')) + text2.SetFont(wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, 'Verdana')) sizer.Add(text2, 0, wx.LEFT, 10) - + sizer.Add((0,25)) # Default Web links: self._hyper1 = hl.HyperLinkCtrl(self, wx.ID_ANY, "wxPython Main Page", URL="http://www.wxpython.org/") sizer.Add(self._hyper1, 0, wx.ALL, 10) - - + + # Web link with underline rollovers, opens in window self._hyper2 = hl.HyperLinkCtrl(self, wx.ID_ANY, "My Home Page", URL="http://xoomer.virgilio.it/infinity77/") @@ -66,7 +66,7 @@ class TestPanel(wx.Panel): URL="http://lists.wxwidgets.org/") sizer.Add(self._hyper3, 0, wx.ALL, 10) self._hyper3.Bind(hl.EVT_HYPERLINK_RIGHT, self.OnRightLink) - + self._hyper3.SetLinkCursor(wx.CURSOR_QUESTION_ARROW) self._hyper3.SetColours("DARK GREEN", "RED", "NAVY") self._hyper3.SetUnderlines(False, False, False) @@ -85,7 +85,7 @@ class TestPanel(wx.Panel): self._hyper4.AutoBrowse(False) - + def OnLink(self, event): @@ -100,8 +100,8 @@ class TestPanel(wx.Panel): elif nResult == wx.NO: self._hyper4.GotoURL("http://www.google.com", True, False) - - + + def OnRightLink(self, event): pos = self._hyper3.GetPosition() + event.GetPosition() menuPopUp = wx.Menu("Having a nice day?") @@ -111,7 +111,7 @@ class TestPanel(wx.Panel): menuPopUp.Append(ID_MENU_NO, "I've had better") self.PopupMenu(menuPopUp) menuPopUp.Destroy() - + def OnMiddleLink(self, event): diff --git a/demo/agw/HyperTreeList.py b/demo/agw/HyperTreeList.py index dfad16eb..221b24e2 100644 --- a/demo/agw/HyperTreeList.py +++ b/demo/agw/HyperTreeList.py @@ -26,9 +26,11 @@ import ListCtrl import images -penstyle = ["wx.SOLID", "wx.TRANSPARENT", "wx.DOT", "wx.LONG_DASH", "wx.DOT_DASH", "wx.USER_DASH", - "wx.BDIAGONAL_HATCH", "wx.CROSSDIAG_HATCH", "wx.FDIAGONAL_HATCH", "wx.CROSS_HATCH", - "wx.HORIZONTAL_HATCH", "wx.VERTICAL_HATCH"] +penstyle = ["wx.PENSTYLE_SOLID", "wx.PENSTYLE_TRANSPARENT", "wx.PENSTYLE_DOT", + "wx.PENSTYLE_LONG_DASH", "wx.PENSTYLE_DOT_DASH", "wx.PENSTYLE_USER_DASH", + "wx.PENSTYLE_BDIAGONAL_HATCH", "wx.PENSTYLE_CROSSDIAG_HATCH", + "wx.PENSTYLE_FDIAGONAL_HATCH", "wx.PENSTYLE_CROSS_HATCH", + "wx.PENSTYLE_HORIZONTAL_HATCH", "wx.PENSTYLE_VERTICAL_HATCH"] ArtIDs = [ "None", "wx.ART_ADD_BOOKMARK", @@ -957,7 +959,7 @@ class HyperTreeHeaderRenderer(object): color = cutils.AdjustColour(color,50) # Draw a solid background in self.color - dc.SetBrush(wx.Brush(color, wx.SOLID)) + dc.SetBrush(wx.Brush(color, wx.BRUSHSTYLE_SOLID)) dc.SetBackgroundMode(wx.SOLID) dc.SetPen(wx.TRANSPARENT_PEN) dc.DrawRectangleRect(rect) @@ -1567,7 +1569,7 @@ class HyperTreeListDemo(wx.Frame): "GIF Files (*.gif)|*.gif|" \ "All files (*.*)|*.*" - dlg = wx.FileDialog(self, "Choose An Image File", ".", "", wildcard, wx.OPEN) + dlg = wx.FileDialog(self, "Choose An Image File", ".", "", wildcard, wx.FD_OPEN) if dlg.ShowModal() == wx.ID_OK: path = dlg.GetPath() diff --git a/demo/agw/MacLargeDemo.py b/demo/agw/MacLargeDemo.py index 1a3a4d56..9b76e52d 100644 --- a/demo/agw/MacLargeDemo.py +++ b/demo/agw/MacLargeDemo.py @@ -148,7 +148,7 @@ class MacRenderer(object): mdc.DrawText(text1, 0, ypos) ypos += ytext + 5 - mdc.SetFont(wx.Font(7, wx.SWISS, wx.NORMAL, wx.NORMAL, False)) + mdc.SetFont(wx.Font(7, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False)) xtext, ytext = mdc.GetTextExtent(text2) mdc.DrawText(text2, 0, ypos) @@ -156,7 +156,7 @@ class MacRenderer(object): self.DrawProgressBar(mdc, 0, ypos, rect.width, 20, progress) - mdc.SetFont(wx.Font(7, wx.SWISS, wx.NORMAL, wx.NORMAL, False)) + mdc.SetFont(wx.Font(7, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False)) ypos += 25 mdc.DrawText(text3, 0, ypos) diff --git a/demo/agw/PersistentControls.py b/demo/agw/PersistentControls.py index 5243cfc0..e2f2fe9b 100644 --- a/demo/agw/PersistentControls.py +++ b/demo/agw/PersistentControls.py @@ -214,7 +214,7 @@ class PersistentFrame1(wx.Frame): combo = wx.ComboBox(otherPanel, -1, choices=_sampleList, style=wx.CB_DROPDOWN|wx.CB_READONLY, name="ComboBox1") - boldFont = wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "") + boldFont = wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, "") box2 = wx.BoxSizer(wx.HORIZONTAL) box2.Add((0, 0), 1) diff --git a/demo/agw/PyCollapsiblePane.py b/demo/agw/PyCollapsiblePane.py index 63dc5239..2da8a577 100644 --- a/demo/agw/PyCollapsiblePane.py +++ b/demo/agw/PyCollapsiblePane.py @@ -50,7 +50,7 @@ class PyCollapsiblePaneDemo(wx.Panel): self.label2 = "Click here to hide pane" title = wx.StaticText(self, label="PyCollapsiblePane") - title.SetFont(wx.Font(18, wx.SWISS, wx.NORMAL, wx.BOLD)) + title.SetFont(wx.Font(18, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) title.SetForegroundColour("blue") self.cpStyle = wx.CP_NO_TLW_RESIZE diff --git a/demo/agw/PyGauge.py b/demo/agw/PyGauge.py index 81d790d9..db0f72ac 100644 --- a/demo/agw/PyGauge.py +++ b/demo/agw/PyGauge.py @@ -97,7 +97,7 @@ class PyGaugeDemo(wx.Panel): boldFont = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) - boldFont.SetWeight(wx.BOLD) + boldFont.SetWeight(wx.FONTWEIGHT_BOLD) for child in self.mainPanel.GetChildren(): if isinstance(child, wx.StaticText): diff --git a/demo/agw/ShapedButton.py b/demo/agw/ShapedButton.py index 21fb09ef..d5ce5239 100644 --- a/demo/agw/ShapedButton.py +++ b/demo/agw/ShapedButton.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + import wx import random @@ -68,15 +70,15 @@ class ShapedButtonDemo(wx.Frame): recordsizer.Add(self.stop, 0, wx.LEFT, 3) recordsizer.Add(self.ffwd, 0, wx.LEFT | wx.RIGHT, 3) - for ii in xrange(6): + for ii in range(6): recordsizer.SetItemMinSize(ii, 48, 48) self.eventtext = wx.StaticText(self.panel, -1, "Event Recorder", style=wx.ST_NO_AUTORESIZE) self.eventtext.SetBackgroundColour(wx.BLUE) self.eventtext.SetForegroundColour(wx.WHITE) - self.eventtext.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD, - False, "Verdana")) + self.eventtext.SetFont(wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, + False, "Verdana", wx.FONTENCODING_DEFAULT)) smallsizer = wx.BoxSizer(wx.VERTICAL) smallsizer.Add((0, 1), 1, wx.EXPAND) @@ -204,12 +206,12 @@ class ShapedButtonDemo(wx.Frame): fnt = self.GetFont() - fonts = [fnt, wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD), - wx.Font(10, wx.TELETYPE, wx.NORMAL, wx.NORMAL), - wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL, True), - fnt, wx.Font(9, wx.DECORATIVE, wx.NORMAL, wx.BOLD), - wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL, False, "Tahoma"), - fnt, wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL, True, "Verdana")] + fonts = [fnt, wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD), + wx.Font(10, wx.FONTFAMILY_TELETYPE, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL), + wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, True), + fnt, wx.Font(9, wx.FONTFAMILY_DECORATIVE, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD), + wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "Tahoma"), + fnt, wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, True, "Verdana")] lcolours = [None, wx.WHITE, wx.Colour("Yellow"), wx.WHITE, None, None, wx.BLUE, wx.WHITE, wx.WHITE] @@ -217,7 +219,7 @@ class ShapedButtonDemo(wx.Frame): bsizer = wx.FlexGridSizer(3, 3, 5, 5) rotation = [] - for ii in xrange(9): + for ii in range(9): btn = SButton(self.panel, -1, labels[ii]) btn.SetButtonColour(colours[ii]) @@ -266,7 +268,7 @@ class ShapedButtonDemo(wx.Frame): btn3 = SButton(self.panel, -1, "Rotated") btn3.SetButtonColour(wx.Colour("Cyan")) btn3.SetLabelColour(wx.WHITE) - btn3.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD, False)) + btn3.SetFont(wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False)) btn3.SetAngleOfRotation(90) btn3.Bind(wx.EVT_BUTTON, self.OnRotated1) @@ -299,14 +301,14 @@ class ShapedButtonDemo(wx.Frame): btn1.SetEllipseAxis(2, 1) btn1.SetButtonColour(wx.RED) btn1.SetLabelColour(wx.WHITE) - btn1.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD, False)) + btn1.SetFont(wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False)) btn1.Bind(wx.EVT_BUTTON, self.OnEllipse) btn2 = SButton(self.panel, -1, "Ellipse 2") btn2.SetEllipseAxis(2, 3) btn2.SetAngleOfRotation(90) btn2.SetLabelColour(wx.BLUE) - btn2.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD, True)) + btn2.SetFont(wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, True)) btn2.Bind(wx.EVT_BUTTON, self.OnEllipse) bmp = wx.Bitmap(os.path.join(bitmapDir, "ffwd.png"), wx.BITMAP_TYPE_PNG) diff --git a/demo/agw/SuperToolTip.py b/demo/agw/SuperToolTip.py index d351e31d..9b0c86ff 100644 --- a/demo/agw/SuperToolTip.py +++ b/demo/agw/SuperToolTip.py @@ -131,12 +131,12 @@ class SuperToolTipDemo(wx.Frame): self.headerCheck.SetValue(1) self.footerCheck.SetValue(1) self.stylesCombo.SetValue("Office 2007 Blue") - font = wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "") + font = wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, "") self.generateTip.SetFont(font) self.headerCheck.SetFont(font) self.footerCheck.SetFont(font) self.endTimer.SetRange(1, 100) - self.toolTipButton.SetFont(wx.Font(16, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) + self.toolTipButton.SetFont(wx.Font(16, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, "")) for widgets in [self.topColourPicker, self.middleColourPicker, self.bottomColourPicker]: widgets.Enable(False) diff --git a/demo/agw/UltimateReportDemo.py b/demo/agw/UltimateReportDemo.py index e7b1776e..f76df010 100644 --- a/demo/agw/UltimateReportDemo.py +++ b/demo/agw/UltimateReportDemo.py @@ -211,7 +211,7 @@ class UltimateRenderer_1(object): self.DrawProgressBar(mdc, 0, 0, rect.width, rect.height, self.progressValue) - mdc.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.BOLD)) + mdc.SetFont(wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) text = "%d Mb"%self.progressValue textWidth, dummy = mdc.GetTextExtent(text) mdc.DrawText(text, rect.width/2 - textWidth/2, rect.height/2 - dummy/2) @@ -323,7 +323,7 @@ class UltimateRenderer_2(object): def DrawSubItem(self, dc, rect, line, highlighted, enabled): dc.SetBackgroundMode(wx.SOLID) - dc.SetBrush(wx.Brush(wx.BLACK, wx.SOLID)) + dc.SetBrush(wx.Brush(wx.BLACK, wx.BRUSHSTYLE_SOLID)) dc.SetPen(wx.TRANSPARENT_PEN) dc.DrawRectangle(rect) @@ -405,7 +405,7 @@ class UltimateHeaderRenderer(object): self._hover = True color = cutils.AdjustColour(color,50) - dc.SetBrush(wx.Brush(color, wx.SOLID)) + dc.SetBrush(wx.Brush(color, wx.BRUSHSTYLE_SOLID)) dc.SetBackgroundMode(wx.SOLID) dc.SetPen(wx.TRANSPARENT_PEN) dc.DrawRectangle(rect) @@ -511,7 +511,7 @@ class UltimateListCtrlPanel(wx.Panel, listmix.ColumnSorterMixin): font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) boldfont = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) - boldfont.SetWeight(wx.BOLD) + boldfont.SetWeight(wx.FONTWEIGHT_BOLD) boldfont.SetPointSize(12) boldfont.SetUnderlined(True) @@ -664,7 +664,7 @@ class UltimateListCtrlPanel(wx.Panel, listmix.ColumnSorterMixin): item.SetMask(fullMask) item.SetTextColour(wx.GREEN) font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) - font.SetWeight(wx.BOLD) + font.SetWeight(wx.FONTWEIGHT_BOLD) item.SetFont(font) item.SetBackgroundColour(colour) self.list.SetItem(item) @@ -673,7 +673,7 @@ class UltimateListCtrlPanel(wx.Panel, listmix.ColumnSorterMixin): italicFont = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) italicFont.SetStyle(wx.FONTSTYLE_ITALIC) boldFont = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) - boldFont.SetWeight(wx.BOLD) + boldFont.SetWeight(wx.FONTWEIGHT_BOLD) lenCDB = len(self.colourList) diff --git a/demo/agw/Windows7Explorer_Contents.py b/demo/agw/Windows7Explorer_Contents.py index 09c9ef12..232c702e 100644 --- a/demo/agw/Windows7Explorer_Contents.py +++ b/demo/agw/Windows7Explorer_Contents.py @@ -307,7 +307,7 @@ class TestFrame(wx.Frame): panelSizer = wx.BoxSizer(wx.VERTICAL) font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) - font.SetWeight(wx.BOLD) + font.SetWeight(wx.FONTWEIGHT_BOLD) static = wx.StaticText(panel, -1, "Choose a folder to display:") static.SetFont(font) diff --git a/demo/agw/XLSGrid.py b/demo/agw/XLSGrid.py index 58bc02dd..b36ec770 100644 --- a/demo/agw/XLSGrid.py +++ b/demo/agw/XLSGrid.py @@ -150,11 +150,11 @@ class XLSGridPanel(wx.Panel): top_center_sizer = wx.BoxSizer(wx.VERTICAL) top_sizer.Add(self.start_button, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 10) label_1 = wx.StaticText(self, -1, "xlrd:") - label_1.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) + label_1.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, "")) top_center_sizer.Add(label_1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5) top_center_sizer.Add((0, 0), 1, wx.EXPAND, 0) label_2 = wx.StaticText(self, -1, "pywin32:") - label_2.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) + label_2.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, "")) top_center_sizer.Add(label_2, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5) top_sizer.Add(top_center_sizer, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0) label_xlrd = wx.StaticText(self, -1, string_xlrd) diff --git a/demo/agw/ZoomBar.py b/demo/agw/ZoomBar.py index 7c0bf779..df21d845 100644 --- a/demo/agw/ZoomBar.py +++ b/demo/agw/ZoomBar.py @@ -86,9 +86,9 @@ class TestPanel(wx.Panel): def SetProperties(self): - self.centerZoom.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) - self.showReflections.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) - self.showLabels.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) + self.centerZoom.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, "")) + self.showReflections.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, "")) + self.showLabels.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, "")) self.centerZoom.Enable(False) self.showLabels.SetValue(1) @@ -105,17 +105,17 @@ class TestPanel(wx.Panel): mainSizer.Add((20, 20), 1, wx.EXPAND, 0) centerSizer.Add((20, 20), 1, 0, 0) label_1 = wx.StaticText(self, -1, "Zoom Factor:") - label_1.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) + label_1.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, "")) sizer_3.Add(label_1, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5) sizer_3.Add(self.zoomSpin, 1, wx.ALIGN_CENTER_VERTICAL, 0) label_2 = wx.StaticText(self, -1, "Bar Colour:") - label_2.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) + label_2.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, "")) sizer_3.Add(label_2, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5) sizer_3.Add(self.colourzoom, 0, wx.ALIGN_CENTER_VERTICAL, 0) label_3 = wx.StaticText(self, -1, "Button Size:") - label_3.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, "")) + label_3.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, "")) sizer_3.Add(label_3, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5) sizer_3.Add(self.buttonSize, 0, wx.ALIGN_CENTER_VERTICAL, 0)