From: Roman Rolinsky Date: Tue, 6 Feb 2007 15:40:32 +0000 (+0000) Subject: Version 1.8-0 X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/75aa19469b8b31ae58d6e8956b0e4c7200e30578 Version 1.8-0 New feature added from a patch submitted on sourceforge by botg: moving of tree items. Bugs fixed: - ChecklistBox content editing; - Window styles more in sync with the docs; - Replacing items; - Reference property page created correctly (every property is optional). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44381 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/wx/tools/XRCed/CHANGES.txt b/wxPython/wx/tools/XRCed/CHANGES.txt index 91b4dbd163..b67fa46c29 100644 --- a/wxPython/wx/tools/XRCed/CHANGES.txt +++ b/wxPython/wx/tools/XRCed/CHANGES.txt @@ -1,3 +1,16 @@ +0.1.8-0 +------- + +New feature added from a patch submitted on sourceforge by botg: +moving of tree items. + +Bugs fixed: +- ChecklistBox content editing; +- Window styles more in sync with the docs; +- Replacing items; +- Reference property page created correctly (every property is + optional). + 0.1.7-5 ------- diff --git a/wxPython/wx/tools/XRCed/TODO.txt b/wxPython/wx/tools/XRCed/TODO.txt index fddee3ba32..8246420546 100644 --- a/wxPython/wx/tools/XRCed/TODO.txt +++ b/wxPython/wx/tools/XRCed/TODO.txt @@ -1,6 +1,8 @@ TODO for XRCed ============== +- undo for Replace op + - better help + undo/redo @@ -28,4 +30,4 @@ TODO for XRCed + selecting object by clicking in test window -- hidden items should not be highlighted ++ hidden items should not be highlighted diff --git a/wxPython/wx/tools/XRCed/globals.py b/wxPython/wx/tools/XRCed/globals.py index 845e3231ff..d90a2e55e5 100644 --- a/wxPython/wx/tools/XRCed/globals.py +++ b/wxPython/wx/tools/XRCed/globals.py @@ -15,7 +15,7 @@ import sys # Global constants progname = 'XRCed' -version = '0.1.7-5' +version = '0.1.8-0' # Minimal wxWidgets version MinWxVersion = (2,6,0) if wx.VERSION[:3] < MinWxVersion: diff --git a/wxPython/wx/tools/XRCed/images.py b/wxPython/wx/tools/XRCed/images.py index 6d42855e83..bf56f98b2b 100644 --- a/wxPython/wx/tools/XRCed/images.py +++ b/wxPython/wx/tools/XRCed/images.py @@ -470,10 +470,11 @@ def getToolGaugeData(): return \ '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x18\x00\x00\x00\x0e\x08\x02\ \x00\x00\x00\xba\x9aK)\x00\x00\x00\x03sBIT\x08\x08\x08\xdb\xe1O\xe0\x00\x00\ -\x00TIDAT(\x91c\x9c2u\n\x03U\x00U\x0c\xfa\xff\xff?\x0b\x9c\x85)\xcd\xc8\xc8x\ +\x00XIDAT(\x91c\x9c2u\n\x03U\x00U\x0c\xfa\xff\xff?\x0b\x9c\x85)\xcd\xc8\xc8x\ \xf5\xdaU"\xcdb\x81\xb3\xde\xbf~O\x89\xa3\x98pIl\xdb\xbd\x8d:\x06\x91\nF\r"\ -\x0cX\x909\xa4\xc6\x14\x16\x83\x18\x19\x19)r\x0f\xdc \xe2S0>\x83\xb0\xe6\x0f\ -R\x01\x00U\xa6\x18\xb4\x82\x95pI\x00\x00\x00\x00IEND\xaeB`\x82' +\x0cX\x909\xa4\xc6\x14\x16\x83\x18\x19\x19)r\x0f\xdc \xe2S0>\x83\xfe\xff\xff\ +O\xa1)\x0c\x0c\x0c\x00U\xa6\x18\xb48\xff\xd0\x00\x00\x00\x00\x00IEND\xaeB`\ +\x82' def getToolGaugeBitmap(): return BitmapFromImage(getToolGaugeImage()) @@ -646,6 +647,118 @@ def getToolMenuItemIcon(): icon.CopyFromBitmap(getToolMenuItemBitmap()) return icon +#---------------------------------------------------------------------- +def getToolMoveDownData(): + return \ +'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x18\x00\x00\x00\x17\x08\x06\ +\x00\x00\x00\x11!\x8f-\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\ +\x00\xf8IDATH\x89\xb5UA\x12\x830\x08\\H\xbf\xd5\x96\x9f\xd9\xfc\xcc\xb6\xefR\ +zI\xa6)\xa2I\xac2\x93q$\x86ea\x83D\x1cp\xa6\xb1u\xe8<\xe9\xa9\x00\x00p\xbf]\ +\x0f\x03\xb9\xd4>\xf0\x18\x11\x07j\x05p\x19x\x01\xf3\x02\xfa\x18\xba\x0c\xc6\ +q\x04\x80\xcd sb\xc6\x156.\x80\x88X\xb0\xdd@\xab=x\xbe\xde\xf9\x80z}\x88\xe9\ +9\x14@\x1eH\xb5\xc9\xc4\x81\xbc\x9a\xc7\x1c,\x81\x0fk \xc4\xe1g\x01P\x11Q\ +\xeb\xaf\xad\x07\xa0\n,\xce\x1d.S\xcb\xe20\x99\xc6\x9e&\xb7\xc8\xb4\xd5\xfe\ +\x96\xe9.\x00\xa0.\xd3V\xab\xf6\x808\x90\x88@D\xa0\xa8\xd7-ZG\xabL5\xc9\xd0\ +\x93b\xb9\xdf-S\xe0;\x0e\x80\xe5H(\xf7\x16\xd9\xa3\xe1&\xcf\xa6\xfe\xf6\xbd\ +\x0c\xeeI\xb5\x89\xc1\x96\xe5\xac\xbb\xeeAi\xcc\x81l\x89\x86\xb2,\x95qM\xf6\ +\xa7\xaf\xf3\xa4\xde(\xd8\xea\xc3f\x82\x0b\xc4\x95\xc3=AK\xfb\x005\x00\x82C\ +\xb1\xf0h\xde\x00\x00\x00\x00IEND\xaeB`\x82' + +def getToolMoveDownBitmap(): + return BitmapFromImage(getToolMoveDownImage()) + +def getToolMoveDownImage(): + stream = cStringIO.StringIO(getToolMoveDownData()) + return ImageFromStream(stream) + +def getToolMoveDownIcon(): + icon = EmptyIcon() + icon.CopyFromBitmap(getToolMoveDownBitmap()) + return icon + +#---------------------------------------------------------------------- +def getToolMoveLeftData(): + return \ +'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x18\x00\x00\x00\x17\x08\x06\ +\x00\x00\x00\x11!\x8f-\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\ +\x00\xcaIDATH\x89\xb5\x95\xe1\x0e\x83 \x0c\x84\xafe\xaf\xa5\xb27g\xdbs\r\xfc\ +#\x0b#\xad\x14\xc1KL\x0c\x9a~\xbd\xf6\x8cD\xecp\xa7\xb8>H\xf1\x9bn\x05\x00\ +\xc0\xb6.\xd3 \x8f\xd6\x0b\x92#bGV\x80\xe8@*\x98/\xa0\xcf\xa1\xe8 \x84\x00\ +\x00S\xc6$\x02\xbc\xf75l.\x00\x00^\xefO\x9es\x1aIVs\xc9\xc4\x8e\xb6uI!\x84?g\ +\xd3\x00\xc0\xcfM*\xee\xe7\x02$Y\xe3k\x8a\xa9&K|\xbb\x1c\\\x89\xaf\x19\x90\ +\x97]\xc1\xc6\x01\xf1\x985\xb3\xa3j\xc1\xa6\xf8\x9e\x02\xca\xe2\xd2\xf9\xd3\ +\x10[\x15\x10\x8b\xee\xa2\xd2\xa9%\xb2\x97ST\xbb\xd2\xa4:`v\xa4\x8d\xa8\xab\ +\x91\xd3\x87GamD\x165S4\xd2=0\xf8%_\x02\xf4\xfc\x0e-\xda\x01\xe9\x13V\xf6\ +\xde\n\xe5\xa2\x00\x00\x00\x00IEND\xaeB`\x82' + +def getToolMoveLeftBitmap(): + return BitmapFromImage(getToolMoveLeftImage()) + +def getToolMoveLeftImage(): + stream = cStringIO.StringIO(getToolMoveLeftData()) + return ImageFromStream(stream) + +def getToolMoveLeftIcon(): + icon = EmptyIcon() + icon.CopyFromBitmap(getToolMoveLeftBitmap()) + return icon + +#---------------------------------------------------------------------- +def getToolMoveRightData(): + return \ +'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x18\x00\x00\x00\x17\x08\x06\ +\x00\x00\x00\x11!\x8f-\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\ +\x00\xcdIDATH\x89\xed\x94]\x0e\x02!\x0c\x84\xa7\xc5k\xed\x8f7sOf\xdd=\x97\ +\xd4\x170,\xc1Pv\xd1\'\'!\x01\x12\xfa1mS"vH\xa5\xfe\xa9\xc4\x8e\xd0I\\\xba\ +\x9c\xc6AS`\xbeN\x03r\x11;\x8a+\xff@M\x97\xd2\xa5\x88\x00@\xd3O\x9b\x00\xf3<\ +\xe7\xb0\xbe\x00\x00x\xac[,ts\xdeM\x80(bG\xd38\xa8\x88\xec\x9cu\x03\x00o7\ +\x9a\xecQrUjoS\x17}\x92\xa5\xbbL\x0e\xa2\x8et\x97\xd9\x01\xb1#\r\xd1[jav\xe0\ +\x93\x9c\xdfE@(\xd7\xe1\x10\xc0\x17\x02)\x80\xab\xc1\x89\t\xc0\xa1\x88\x11\ +\x14\xcfX\xb7\xfa[\x0b\xe0\x8c\xbe\x0e\xa8\xa6(-\xe4r\x00\xd04\xae\x17vt\xc3\ +\x7f\\\x07\xfd|\\w\x03\x84\xc9\xb8\x0b\x98\xb8i\xd6\x0b\'hn\x9c\n\x87\xccd\ +\x00\x00\x00\x00IEND\xaeB`\x82' + +def getToolMoveRightBitmap(): + return BitmapFromImage(getToolMoveRightImage()) + +def getToolMoveRightImage(): + stream = cStringIO.StringIO(getToolMoveRightData()) + return ImageFromStream(stream) + +def getToolMoveRightIcon(): + icon = EmptyIcon() + icon.CopyFromBitmap(getToolMoveRightBitmap()) + return icon + +#---------------------------------------------------------------------- +def getToolMoveUpData(): + return \ +'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x18\x00\x00\x00\x17\x08\x06\ +\x00\x00\x00\x11!\x8f-\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\ +\x00\xefIDATH\x89\xb5\x96Q\x12\xc2 \x0cD7\xc1k\xa9\xdc\xac\xc3\xcd\xaa\x9e\ +\x0b\xf0C\x19\x91\x92\x10:mf\xf2\xd3\xd2}IX\x98\x12\xb1\xc3\x99\xc1\xa7\xaa\ +\xb7\x80\x9cb\x96\x16\xa6\x14sR\xde\x9b\x00\x00p\xbf]7"E\x98\xd9\xd1,\xe02ZP\ +W\xddv`\x01\xaa{0\x1a\x89el*\xa0\xad\x90\xd9Q\x9d\x96B\x86.\xd2\x84\x98\x1d\ +\x85\x01\xc4dSm\xd6\xa1\x82,\x1d\x88\n\xc8)\xe6\x92\x04@\xa2\x84o\x01K\xaf8\ +\r\x00\x00\xc4\x8eJ\x02}\x1bk\xb1\xb1\xe9\xba\xae\x000}\xa0\xcc\x00\xef}\x0b\ +;\x16\x00\x00\x8f\xe7\xab\x8c;k\xd7\xc7n@\tbG33\x0f\x9dg\xc3\xab\xa2\xeaF\ +\x0c\xed\xa0\xa9\x80\xdexH8x\x01?\xbb\xd6\xb1\xcb\xa6\xed\x1d$\x89w;\x98\xb1\ +i\x99\xb9$\xbe\x01\xb4\x9b*\xd9\xd4"\\\x8b\x8a\x89O\'\x7f\xe9\xbd\xcf\xda7m\ +\x1ej\xd3\xae\xc6\xd9\x7f\x15o\xbc]\x81\xb1$]\x16\xd6\x00\x00\x00\x00IEND\ +\xaeB`\x82' + +def getToolMoveUpBitmap(): + return BitmapFromImage(getToolMoveUpImage()) + +def getToolMoveUpImage(): + stream = cStringIO.StringIO(getToolMoveUpData()) + return ImageFromStream(stream) + +def getToolMoveUpIcon(): + icon = EmptyIcon() + icon.CopyFromBitmap(getToolMoveUpBitmap()) + return icon + #---------------------------------------------------------------------- def getToolNotebookData(): return \ @@ -729,13 +842,13 @@ def getToolRadioButtonData(): return \ '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x0b\x00\x00\x00\x0b\x08\x06\ \x00\x00\x00\xa9\xacw&\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\ -\x00\x96IDAT\x18\x95m\x90\xc1\r\xc20\x10\x04\xc7g\n\xc8\x83*H\x07\x96RVD\t`\ -\xdc\x15(\xe9 T\x91\x87\x0b\x00\xcc#1\xb2\xcd\xadd\xf9t\x9a=\xad\x16#\x96\ -\xf6\x05\x1f\x92\xb6\x17\x1a\xdd.\xd7T\xfe\xa5D\x03\xc7\xf3\x88f\x10\r\\\x9e\ -\x8bj\x10\r\x04T\x83\t>\xfc\x81\xa5\xfaSO\xf0\x01\x00c\xc4\xf2y\xbf\x12\xc0\ -\xfc\x98\xe9\x8e\xdd\x0f\x8ck\xc4\rn\x8b`\x0fF\xf2\x00\xe0\x06G\\\xa3\nn\xa7\ -\x8b\x1e\xd3\xae\xe9>\xe5\xb1\xee\xdb\x88\xad2\xe6H\xd5E\xad\xe7\x12hA\x80/\ -\x17\xa5W:+\xbbb\xd2\x00\x00\x00\x00IEND\xaeB`\x82' +\x00\x98IDAT\x18\x95m\x8f\xc1\r\xc20\x0cE\x9f\x1d\x06\xe8\x81)\xe8\x06\x91:V\ +\xc5\x08P\xb2\x15\xa8\xdd\xa0L\xd1C\x06\x00\xc2\xa1\xa4J\x83\xbfd\xc5N\xde\ +\xb7~\x10u\xd4\x15\x86\x90\xac{\xa5\xd2\xedrM\xe5YJ-\xb0?\xf7X\x06\xb5\xc0\ +\xf99\x9b\x06\xb5@\xc04H\x18\xc2\x1fX\xaa=\xb5\x84!\x00 \xa2\x8e\xcf\xfb\x95\ +\x00\xa6\xc7Dsl60.\x11\xdf\xf95\x82;\x88\xe6\x06\xc0w\x9e\xb8D\x13\\W\xab\ +\xdb*\xfd4\xde\xc7\xdc\xa6\xf2]D\xdd.c\x8e\xb4\xdb\x98\xe7\xfaC\x19\xa8A\x80\ +/\x17\xa5W:\x12\xac\xa3\xbe\x00\x00\x00\x00IEND\xaeB`\x82' def getToolRadioButtonBitmap(): return BitmapFromImage(getToolRadioButtonImage()) @@ -752,13 +865,13 @@ def getToolRadioButtonIcon(): #---------------------------------------------------------------------- def getToolRootData(): return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\x00\x00\x00\x0e\x08\x06\ +"\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\x00\x00\x00\x0e\x08\x06\ \x00\x00\x00&/\x9c\x8a\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\ -\x00aIDAT(\x91\xed\x93\xc1\n\x80@\x08Dg\xb4_\xaa\xfc\xff[\xf5M\xb5\xdd\x96m\ -\xd1\xa8\xbc6\xe0A\x19\x07\x9e )\x8a\x8c\x06oX\x8e\xbd\xb4=E\x19\x06\xcc\xd3\ -x1/\xeb\x16\x9a]Q\x14fV(\x8a/\xe5"x\x18\x11R\rhQ\xde`\xd4\x80~\xe9\xeepn@\ -\xaf\x1f\xe19\x02\xb3\xbf \xa9m\x00\'\x0f\xb3\'\x06(\x95\x90F\x00\x00\x00\ -\x00IEND\xaeB`\x82' +\x00cIDAT(\x91\xed\x90\xc1\x0e\x800\x08C[\xf0\x97T\xfe\xff\xa6~\x93n\xb7e.`\ +\xa6\xbb\xda\x84\x03\xa4m\xf2 E1\xa2\xc9;\xa6\xebL\xf5NQ\x86\x05\xeb2\xdf\ +\xcc\xdb~\x84fW\x14\x85\x99%\x8a\xe2\xcb\xb8\x08\x1eF\x84T\nj\x947\x18\xa5\ +\xa0\r==\xce-h\xf5#\xf4#\x90\xa2\xbd^W2\x94\x06\x90\x01\x0f\xb3'\x06\xe8\x11\ +R\xf1\x00\x00\x00\x00IEND\xaeB`\x82" def getToolRootBitmap(): return BitmapFromImage(getToolRootImage()) @@ -804,8 +917,8 @@ def getToolSeparatorData(): return \ '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x0e\x00\x00\x00\x02\x08\x02\ \x00\x00\x00\xe7\xe8z\xfd\x00\x00\x00\x03sBIT\x08\x08\x08\xdb\xe1O\xe0\x00\ -\x00\x00\x17IDAT\x08\x99c\x9c2u\n\x03\x11 ;+\x9b\x05B\x11\xa3\x1a\x00\xfb\ -\x1c\x04CU\x1cv\xec\x00\x00\x00\x00IEND\xaeB`\x82' +\x00\x00\x17IDAT\x18\x95c\x9c2u\n\x03\x11 ;+\x9b\x05B\x11\xa3\x1a\x00\xfb\ +\x1c\x04C\xb1\x8cE\xa0\x00\x00\x00\x00IEND\xaeB`\x82' def getToolSeparatorBitmap(): return BitmapFromImage(getToolSeparatorImage()) @@ -939,28 +1052,28 @@ def getToolSplitterWindowIcon(): #---------------------------------------------------------------------- def getToolStaticBitmapData(): return \ -"\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x0e\x00\x00\x00\x11\x08\x06\ +'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x0e\x00\x00\x00\x11\x08\x06\ \x00\x00\x00\xed\xc8\x9d\x9f\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\ -\x00\x00\x01\xf9IDAT(\x91\x85\x931h\x13Q\x18\xc7\x7fw\xf7\x86\x17p\xb8\x83\ -\x0c\x97-\x05\x1dts\xb3N\x9et\x90\xe0\xa0-..N\x1d\xact(\xd1\xa9\xba\x05D\xa5\ -\x83Z\x1c\x84,B\xba\x14\x1d\xb4\x8e\xbd\x0e\xc5\x04\x94\xa4\x8b\xb5\xe0\xd0,\ -\x85d\x90\xe4\xd4\xc0=\xf0\xda\xcf!\xdc\xd9\xa3Q\xbf\xe9\xbd\xef}\xbf\xef{\ -\xdf\xff{\xcf\xb2l\x87\xe3vt\x98\x08\x13\xccv\x94\x95\xdb\x1f\x07R(\xfe\x19\ -\xd3\xf9\xd4a8\x1c\xfe5\xa1e\xd9N\xe6ln7y\xb3^gy\xe9,Z\x150\xa3\x98\xe6\xe7\ -\x88\xb5w;4^\xbd\xcfU\xce\xc0\xe6v\x93\x92\xafq\t\xf1\xfc\x8b\x80\x0b\xa6E\ -\x9c\x18\xa2oC\xee>\xdc\xa3\xb1\xd6\xc8`;\xad\xb6\xf2|\x05_\x85x\xc5\xcb\xa0\ -\xa6@yp\xaaBAi\\\xd7cy\xbe\xc4\xdc\xf5\xb9\xec\xaa*]T\xe7+\xa0\x01]\x1a;\x12\ -\x03@\x9ch\n\xca\xe0\x155\xae\xa7\xb3~3q\x8c1Y0hP.\xb1\x19\x8b\x13\xa3AiJnz\ -\x0ev\xdal\xed\xd9kHb\xc0@\x12\x81\xe9B\xd2\x1b'K\x0c&\x8ah\xac\x87'\xc7Q\ -\x7fY\xc7$\x8ca\xa5\x89M\x17\x88 1\xf4\xfb=\xba\x07Cj\x8fV3q\xb2\x1e\xb5\xd6\ -hc\x80\x02\xf1\xa8\x0bI\x841Cz\xfd>f\x14S{\xb1G\xb8U\xcf\x8bc;\xca\xba}\xe7\ -\x96\xec\xb4B\xa6\xce\xb4X}\x10\x10E\x11\xdd\x83\x1e\xf7\x1f\x87x\xc5s\x84[\ -\xcd\xdc\x1c\xb1l\x07\xcbv@!\xb37*\xb2\xfbeW\xda\x1f?H\xe5j \xd5\xc5\x9b\xb2\ -\xffu_RKc-\xdb\xf9\x03\xce^\xab\x88\x88H\xbb\xd3\x96`&\x90\xea\xbd\xaa\x0c\ -\x06\x83\x13@\x0e\xf4}_6\xc3M\xa9\\\td\xf5\xe9\x13YX\\\x10\xb7\xe8N\x04r \ -\xc1\xcc\xb4l\xbc\xdd\x18W\xbc\x14H\xf9t\xf9\xff`\n\x97\xcb\xbeL_8/\xd5\xa5\ -\xea?!\xcbv\xc6\x8f\x1c@\x8e\x0e\xc5\xf7]\x8c1|\xff\xf1+\xf7\xf7&\xd9o(\xba\ -\xfe\xd4S\x004\x8f\x00\x00\x00\x00IEND\xaeB`\x82" +\x00\x00\x01\xf7IDAT(\x91\x85\x921h\x13Q\x18\xc7\x7fw\xf7\x86\x17p\xb8\x83\ +\x0c\x97-\x05\x1dts\xb3N\x9et\x90\xe0`[\\\\\x9c:X\xe9PN\xa7\xea\x16\x10\x95\ +\x0ejq\x10\xb2\x08\xe9Rt\xd0:\xf6:\x14\x13P\x92.\xd6\x82C\xb3\x14\x92A\x92S\ +\x03\xf7\xc0k?\x87pgC\xab\xfdO\xef}\xef\xfd\xbe\xef}\xff\xefY\x96\xedpT\x87\ +\x07\xa9p\x82lGYc\xfb\xa3@\x06%\xbf\x12\xda\x9f\xdb\x0c\x06\x83\x7f&\xb4,\ +\xdb\xc9\x83\x8d\xad\x06o\xd7j,-\x9eG\xab\x02f\x98\xd0\xf8\x12\xb3\xfa~\x9b\ +\xfa\xeb\x0fc\x95s\xb0\xb1\xd5\xa0\xe4k\\"<\xff2\xe0\x82i\x92\xa4\x86\xf8\ +\xfb\x80{\x8fv\xa9\xaf\xd6s\xd8\xce\xaa-\xbfX\xc6W\x11^\xf1*\xa8\tP\x1e\x9c\ +\xa9PP\x1a\xd7\xf5X\x9a+1;=\x9b?Ue\x8bp\xae\x02\x1a\xd0\xa5Q 5\x00$\xa9\xa6\ +\xa0\x0c^Q\xe3z:\xef77\xc7\x18\x93_\x06\r\xca%1#s\x124(M\xc9\xcd\xce\xc1\xce\ +\x9a\xad>\x7f\x03i\x02\x18Hc0\x1dH\xbb\xa3d\xa9\xc1\xc41\xf5\xb5\xe8\xf88j\ +\xafj\x98\x94\x11\xac4\x89\xe9\x001\xa4\x86^\xafKg\x7f@\xf5\xf1JnN\xde\xa3\ +\xd6\x1am\x0cP \x19v \x8d1f@\xb7\xd7\xc3\x0c\x13\xaa/w\x896k\xe3\xe6\xd8\x8e\ +\xb2\xee\xdc\xbd-\xdb\xcd\x88\x89sMV\x1e\x06\xc4qLg\xbf\xcb\x83\'\x11^\xf1\ +\x02\xd1fcl\x8eX\xb6\x83e;\xa0\x90\x99\x9b\x15\xd9\xf9\xba#\xadO\x1f\xa5r=\ +\x90p\xe1\x96\xec}\xdb\x93L\xd9]\xcbv\xfe\x8237*""\xd2j\xb7$\x98\n$\xbc\x1fJ\ +\xbf\xdf?\x06\x8c\x81\xbe\xef\xcbF\xb4!\x95k\x81\xac<{*\xf3\x0b\xf3\xe2\x16\ +\xdd\x13\x811\x10\x90`jR\xd6\xdf\xad\x8f*^\t\xa4|\xb6|:\x98\xc1\xe5\xb2/\x93\ +\x97.J\xb8\x18\xfe\x17\xb2lg\xf4\xc9\x01\xe4\xf0@|\xdf\xc5\x18\xc3\x8f\x9f\ +\xbf-N\xd1\x1f(\xba\xfe\xd4\xf5\xbb\xa30\x00\x00\x00\x00IEND\xaeB`\x82' def getToolStaticBitmapBitmap(): return BitmapFromImage(getToolStaticBitmapImage()) @@ -1027,8 +1140,8 @@ def getToolStaticLineData(): return \ '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x14\x00\x00\x00\x02\x08\x02\ \x00\x00\x00\xd7dk\xdc\x00\x00\x00\x03sBIT\x08\x08\x08\xdb\xe1O\xe0\x00\x00\ -\x00\x17IDAT\x08\x99c\x9c2u\n\x03Y ;+\x9b\x05B\x91\xa7\x1f\x00gO\x04C>\xbb?\ -\x99\x00\x00\x00\x00IEND\xaeB`\x82' +\x00\x17IDAT\x18\x95c\x9c2u\n\x03Y ;+\x9b\x05B\x91\xa7\x1f\x00gO\x04C\xda+\ +\x0c\xd5\x00\x00\x00\x00IEND\xaeB`\x82' def getToolStaticLineBitmap(): return BitmapFromImage(getToolStaticLineImage()) @@ -1091,9 +1204,9 @@ def getToolToolData(): return \ '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\t\x00\x00\x00\t\x08\x02\x00\ \x00\x00o\xf3\x91G\x00\x00\x00\x03sBIT\x08\x08\x08\xdb\xe1O\xe0\x00\x00\x00>\ -IDAT\x08\x99c\xfc\xf1\xe7\x07\x036\xc0\xc1\xc2\xc1\xc2\xc0\xc0p\xe3\xc6\r4\ +IDAT\x18\x95c\xfc\xf1\xe7\x07\x036\xc0\xc1\xc2\xc1\xc2\xc0\xc0p\xe3\xc6\r4\ \x89\x03\x07\x0e0000a\xd5\x04\x01,hj\x19\x18\x18\x1c\x1c\x1c \x0c|\xfa\x883\ -\x13n\x14\x8a\x1c\xdc&\x12\x00\x00b\xc7\r\xe0y\xf1\x04O\x00\x00\x00\x00IEND\ +\x13n\x14\x8a\x1c\xdc&\x12\x00\x00b\xc7\r\xe0\xb7\\uG\x00\x00\x00\x00IEND\ \xaeB`\x82' def getToolToolBitmap(): @@ -1135,13 +1248,13 @@ def getToolToolBarIcon(): #---------------------------------------------------------------------- def getToolTreeCtrlData(): return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\x00\x00\x00\x0e\x08\x06\ +"\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\x00\x00\x00\x0e\x08\x06\ \x00\x00\x00&/\x9c\x8a\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\ -\x00aIDAT(\x91\xed\x93\xc1\n\x80@\x08Dg\xb4_\xaa\xfc\xff[\xf5M\xb5\xdd\x96m\ -\xd1\xa8\xbc6\xe0A\x19\x07\x9e )\x8a\x8c\x06oX\x8e\xbd\xb4=E\x19\x06\xcc\xd3\ -x1/\xeb\x16\x9a]Q\x14fV(\x8a/\xe5"x\x18\x11R\rhQ\xde`\xd4\x80~\xe9\xeepn@\ -\xaf\x1f\xe19\x02\xb3\xbf \xa9m\x00\'\x0f\xb3\'\x06(\x95\x90F\x00\x00\x00\ -\x00IEND\xaeB`\x82' +\x00cIDAT(\x91\xed\x90\xc1\x0e\x800\x08C[\xf0\x97T\xfe\xff\xa6~\x93n\xb7e.`\ +\xa6\xbb\xda\x84\x03\xa4m\xf2 E1\xa2\xc9;\xa6\xebL\xf5NQ\x86\x05\xeb2\xdf\ +\xcc\xdb~\x84fW\x14\x85\x99%\x8a\xe2\xcb\xb8\x08\x1eF\x84T\nj\x947\x18\xa5\ +\xa0\r==\xce-h\xf5#\xf4#\x90\xa2\xbd^W2\x94\x06\x90\x01\x0f\xb3'\x06\xe8\x11\ +R\xf1\x00\x00\x00\x00IEND\xaeB`\x82" def getToolTreeCtrlBitmap(): return BitmapFromImage(getToolTreeCtrlImage()) @@ -1336,13 +1449,13 @@ def getTreePanelIcon(): #---------------------------------------------------------------------- def getTreeRootData(): return \ -'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\x00\x00\x00\x0e\x08\x06\ +"\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\x00\x00\x00\x0e\x08\x06\ \x00\x00\x00&/\x9c\x8a\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\ -\x00aIDAT(\x91\xed\x93\xc1\n\x80@\x08Dg\xb4_\xaa\xfc\xff[\xf5M\xb5\xdd\x96m\ -\xd1\xa8\xbc6\xe0A\x19\x07\x9e )\x8a\x8c\x06oX\x8e\xbd\xb4=E\x19\x06\xcc\xd3\ -x1/\xeb\x16\x9a]Q\x14fV(\x8a/\xe5"x\x18\x11R\rhQ\xde`\xd4\x80~\xe9\xeepn@\ -\xaf\x1f\xe19\x02\xb3\xbf \xa9m\x00\'\x0f\xb3\'\x06(\x95\x90F\x00\x00\x00\ -\x00IEND\xaeB`\x82' +\x00cIDAT(\x91\xed\x90\xc1\x0e\x800\x08C[\xf0\x97T\xfe\xff\xa6~\x93n\xb7e.`\ +\xa6\xbb\xda\x84\x03\xa4m\xf2 E1\xa2\xc9;\xa6\xebL\xf5NQ\x86\x05\xeb2\xdf\ +\xcc\xdb~\x84fW\x14\x85\x99%\x8a\xe2\xcb\xb8\x08\x1eF\x84T\nj\x947\x18\xa5\ +\xa0\r==\xce-h\xf5#\xf4#\x90\xa2\xbd^W2\x94\x06\x90\x01\x0f\xb3'\x06\xe8\x11\ +R\xf1\x00\x00\x00\x00IEND\xaeB`\x82" def getTreeRootBitmap(): return BitmapFromImage(getTreeRootImage()) diff --git a/wxPython/wx/tools/XRCed/panel.py b/wxPython/wx/tools/XRCed/panel.py index 42722aa53e..d231a933cc 100644 --- a/wxPython/wx/tools/XRCed/panel.py +++ b/wxPython/wx/tools/XRCed/panel.py @@ -89,7 +89,7 @@ class Panel(wx.Notebook): g.currentXXX = xxx.treeObject() # Normal or SizerItem page isGBSizerItem = isinstance(xxx.parent, xxxGridBagSizer) - cacheID = (xxx.__class__, isGBSizerItem) + cacheID = (xxx.panelName(), isGBSizerItem) try: page = self.pageCache[cacheID] page.box.SetLabel(xxx.panelName()) @@ -102,7 +102,7 @@ class Panel(wx.Notebook): sizer.Add(page, 1, wx.EXPAND) if xxx.hasChild: # Special label for child objects - they may have different GUI - cacheID = (xxx.child.__class__, xxx.__class__) + cacheID = (xxx.child.panelName(), xxx.__class__) try: page = self.pageCache[cacheID] page.box.SetLabel(xxx.child.panelName()) diff --git a/wxPython/wx/tools/XRCed/params.py b/wxPython/wx/tools/XRCed/params.py index 71a7414989..23bcf21524 100644 --- a/wxPython/wx/tools/XRCed/params.py +++ b/wxPython/wx/tools/XRCed/params.py @@ -555,7 +555,7 @@ class ContentCheckListDialog(wx.Dialog): pre = wx.PreDialog() g.frame.res.LoadOnDialog(pre, parent, 'DIALOG_CONTENT_CHECKLIST') self.PostCreate(pre) - self.list = xrc.XRCCTRL(self, 'CHECKLIST') + self.list = xrc.XRCCTRL(self, 'CHECK_LIST') # Set list items i = 0 for v,ch in value: @@ -674,6 +674,17 @@ class ParamContentCheckList(ParamContent): self.SetModified() self.textModified = False dlg.Destroy() + def SetValue(self, value): + self.freeze = True + if not value: value = [] + self.value = value + if value: + if len(value) == 1: repr_ = str(value) + else: repr_ = reduce(lambda a,b: '%s|%s' % (a,b), value) + else: + repr_ = '' + self.text.SetValue(repr_) # update text ctrl + self.freeze = False class IntListDialog(wx.Dialog): def __init__(self, parent, value): diff --git a/wxPython/wx/tools/XRCed/src-images/ToolMoveDown.png b/wxPython/wx/tools/XRCed/src-images/ToolMoveDown.png new file mode 100644 index 0000000000..f0dc4bc303 Binary files /dev/null and b/wxPython/wx/tools/XRCed/src-images/ToolMoveDown.png differ diff --git a/wxPython/wx/tools/XRCed/src-images/ToolMoveLeft.png b/wxPython/wx/tools/XRCed/src-images/ToolMoveLeft.png new file mode 100644 index 0000000000..94b32fd672 Binary files /dev/null and b/wxPython/wx/tools/XRCed/src-images/ToolMoveLeft.png differ diff --git a/wxPython/wx/tools/XRCed/src-images/ToolMoveRight.png b/wxPython/wx/tools/XRCed/src-images/ToolMoveRight.png new file mode 100644 index 0000000000..05f4dd4bc0 Binary files /dev/null and b/wxPython/wx/tools/XRCed/src-images/ToolMoveRight.png differ diff --git a/wxPython/wx/tools/XRCed/src-images/ToolMoveUp.png b/wxPython/wx/tools/XRCed/src-images/ToolMoveUp.png new file mode 100644 index 0000000000..01d2883606 Binary files /dev/null and b/wxPython/wx/tools/XRCed/src-images/ToolMoveUp.png differ diff --git a/wxPython/wx/tools/XRCed/tree.py b/wxPython/wx/tools/XRCed/tree.py index 26e8b91a8a..8e515841ae 100644 --- a/wxPython/wx/tools/XRCed/tree.py +++ b/wxPython/wx/tools/XRCed/tree.py @@ -563,6 +563,8 @@ class XML_Tree(wx.TreeCtrl): # Different color for references if treeObj.ref: self.SetItemTextColour(item, 'DarkGreen') + elif treeObj.hasStyle and treeObj.params.get('hidden', False): + self.SetItemTextColour(item, 'Grey') # Try to find children objects if treeObj.hasChildren: nodes = treeObj.element.childNodes[:] @@ -723,7 +725,8 @@ class XML_Tree(wx.TreeCtrl): if item == g.testWin.item: return False while item != self.root: item = self.GetItemParent(item) - if item == g.testWin.item: return True + if item == g.testWin.item: + return True return False # Highlight selected item @@ -739,7 +742,9 @@ class XML_Tree(wx.TreeCtrl): return # Get window/sizer object obj = self.FindNodeObject(item) - if not obj: + xxx = self.GetPyData(item).treeObject() + # Remove existing HL if item not found or is hidden + if not obj or xxx.hasStyle and xxx.params.get('hidden', False): if g.testWin.highLight: g.testWin.highLight.Remove() return pos = self.FindNodePos(item, obj) @@ -769,6 +774,7 @@ class XML_Tree(wx.TreeCtrl): return # Show item in bold if g.testWin: # Reset old + self.Unselect() self.SetItemBold(g.testWin.item, False) try: wx.BeginBusyCursor() @@ -1116,7 +1122,7 @@ class XML_Tree(wx.TreeCtrl): (ID_NEW.PANEL, 'Panel', 'Create panel'), (ID_NEW.DIALOG, 'Dialog', 'Create dialog'), (ID_NEW.FRAME, 'Frame', 'Create frame')], shift=True) - elif xxx.isSizer: + elif xxx.isSizer and self.ItemHasChildren(item): SetMenu(m, pullDownMenu.sizers, shift=True) else: SetMenu(m, pullDownMenu.controls, shift=True) @@ -1143,6 +1149,11 @@ class XML_Tree(wx.TreeCtrl): self.PopupMenu(menu, evt.GetPosition()) menu.Destroy() + # Redefine to force the update of font dimentions + def SetItemBold(self, item): + wx.TreeCtrl.SetItemBold(self, item) + self.SetIndent(self.GetIndent()) + # Apply changes def Apply(self, xxx, item): g.panel.Apply() diff --git a/wxPython/wx/tools/XRCed/undo.py b/wxPython/wx/tools/XRCed/undo.py index fe0c181739..a064264b94 100644 --- a/wxPython/wx/tools/XRCed/undo.py +++ b/wxPython/wx/tools/XRCed/undo.py @@ -6,6 +6,7 @@ from globals import * from xxx import MakeXXXFromDOM +from tree import * #from panel import * # Undo/redo classes @@ -123,9 +124,10 @@ class UndoPasteCreate: class UndoReplace: def __init__(self, item): self.itemIndex = g.tree.ItemFullIndex(item) - self.xxx = g.tree.GetPyData(item) + #self.xxx = g.tree.GetPyData(item) + self.elem = None def destroy(self): - if self.xxx: self.xxx.element.unlink() + if self.elem: self.elem.unlink() def undo(self): print 'Sorry, UndoReplace is not yet implemented.' return @@ -163,6 +165,91 @@ class UndoReplace: def redo(self): return +class UndoMove: + def __init__(self, oldParent, oldIndex, newParent, newIndex): + self.oldParent = oldParent + self.oldIndex = oldIndex + self.newParent = newParent + self.newIndex = newIndex + def destroy(self): + pass + def undo(self): + item = g.tree.GetFirstChild(self.newParent)[0] + for i in range(self.newIndex): item = g.tree.GetNextSibling(item) + elem = g.tree.RemoveLeaf(item) + nextItem = g.tree.GetFirstChild(self.oldParent)[0] + for i in range(self.oldIndex): nextItem = g.tree.GetNextSibling(nextItem) + + parent = g.tree.GetPyData(self.oldParent).treeObject() + + # Check parent and child relationships. + # If parent is sizer or notebook, child is of wrong class or + # parent is normal window, child is child container then detach child. + xxx = MakeXXXFromDOM(parent, elem) + isChildContainer = isinstance(xxx, xxxChildContainer) + if isChildContainer and \ + ((parent.isSizer and not isinstance(xxx, xxxSizerItem)) or \ + (isinstance(parent, xxxNotebook) and not isinstance(xxx, xxxNotebookPage)) or \ + not (parent.isSizer or isinstance(parent, xxxNotebook))): + elem.removeChild(xxx.child.element) # detach child + elem.unlink() # delete child container + elem = xxx.child.element # replace + # This may help garbage collection + xxx.child.parent = None + isChildContainer = False + # Parent is sizer or notebook, child is not child container + if parent.isSizer and not isChildContainer and not isinstance(xxx, xxxSpacer): + # Create sizer item element + sizerItemElem = MakeEmptyDOM('sizeritem') + sizerItemElem.appendChild(elem) + elem = sizerItemElem + elif isinstance(parent, xxxNotebook) and not isChildContainer: + pageElem = MakeEmptyDOM('notebookpage') + pageElem.appendChild(elem) + elem = pageElem + + selected = g.tree.InsertNode(self.oldParent, parent, elem, nextItem) + g.tree.EnsureVisible(selected) + g.tree.SelectItem(selected) + def redo(self): + item = g.tree.GetFirstChild(self.oldParent)[0] + for i in range(self.oldIndex): item = g.tree.GetNextSibling(item) + elem = g.tree.RemoveLeaf(item) + + parent = g.tree.GetPyData(self.newParent).treeObject() + + # Check parent and child relationships. + # If parent is sizer or notebook, child is of wrong class or + # parent is normal window, child is child container then detach child. + xxx = MakeXXXFromDOM(parent, elem) + isChildContainer = isinstance(xxx, xxxChildContainer) + if isChildContainer and \ + ((parent.isSizer and not isinstance(xxx, xxxSizerItem)) or \ + (isinstance(parent, xxxNotebook) and not isinstance(xxx, xxxNotebookPage)) or \ + not (parent.isSizer or isinstance(parent, xxxNotebook))): + elem.removeChild(xxx.child.element) # detach child + elem.unlink() # delete child container + elem = xxx.child.element # replace + # This may help garbage collection + xxx.child.parent = None + isChildContainer = False + # Parent is sizer or notebook, child is not child container + if parent.isSizer and not isChildContainer and not isinstance(xxx, xxxSpacer): + # Create sizer item element + sizerItemElem = MakeEmptyDOM('sizeritem') + sizerItemElem.appendChild(elem) + elem = sizerItemElem + elif isinstance(parent, xxxNotebook) and not isChildContainer: + pageElem = MakeEmptyDOM('notebookpage') + pageElem.appendChild(elem) + elem = pageElem + + nextItem = g.tree.GetFirstChild(self.newParent)[0] + for i in range(self.newIndex): nextItem = g.tree.GetNextSibling(nextItem) + selected = g.tree.InsertNode(self.newParent, parent, elem, nextItem) + g.tree.EnsureVisible(selected) + g.tree.SelectItem(selected) + class UndoEdit: def __init__(self): self.pages = map(ParamPage.GetState, g.panel.pages) diff --git a/wxPython/wx/tools/XRCed/xrced.py b/wxPython/wx/tools/XRCed/xrced.py index e47b62f287..92e855b9f2 100644 --- a/wxPython/wx/tools/XRCed/xrced.py +++ b/wxPython/wx/tools/XRCed/xrced.py @@ -28,6 +28,7 @@ from xml.parsers import expat from tree import * # imports xxx which imports params from panel import * from tools import * +from params import genericStyles # Cleanup recursive import sideeffects, otherwise we can't create undoMan import undo undo.ParamPage = ParamPage @@ -167,6 +168,17 @@ class Frame(wx.Frame): menu.Append(self.ID_TEST_HIDE, '&Hide\tCtrl-H', 'Close test window') menuBar.Append(menu, '&View') + menu = wx.Menu() + self.ID_MOVEUP = wx.NewId() + menu.Append(self.ID_MOVEUP, '&Up', 'Move before previous sibling') + self.ID_MOVEDOWN = wx.NewId() + menu.Append(self.ID_MOVEDOWN, '&Down', 'Move after next sibling') + self.ID_MOVELEFT = wx.NewId() + menu.Append(self.ID_MOVELEFT, '&Make sibling', 'Make sibling of parent') + self.ID_MOVERIGHT = wx.NewId() + menu.Append(self.ID_MOVERIGHT, '&Make child', 'Make child of previous sibling') + menuBar.Append(menu, '&Move') + menu = wx.Menu() menu.Append(wx.ID_ABOUT, '&About...', 'About XCRed') self.ID_README = wx.NewId() @@ -212,6 +224,15 @@ class Frame(wx.Frame): 'Refresh', 'Refresh view') tb.AddSimpleTool(self.ID_AUTO_REFRESH, images.getAutoRefreshBitmap(), 'Auto-refresh', 'Toggle auto-refresh mode', True) + tb.AddControl(wx.StaticLine(tb, -1, size=(-1,23), style=wx.LI_VERTICAL)) + tb.AddSimpleTool(self.ID_MOVEUP, images.getToolMoveUpBitmap(), + 'Up', 'Move before previous sibling') + tb.AddSimpleTool(self.ID_MOVEDOWN, images.getToolMoveDownBitmap(), + 'Down', 'Move after next sibling') + tb.AddSimpleTool(self.ID_MOVELEFT, images.getToolMoveLeftBitmap(), + 'Make Sibling', 'Make sibling of parent') + tb.AddSimpleTool(self.ID_MOVERIGHT, images.getToolMoveRightBitmap(), + 'Make Child', 'Make child of previous sibling') # if wx.Platform == '__WXGTK__': # tb.AddSeparator() # otherwise auto-refresh sticks in status line tb.ToggleTool(self.ID_AUTO_REFRESH, conf.autoRefresh) @@ -244,6 +265,11 @@ class Frame(wx.Frame): wx.EVT_MENU(self, self.ID_REFRESH, self.OnRefresh) wx.EVT_MENU(self, self.ID_AUTO_REFRESH, self.OnAutoRefresh) wx.EVT_MENU(self, self.ID_TEST_HIDE, self.OnTestHide) + # Move + wx.EVT_MENU(self, self.ID_MOVEUP, self.OnMoveUp) + wx.EVT_MENU(self, self.ID_MOVEDOWN, self.OnMoveDown) + wx.EVT_MENU(self, self.ID_MOVELEFT, self.OnMoveLeft) + wx.EVT_MENU(self, self.ID_MOVERIGHT, self.OnMoveRight) # Help wx.EVT_MENU(self, wx.ID_ABOUT, self.OnAbout) wx.EVT_MENU(self, self.ID_README, self.OnReadme) @@ -517,45 +543,12 @@ class Frame(wx.Frame): xml = cPickle.loads(data.GetData()) # xml representation of element elem = minidom.parseString(xml).childNodes[0] + # Tempopary xxx object to test things xxx = MakeXXXFromDOM(parent, elem) + # Check compatibility - error = False - # Top-level - x = xxx.treeObject() - if x.__class__ in [xxxDialog, xxxFrame, xxxWizard]: - # Top-level classes - if parent.__class__ != xxxMainNode: error = True - elif x.__class__ == xxxMenuBar: - # Menubar can be put in frame or dialog - if parent.__class__ not in [xxxMainNode, xxxFrame, xxxDialog]: error = True - elif x.__class__ == xxxToolBar: - # Toolbar can be top-level of child of panel or frame - if parent.__class__ not in [xxxMainNode, xxxPanel, xxxFrame] and \ - not parent.isSizer: error = True - elif x.__class__ == xxxPanel and parent.__class__ == xxxMainNode: - pass - elif x.__class__ == xxxSpacer: - if not parent.isSizer: error = True - elif x.__class__ == xxxSeparator: - if not parent.__class__ in [xxxMenu, xxxToolBar]: error = True - elif x.__class__ == xxxTool: - if parent.__class__ != xxxToolBar: error = True - elif x.__class__ == xxxMenu: - if not parent.__class__ in [xxxMainNode, xxxMenuBar, xxxMenu]: error = True - elif x.__class__ == xxxMenuItem: - if not parent.__class__ in [xxxMenuBar, xxxMenu]: error = True - elif x.isSizer and parent.__class__ in [xxxNotebook, xxxChoicebook, xxxListbook]: - error = True - else: # normal controls can be almost anywhere - if parent.__class__ == xxxMainNode or \ - parent.__class__ in [xxxMenuBar, xxxMenu]: error = True - if error: - if parent.__class__ == xxxMainNode: parentClass = 'root' - else: parentClass = parent.className - wx.LogError('Incompatible parent/child: parent is %s, child is %s!' % - (parentClass, x.className)) - return + if not self.ItemsAreCompatible(parent, xxx.treeObject()): return # Check parent and child relationships. # If parent is sizer or notebook, child is of wrong class or @@ -609,6 +602,221 @@ class Frame(wx.Frame): self.SetModified() self.SetStatusText('Pasted') + + def ItemsAreCompatible(self, parent, child): + # Check compatibility + error = False + # Top-level + if child.__class__ in [xxxDialog, xxxFrame, xxxWizard]: + # Top-level classes + if parent.__class__ != xxxMainNode: error = True + elif child.__class__ == xxxMenuBar: + # Menubar can be put in frame or dialog + if parent.__class__ not in [xxxMainNode, xxxFrame, xxxDialog]: error = True + elif child.__class__ == xxxToolBar: + # Toolbar can be top-level of child of panel or frame + if parent.__class__ not in [xxxMainNode, xxxPanel, xxxFrame] and \ + not parent.isSizer: error = True + elif child.__class__ == xxxPanel and parent.__class__ == xxxMainNode: + pass + elif child.__class__ == xxxSpacer: + if not parent.isSizer: error = True + elif child.__class__ == xxxSeparator: + if not parent.__class__ in [xxxMenu, xxxToolBar]: error = True + elif child.__class__ == xxxTool: + if parent.__class__ != xxxToolBar: error = True + elif child.__class__ == xxxMenu: + if not parent.__class__ in [xxxMainNode, xxxMenuBar, xxxMenu]: error = True + elif child.__class__ == xxxMenuItem: + if not parent.__class__ in [xxxMenuBar, xxxMenu]: error = True + elif child.isSizer and parent.__class__ in [xxxNotebook, xxxChoicebook, xxxListbook]: + error = True + else: # normal controls can be almost anywhere + if parent.__class__ == xxxMainNode or \ + parent.__class__ in [xxxMenuBar, xxxMenu]: error = True + if error: + if parent.__class__ == xxxMainNode: parentClass = 'root' + else: parentClass = parent.className + wx.LogError('Incompatible parent/child: parent is %s, child is %s!' % + (parentClass, child.className)) + return False + return True + + def OnMoveUp(self, evt): + selected = tree.selection + if not selected: return + + index = tree.ItemIndex(selected) + if index == 0: return # No previous sibling found + + # Undo info + self.lastOp = 'MOVEUP' + status = 'Moved before previous sibling' + + # Prepare undo data + panel.Apply() + + parent = tree.GetItemParent(selected) + elem = tree.RemoveLeaf(selected) + nextItem = tree.GetFirstChild(parent)[0] + for i in range(index - 1): nextItem = tree.GetNextSibling(nextItem) + selected = tree.InsertNode(parent, tree.GetPyData(parent).treeObject(), elem, nextItem) + newIndex = tree.ItemIndex(selected) + tree.SelectItem(selected) + + undoMan.RegisterUndo(UndoMove(parent, index, parent, newIndex)) + + self.modified = True + self.SetStatusText(status) + + return + + def OnMoveDown(self, evt): + selected = tree.selection + if not selected: return + + index = tree.ItemIndex(selected) + next = tree.GetNextSibling(selected) + if not next: return + + # Undo info + self.lastOp = 'MOVEDOWN' + status = 'Moved after next sibling' + + # Prepare undo data + panel.Apply() + + parent = tree.GetItemParent(selected) + elem = tree.RemoveLeaf(selected) + nextItem = tree.GetFirstChild(parent)[0] + for i in range(index + 1): nextItem = tree.GetNextSibling(nextItem) + selected = tree.InsertNode(parent, tree.GetPyData(parent).treeObject(), elem, nextItem) + newIndex = tree.ItemIndex(selected) + tree.SelectItem(selected) + + undoMan.RegisterUndo(UndoMove(parent, index, parent, newIndex)) + + self.modified = True + self.SetStatusText(status) + + return + + def OnMoveLeft(self, evt): + selected = tree.selection + if not selected: return + + oldParent = tree.GetItemParent(selected) + if not oldParent: return + pparent = tree.GetItemParent(oldParent) + if not pparent: return + + # Check compatibility + if not self.ItemsAreCompatible(tree.GetPyData(pparent).treeObject(), tree.GetPyData(selected).treeObject()): return + + # Undo info + self.lastOp = 'MOVELEFT' + status = 'Made next sibling of parent' + + oldIndex = tree.ItemIndex(selected) + elem = tree.RemoveLeaf(selected) + nextItem = tree.GetFirstChild(pparent)[0] + parentIndex = tree.ItemIndex(oldParent) + for i in range(parentIndex + 1): nextItem = tree.GetNextSibling(nextItem) + + # Check parent and child relationships. + # If parent is sizer or notebook, child is of wrong class or + # parent is normal window, child is child container then detach child. + parent = tree.GetPyData(pparent).treeObject() + xxx = MakeXXXFromDOM(parent, elem) + isChildContainer = isinstance(xxx, xxxChildContainer) + if isChildContainer and \ + ((parent.isSizer and not isinstance(xxx, xxxSizerItem)) or \ + (isinstance(parent, xxxNotebook) and not isinstance(xxx, xxxNotebookPage)) or \ + not (parent.isSizer or isinstance(parent, xxxNotebook))): + elem.removeChild(xxx.child.element) # detach child + elem.unlink() # delete child container + elem = xxx.child.element # replace + # This may help garbage collection + xxx.child.parent = None + isChildContainer = False + # Parent is sizer or notebook, child is not child container + if parent.isSizer and not isChildContainer and not isinstance(xxx, xxxSpacer): + # Create sizer item element + sizerItemElem = MakeEmptyDOM('sizeritem') + sizerItemElem.appendChild(elem) + elem = sizerItemElem + elif isinstance(parent, xxxNotebook) and not isChildContainer: + pageElem = MakeEmptyDOM('notebookpage') + pageElem.appendChild(elem) + elem = pageElem + + selected = tree.InsertNode(pparent, tree.GetPyData(pparent).treeObject(), elem, nextItem) + newIndex = tree.ItemIndex(selected) + tree.SelectItem(selected) + + undoMan.RegisterUndo(UndoMove(oldParent, oldIndex, pparent, newIndex)) + + self.modified = True + self.SetStatusText(status) + + def OnMoveRight(self, evt): + selected = tree.selection + if not selected: return + + oldParent = tree.GetItemParent(selected) + if not oldParent: return + + newParent = tree.GetPrevSibling(selected) + if not newParent: return + + parent = tree.GetPyData(newParent).treeObject() + + # Check compatibility + if not self.ItemsAreCompatible(parent, tree.GetPyData(selected).treeObject()): return + + # Undo info + self.lastOp = 'MOVERIGHT' + status = 'Made last child of previous sibling' + + oldIndex = tree.ItemIndex(selected) + elem = tree.RemoveLeaf(selected) + + # Check parent and child relationships. + # If parent is sizer or notebook, child is of wrong class or + # parent is normal window, child is child container then detach child. + xxx = MakeXXXFromDOM(parent, elem) + isChildContainer = isinstance(xxx, xxxChildContainer) + if isChildContainer and \ + ((parent.isSizer and not isinstance(xxx, xxxSizerItem)) or \ + (isinstance(parent, xxxNotebook) and not isinstance(xxx, xxxNotebookPage)) or \ + not (parent.isSizer or isinstance(parent, xxxNotebook))): + elem.removeChild(xxx.child.element) # detach child + elem.unlink() # delete child container + elem = xxx.child.element # replace + # This may help garbage collection + xxx.child.parent = None + isChildContainer = False + # Parent is sizer or notebook, child is not child container + if parent.isSizer and not isChildContainer and not isinstance(xxx, xxxSpacer): + # Create sizer item element + sizerItemElem = MakeEmptyDOM('sizeritem') + sizerItemElem.appendChild(elem) + elem = sizerItemElem + elif isinstance(parent, xxxNotebook) and not isChildContainer: + pageElem = MakeEmptyDOM('notebookpage') + pageElem.appendChild(elem) + elem = pageElem + + selected = tree.InsertNode(newParent, tree.GetPyData(newParent).treeObject(), elem, wx.TreeItemId()) + + newIndex = tree.ItemIndex(selected) + tree.SelectItem(selected) + + undoMan.RegisterUndo(UndoMove(oldParent, oldIndex, newParent, newIndex)) + + self.modified = True + self.SetStatusText(status) + def OnCutDelete(self, evt): selected = tree.selection @@ -903,6 +1111,7 @@ Homepage: http://xrced.sourceforge.net\ undoMan.RegisterUndo(UndoReplace(selected)) # New class className = pullDownMenu.createMap[evt.GetId() - 1000] + # Create temporary empty node (with default values) dummy = MakeEmptyDOM(className) if className == 'spacer' and xxx.className != 'spacer': @@ -938,7 +1147,7 @@ Homepage: http://xrced.sourceforge.net\ sizeritem.removeChild(elem) elem.unlink() elem = sizeritem - tree.GetPyData(selected).hasChild = false + tree.GetPyData(selected).hasChild = False elif xxx.className == 'spacer' and className != 'spacer': # Create sizeritem element assert xxx.parent.isSizer @@ -962,6 +1171,17 @@ Homepage: http://xrced.sourceforge.net\ elem.removeAttribute('subclass') # clear subclassing # Re-create xxx element xxx = MakeXXXFromDOM(xxx.parent, elem) + # Remove incompatible style flags + if 'style' in xxx.params: + styles = map(string.strip, xxx.params['style'].value().split('|')) + newStyles = [s for s in styles if s in klass.winStyles or s in genericStyles] + if newStyles != styles: + if newStyles: + value = reduce(lambda a,b: a+'|'+b, newStyles) + else: + value = '' + xxx.params['style'].update(value) + # Update parent in child objects if tree.ItemHasChildren(selected): i, cookie = tree.GetFirstChild(selected) @@ -974,9 +1194,7 @@ Homepage: http://xrced.sourceforge.net\ # Update tree if tree.GetPyData(selected).hasChild: # child container container = tree.GetPyData(selected) - container.child = xxx - container.hasChildren = xxx.hasChildren - container.isSizer = xxx.isSizer + container.resetChild(xxx) xxx = container else: tree.SetPyData(selected, xxx) diff --git a/wxPython/wx/tools/XRCed/xxx.py b/wxPython/wx/tools/XRCed/xxx.py index 781c404814..4144307da0 100644 --- a/wxPython/wx/tools/XRCed/xxx.py +++ b/wxPython/wx/tools/XRCed/xxx.py @@ -605,8 +605,8 @@ class xxxCalendarCtrl(xxxObject): class xxxNotebook(xxxContainer): allParams = ['pos', 'size', 'style'] - winStyles = ['wxNB_DEFAULT', 'wxNB_LEFT', 'wxNB_RIGHT', 'wxNB_BOTTOM', - 'wxNB_FIXEDWIDTH', 'wxNB_MULTILINE', 'wxNB_NOPAGETHEME'] + winStyles = ['wxNB_TOP', 'wxNB_LEFT', 'wxNB_RIGHT', 'wxNB_BOTTOM', + 'wxNB_FIXEDWIDTH', 'wxNB_MULTILINE', 'wxNB_NOPAGETHEME', 'wxNB_FLAT'] class xxxChoicebook(xxxContainer): allParams = ['pos', 'size', 'style'] @@ -645,7 +645,8 @@ class xxxButton(xxxObject): allParams = ['label', 'default', 'pos', 'size', 'style'] paramDict = {'default': ParamBool} required = ['label'] - winStyles = ['wxBU_LEFT', 'wxBU_TOP', 'wxBU_RIGHT', 'wxBU_BOTTOM', 'wxBU_EXACTFIT'] + winStyles = ['wxBU_LEFT', 'wxBU_TOP', 'wxBU_RIGHT', 'wxBU_BOTTOM', 'wxBU_EXACTFIT', + 'wxNO_BORDER'] class xxxBitmapButton(xxxObject): allParams = ['bitmap', 'selected', 'focus', 'disabled', 'default', @@ -654,7 +655,7 @@ class xxxBitmapButton(xxxObject): 'default': ParamBool} required = ['bitmap'] winStyles = ['wxBU_AUTODRAW', 'wxBU_LEFT', 'wxBU_RIGHT', - 'wxBU_TOP', 'wxBU_BOTTOM', 'wxBU_EXACTFIT'] + 'wxBU_TOP', 'wxBU_BOTTOM'] class xxxRadioButton(xxxObject): allParams = ['label', 'value', 'pos', 'size', 'style'] @@ -833,6 +834,11 @@ class xxxChildContainer(xxxObject): element.removeChild(node) node.unlink() assert 0, 'no child found' + def resetChild(self, xxx): + '''Reset child info (for replacing with another class).''' + self.child = xxx + self.hasChildren = xxx.hasChildren + self.isSizer = xxx.isSizer class xxxSizerItem(xxxChildContainer): allParams = ['option', 'flag', 'border', 'minsize', 'ratio'] @@ -847,6 +853,12 @@ class xxxSizerItem(xxxChildContainer): if 'pos' in self.child.allParams: self.child.allParams = self.child.allParams[:] self.child.allParams.remove('pos') + def resetChild(self, xxx): + xxxChildContainer.resetChild(self, xxx) + # Remove pos parameter - not needed for sizeritems + if 'pos' in self.child.allParams: + self.child.allParams = self.child.allParams[:] + self.child.allParams.remove('pos') class xxxSizerItemButton(xxxSizerItem): allParams = [] @@ -1089,5 +1101,9 @@ def MakeEmptyRefXXX(parent, ref): pageElem.appendChild(elem) elem = pageElem # Now just make object - return MakeXXXFromDOM(parent, elem) + xxx = MakeXXXFromDOM(parent, elem) + # Label is not used for references + xxx.allParams = xxx.allParams[:] + #xxx.allParams.remove('label') + return xxx