diff --git a/wx/lib/agw/aui/aui_constants.py b/wx/lib/agw/aui/aui_constants.py index 96abd292..5121a21e 100644 --- a/wx/lib/agw/aui/aui_constants.py +++ b/wx/lib/agw/aui/aui_constants.py @@ -2586,3 +2586,40 @@ whidbeySizeX, whidbeySizeY = 43, 30 SWITCHER_TEXT_MARGIN_X = 4 SWITCHER_TEXT_MARGIN_Y = 1 + + +if __name__ == '__main__': + # Easy image extraction. + import sys + if sys.version_info[0] == 2: + PY2 = True + PY3 = False + elif sys.version_info[0] == 3: + PY2 = False + PY3 = True + if PY2: + answer = int(raw_input('Enter 1 to extract all bitmaps: ')) + elif PY3: + answer = int(input('Enter 1 to extract all bitmaps: ')) + if answer == 1: + app = wx.App(0) + import os + gAppDir = os.path.dirname(os.path.abspath(__file__)) + extractDir = gAppDir + os.sep + 'extracted_constants_bitmaps' + if not os.path.exists(extractDir): + # Create directory. + os.mkdir(extractDir) + ## print(globals()) + for key, bitmap in list(globals().items()): + ## print(key, bitmap) + try: + bmp = bitmap.GetBitmap() + bmp.SaveFile(extractDir + os.sep + '%s.png'%key, wx.BITMAP_TYPE_PNG) + print('Extracting bitmap: %s.png' %(key)) + except Exception: + pass + app.MainLoop() + if PY2: + raw_input('Press Enter To Exit.') + elif PY3: + input('Press Enter To Exit.') \ No newline at end of file