From 1cad84aa8e2ccdfa3eed84ac55385ae82f5d53dc Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 11 Dec 2019 13:58:47 -0800 Subject: [PATCH] Add some new code snippets --- .../snippets/python/converted/wx.Control.GetSizeFromText.1.py | 3 +++ .../snippets/python/converted/wx.FileDialog.4.py | 2 ++ .../rest_substitutions/snippets/python/converted/wx.Rect.1.py | 3 +++ 3 files changed, 8 insertions(+) create mode 100644 docs/sphinx/rest_substitutions/snippets/python/converted/wx.Control.GetSizeFromText.1.py create mode 100644 docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileDialog.4.py create mode 100644 docs/sphinx/rest_substitutions/snippets/python/converted/wx.Rect.1.py diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Control.GetSizeFromText.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Control.GetSizeFromText.1.py new file mode 100644 index 00000000..b2112ae7 --- /dev/null +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Control.GetSizeFromText.1.py @@ -0,0 +1,3 @@ + + # GetSizeFromText is a simpler way to do this: + size = self.GetSizeFromTextSize(self.GetTextExtent(text).GetWidth()) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileDialog.4.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileDialog.4.py new file mode 100644 index 00000000..11891c6c --- /dev/null +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileDialog.4.py @@ -0,0 +1,2 @@ + + wx.SystemOptions.SetOption(wx.OSX_FILEDIALOG_ALWAYS_SHOW_TYPES, 1) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Rect.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Rect.1.py new file mode 100644 index 00000000..87831589 --- /dev/null +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Rect.1.py @@ -0,0 +1,3 @@ + + x <= p.x < (rect.x + rect.width) + y <= p.y < (rect.y + rect.height)